Home/ Reference/ Fountain Fill

ff.Colors.Add(Position, Color)

Inserts an intermediate stop, for three-color and rainbow gradients. Position is 0-100; Color is a Color object.

Signature

ff.Colors.Add(Position, Color)

Notes

Inserts an intermediate stop, for three-color and rainbow gradients. Position is 0-100; Color is a Color object.

Python example (runnable)

Requires pywin32. The example assumes app / doc / page / layer are already connected. See Connection & Init
Python
shape = app.ActiveSelectionRange(1)
ff = shape.Fill.ApplyFountainFill(
    app.CreateRGBColor(0, 133, 205),
    app.CreateRGBColor(255, 255, 255), 1, 90)

ff.Colors.Add(50, app.CreateRGBColor(255, 200, 0))  # drop a bright yellow stop at 50%

for i in range(1, ff.Colors.Count + 1):             # COM collections start at 1
    c = ff.Colors.Item(i)                           # a FountainColor stop
    print("position", c.Position, "%  colour", c.Color.HexValue)

About this section: Fountain Fill

Fountain Fill — linear and radial gradient fills.

Other entries in this section