Balakin.VSOutputEnhancer.Utils.GetLightness C# (CSharp) Method

GetLightness() public static method

public static GetLightness ( this c ) : Double
c this
return Double
        public static Double GetLightness(this Color c)
        {
            var r = (Double)c.R / Byte.MaxValue;
            var g = (Double)c.G / Byte.MaxValue;
            var b = (Double)c.B / Byte.MaxValue;
            return (Math.Max(Math.Max(r, g), b) + Math.Min(Math.Min(r, g), b)) / 2;
        }