Instant properties: saturation

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

Declaration

int32 color.saturation

Discussion

The read access to this property returns the saturation component of a color operand. The write access modifies the saturation 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, luminance and alpha values. The saturation property is expressed as a percentage value in range 0 .. 100, where 0 represents a completely desaturated color (gray) and 100 represents a fully saturated color with maximum intensity. For example:

var color c = #FF0000FF; // Read the saturation value var int32 result = c.saturation; // result = 100 (fully saturated) // Modify the saturation value c.saturation = 50; // c = #BF4040FF (red with 50% saturation)

Usage in Inspector

When working with Inspector you can easily access, evaluate and modify the saturation 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: