GetColorHLS()

Summary

Returns the hue, lightness and saturation of a color.

Syntax

hls_array = GetColorHLS(color c)

Argument Contents
c The color whose hue, lightness and saturation are determined

Returns

An array of three (3) elements: the hue, lightness and saturation values.

Element Type Contents
1 Real Hue in color spectrum, from 0 (inclusive) to 360 (exclusive), or -1.0 for achromatic colors
2 Real Lightness value, from 0 (lightest, white) to 1 (darkest, black), with 0.5 being the lightness value of maximally bright pure red, green and blue colors
3 Real Saturation, 0 (unsaturated, achromatic) to 1 (maximally saturated, pure color)

Notes

  • Pure red with maximum brightness corresponds to (hue = 0, lightness = 0.5, saturation = 1). Pure green and pure blue are similar with hues of 120 and 240 respectively.

  • Pure white corresponds to (hue = -1, lightness = 0, saturation = 0).

  • Pure black corresponds to (hue = -1, lightness = 1, saturation = 0).

See Also

Function Summary
ColorHLS() Creates a color based on hue, lightness, and saturation