Home/ Reference/ Fill

shape.Fill.UniformColor.RGBRed / .RGBGreen / .RGBBlue

Reads one channel at a time.

Signature

shape.Fill.UniformColor.RGBRed / .RGBGreen / .RGBBlue

Notes

Reads one channel at a time.

Python example (runnable)

Requires pywin32. The example assumes app / doc / page / layer are already connected. See Connection & Init
Python
shape = app.ActiveSelectionRange(1)
c = shape.Fill.UniformColor

print("R:", c.RGBRed)
print("G:", c.RGBGreen)
print("B:", c.RGBBlue)

# test for pure yellow on the channels; sturdier than parsing hex
if c.RGBRed == 255 and c.RGBGreen == 255 and c.RGBBlue == 0:
    print("Confirmed pure yellow")

About this section: Fill

Fill — uniform, gradient and pattern fills.

Other entries in this section