Color Saturate( float fraction )

book_4_sparkGenerated
code_blocksInput

Description

The Saturate method is used to increase the saturation of a color by a specified fraction. Saturation refers to the intensity or purity of the color. Increasing saturation makes colors appear more vivid, while decreasing it makes them appear more washed out.

Usage

To use the Saturate method, call it on an instance of the Color struct, passing a float value as the fraction parameter. This value should be between 0 and 1, where 0 means no change and 1 means full saturation.

Example

Color originalColor = new Color(0.5f, 0.5f, 0.5f, 1.0f);
float saturationIncrease = 0.2f;
Color saturatedColor = originalColor.Saturate(saturationIncrease);

// The saturatedColor now has increased saturation compared to originalColor.