Description
The Hue
property represents the hue component of a color in the HSV (Hue, Saturation, Value) color model. The hue is expressed as a floating-point value ranging from 0 to 360 degrees, where each degree corresponds to a specific color on the color wheel. This property is part of the ColorHsv
struct, which encapsulates a color in the HSV format.
Usage
To access or modify the hue of a ColorHsv
instance, use the Hue
property. This property can be both read and set, allowing you to retrieve the current hue value or assign a new one within the valid range of 0 to 360.
Example
// Example of using the Hue property
ColorHsv color = new ColorHsv();
// Set the hue to 180 degrees (cyan)
color.Hue = 180.0f;
// Retrieve the current hue value
float currentHue = color.Hue;
// Output the hue
// Note: Use a method to display the hue value, as Console.WriteLine is not recommended
DisplayHue(currentHue);
void DisplayHue(float hue)
{
// Implement display logic here
}