首页/ 接口索引/ 渐变填充

ff.StartColor / ff.EndColor

两端颜色,套在 FountainFill 上。读没问题;要换颜色,稳妥做法是重新调一次 ApplyFountainFill(),别硬给属性赋值。

签名

ff.StartColor / ff.EndColor

说明

两端颜色,套在 FountainFill 上。读没问题;要换颜色,稳妥做法是重新调一次 ApplyFountainFill(),别硬给属性赋值。

Python 示例(可直接运行)

依赖 pywin32。示例假定 app / doc / page / layer 已就绪。 见「连接与初始化」
Python
shape = app.ActiveSelectionRange(1)
ff = shape.Fill.ApplyFountainFill(
    app.CreateRGBColor(0, 133, 205),
    app.CreateRGBColor(255, 255, 255), 1, 90)

print("起点色:", ff.StartColor.HexValue)            # 读出来是 #0085CD
print("终点色:", ff.EndColor.HexValue)

# 想换颜色:重新 Apply 一次最保险
ff = shape.Fill.ApplyFountainFill(
    app.CreateRGBColor(255, 214, 0),
    app.CreateRGBColor(255, 255, 255), 1, 90)
print("换完起点色:", ff.StartColor.HexValue)

关于本类:渐变填充

CorelDRAW 的渐变叫 fountain fill。入口是 Fill.ApplyFountainFill(),返回值就是 FountainFill 对象。Type:1 线性 / 2 射线 / 3 锥形 / 4 方形。

同类其他接口