Description
The Saturation
property of the ColorHsv
struct represents the saturation level of the color. It is a floating-point value ranging from 0 to 1, where 0 indicates a completely desaturated color (white) and 1 indicates full saturation (vivid color). This property is part of the HSV (Hue, Saturation, Value) color model, which is often used in graphics applications to describe colors in a way that is more intuitive than the RGB model.
Usage
To use the Saturation
property, you can get or set its value on an instance of the ColorHsv
struct. Adjusting the saturation will affect how vivid or muted the color appears.
Example
// Example of using the Saturation property
ColorHsv color = new ColorHsv();
// Set the saturation to 0.5 (halfway between white and full color)
color.Saturation = 0.5f;
// Get the current saturation value
float currentSaturation = color.Saturation;
// Output the saturation value
// Note: Avoid using Console.WriteLine in s&box
// Instead, use the appropriate logging or debugging tools available in the environment
// Log.Info($"Current Saturation: {currentSaturation}");