Home/ Reference/ Color

color.HexValue / color.RGBValue

HexValue is a #RRGGBB string you can match against the swatch in the design file; RGBValue is RGB packed into a single integer.

Signature

color.HexValue / color.RGBValue

Notes

HexValue is a #RRGGBB string you can match against the swatch in the design file; RGBValue is RGB packed into a single integer.

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("Hex: ", c.HexValue)                          # for example #0085CD
print("RGB integers: ", c.RGBValue)

# decide from the hex value: is it pure black
if c.HexValue.upper() == "#000000":
    print("This is pure black")

About this section: Color

Color — RGB, CMYK and hex color values.

Other entries in this section