devices/System.Drawing/System.Drawing.cs
/// <summary>
/// Gets the hue-saturation-lightness (HSL) hue value, in degrees, for this System.Drawing.Color structure.
/// </summary>
/// <returns>The hue, in degrees, of this System.Drawing.Color. The hue is measured in degrees,
/// ranging from 0.0 through 360.0, in HSL color space.</returns>
Gets the hue-saturation-lightness (HSL) hue value, in degrees, for this System.Drawing.Color structure.
Gets the hue - saturation - lightness ( HSL ) hue value in degrees for this System . Drawing . Color structure .
public float GetHue()
        {
            float r = ((float)R / 255.0f);
            float g = ((float)G / 255.0f);
            float b = ((float)B / 255.0f);
            float max = r > b ? r : b;
            max = max > g ? max : g;
            float min = r > b ? b : r;
            min = min > g ? g : min;
            float h = 0.0f;
            if (max == r && g >= b)
            {
                h = 60 * (g - b) / (max - min);
            }
            else if (max == r && g < b)
            {
                h = 60 * (g - b) / (max - min) + 360;
            }
            else if (max == g)
            {
                h = 60 * (b - r) / (max - min) + 120;
            }
            else if (max == b)
            {
                h = 60 * (r - g) / (max - min) + 240;
            }
            return h;
        }
public float GetHue ( ) { float r = ( ( float ) R / 255.0f ) ; float g = ( ( float ) G / 255.0f ) ; float b = ( ( float ) B / 255.0f ) ; float max = r > b ? r : b ; max = max > g ? max : g ; float min = r > b ? b : r ; min = min > g ? g : min ; float h = 0.0f ; if ( max == r && g >= b ) { h = 60 * ( g - b ) / ( max - min ) ; } else if ( max == r && g < b ) { h = 60 * ( g - b ) / ( max - min ) + 360 ; } else if ( max == g ) { h = 60 * ( b - r ) / ( max - min ) + 120 ; } else if ( max == b ) { h = 60 * ( r - g ) / ( max - min ) + 240 ; } return h ; }
Gets the hue-saturation-lightness (HSL) hue value, in degrees, for this System.Drawing.Color structure.
Gets the hue - saturation - lightness ( HSL ) hue value in degrees for this System . Drawing . Color structure .
The hue, in degrees, of this System.Drawing.Color. The hue is measured in degrees,
ranging from 0.0 through 360.0, in HSL color space.
The hue in degrees of this System . Drawing . Color . The hue is measured in degrees ranging from 0 . 0 through 360 . 0 in HSL color space .