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 & InitPython
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.
- This section has 10 entries; this is one of them.
- See the full section index: Color
Other entries in this section
- app.CreateRGBColor(Red, Green, Blue)Builds an RGB color, each component 0-255. Screen work, web images, so
- app.CreateCMYKColor(Cyan, Magenta, Yellow, Black)Builds a CMYK color, each component 0-100. If the job ends up on press
- color.RGBAssign(R, G, B) / color.CMYKAssign(C, M, Y, K)Changes the components of an existing color in place. No new object —
- color.HLSAssign(H, L, S) / color.HSBAssign(H, S, B) / color.GrayAssign(V)In-place recolor via HLS, HSB or gray. To generate a scale of one hue
- color.ConvertToCMYK() / ConvertToRGB() / ConvertToGray() / ConvertToHLS()Explicit color model conversion. It mutates the object rather than ret
- color.HexValue / color.RGBValueHexValue is a #RRGGBB string you can match against the swatch in the d
- color.BlendWith(OtherColor, Weight)Mixes two colors into an in-between shade. Automatic palettes and tona
- color.CopyAssign(SourceColor) / color.IsSame(OtherColor)Copies one color's values onto another (without changing object refere