Skip to content
本页内容

Color (属性)

返回或设置指定对象的颜色。可读/写。

返回值

Any

示例

python
#本示例显示活动单元格的第二个ColorStop对象颜色是否为蓝色
def test():
    colorStop = ActiveCell.Interior.Gradient.ColorStops.Item(2)
    print(colorStop.Color == RGB(0, 0, 255))
python
#本示例将当前选定区域的第一个ColorStop对象的颜色设置为红色
def test():
    Range("A1:A10").Select()
    colorStop = Selection.Interior.Gradient.ColorStops.Item(1)
    colorStop.Color = RGB(255, 0, 0)