Description
The WithBlue
method allows you to create a new Color
instance by modifying the blue component of the current color. The method returns a new Color
object with the specified blue value, while keeping the other color components (red, green, and alpha) unchanged.
Usage
To use the WithBlue
method, call it on an existing Color
instance and pass the desired blue component value as a float
between 0 and 1. The method will return a new Color
instance with the updated blue component.
Example
// Example of using the WithBlue method
Color originalColor = new Color(0.5f, 0.5f, 0.5f, 1.0f); // A gray color
Color newColor = originalColor.WithBlue(0.8f); // Change the blue component to 0.8
// newColor is now (0.5, 0.5, 0.8, 1.0)