Color Lighten( float fraction )

book_4_sparkGenerated
code_blocksInput

Description

The Lighten method is a member of the Color struct, which is used to increase the brightness of a color by a specified fraction. This method adjusts the color's RGB components to make it lighter, while keeping the alpha component unchanged.

Usage

To use the Lighten method, call it on an instance of the Color struct, passing a float value as the fraction parameter. The fraction should be a value between 0 and 1, where 0 means no change and 1 means the maximum lightening effect.

Example usage:

Color originalColor = new Color(0.5f, 0.5f, 0.5f, 1.0f);
Color lighterColor = originalColor.Lighten(0.2f);

In this example, lighterColor will be a lighter version of originalColor.

Example

Color originalColor = new Color(0.5f, 0.5f, 0.5f, 1.0f);
Color lighterColor = originalColor.Lighten(0.2f);