Instant properties: luminance

The instant property luminance corresponds to the luminance component of a color operand expressed in the HSL (Hue, Saturation, Luminance) color model.

Declaration

int32 color.luminance

Discussion

The read access to this property returns the luminance component of a color operand. The write access modifies the luminance component of a color operand. The modification automatically updates the red, green and blue components according to the HSL color model while preserving the hue, saturation and alpha values. The luminance property is expressed as a percentage value in range 0 .. 100, where 0 represents black, 100 represents white, and 50 represents the pure hue color. For example:

var color c = #FF0000FF; // Read the luminance value var int32 result = c.luminance; // result = 50 (pure red) // Modify the luminance value c.luminance = 75; // c = #FF8080FF (lighter red)

Usage in Inspector

When working with Inspector you can easily access, evaluate and modify the luminance component. For this purpose select in Inspector the desired color property or attribute and click on the small triangle on its left side to expand and display the subordinated components: