shape.Fill.ApplyFountainFill(...)
Gradient fill: start color, end color, type, angle, edge pad, midpoint.
Signature
shape.Fill.ApplyFountainFill(...)
Notes
Gradient fill: start color, end color, type, angle, edge pad, midpoint.
Python example (runnable)
Requires
pywin32. The example assumes app / doc / page / layer are already connected.
See Connection & InitPython
shape = app.ActiveSelectionRange(1)
# fountain fill: type / angle / start colour / end colour / edge pad / midpoint
# argument order shifts between versions; on error build colours with CreateRGBColor
try:
c1 = app.CreateRGBColor(255, 255, 255)
c2 = app.CreateRGBColor(0, 133, 205)
shape.Fill.ApplyFountainFill(0, 90, c1, c2, 0, 50)
print("Fountain fill applied")
except Exception as e:
print("ApplyFountainFill argument mismatch: ", e)
About this section: Fill
Fill — uniform, gradient and pattern fills.
- This section has 11 entries; this is one of them.
- See the full section index: Fill
Other entries in this section
- shape.Fill.TypeFill type. 0 none / 1 uniform / 2 fountain / 3 PostScript / 8 texture
- shape.Fill.UniformColorThe color object behind a uniform fill. Requires Fill.Type == 1, other
- shape.Fill.UniformColor.RGBAssign(r, g, b)Assigns RGB, each component 0-255. RGBAssign(0, 133, 205) in the code
- shape.Fill.UniformColor.CMYKAssign(c, m, y, k)Assigns CMYK. More accurate for anything that goes to press.
- shape.Fill.UniformColor.HexValueHex color value, e.g. "#FFFF00". Call .upper() on the way out before c
- shape.Fill.UniformColor.RGBRed / .RGBGreen / .RGBBlueReads one channel at a time.
- shape.Fill.UniformColor.CMYKCyan / .CMYKMagenta / .CMYKYellow / .CMYKBlackReads one CMYK channel at a time.
- shape.Fill.ApplyUniformFill(color)Sets a uniform fill in one call; build the color with app.CreateRGBCol