Skip to content
本页内容

RGB (属性)

返回或设置一个 int 值,它代表指定颜色的红绿蓝 (RGB) 值。

示例

python
#本示例显示第一张工作表上第二个形状背景填充色是否为红色
def test():
    colorFormat = Worksheets.Item(1).Shapes.Item(2).Fill.BackColor
    print(colorFormat.RGB == RGB(255, 0, 0))
python
#本示例设置活动工作表中第一个形状前景填充色为绿色
def test():
    ActiveSheet.Shapes.Item(1).Fill.ForeColor.RGB = RGB(0, 255, 0)