Home/ Reference/ Color

app.CreateGrayColor(Value) / CreateHLSColor(H, L, S) / CreateHSBColor(H, S, B)

Three more ways to build a color: gray (0-255), HLS, HSB. For lighter and darker versions of one hue, change L or B — one number instead of three.

Signature

app.CreateGrayColor(Value) / CreateHLSColor(H, L, S) / CreateHSBColor(H, S, B)

Notes

Three more ways to build a color: gray (0-255), HLS, HSB. For lighter and darker versions of one hue, change L or B — one number instead of three.

Python example (runnable)

Requires pywin32. The example assumes app / doc / page / layer are already connected. See Connection & Init
Python
gray = app.CreateGrayColor(128)                     # mid grey
print("Greyscale: ", gray.Gray)

hls = app.CreateHLSColor(210, 128, 200)             # hue / lightness / saturation
print("HLS hue: ", hls.HLSHue)

hsb = app.CreateHSBColor(210, 200, 240)             # hue / saturation / brightness
print("HSB brightness: ", hsb.HSBBrightness)

About this section: Color

Color — RGB, CMYK and hex color values.

Other entries in this section