LitDev.LDColours.GetLightness C# (CSharp) Method

GetLightness() public static method

Get the Lightness component of a colour.
public static GetLightness ( Primitive colour ) : Primitive
colour Primitive The colour to get the component from.
return Primitive
        public static Primitive GetLightness(Primitive colour)
        {
            try
            {
                return RGB2HSL(GetRed(colour), GetGreen(colour), GetBlue(colour))[2];
            }
            catch (Exception ex)
            {
                Utilities.OnError(Utilities.GetCurrentMethod(), ex);
                return 0;
            }
        }