Get illumination From Color - CSharp System.Drawing

CSharp examples for System.Drawing:Color Brightness

Description

Get illumination From Color

Demo Code


using Windows.UI;
using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//from ww w. j a v a2 s  . c  o m

public class Main{
        public static double GetLumaFromColor(Color color)
        {
            return  0.299 * color.R + 0.587 * color.G + 0.114 * color.B;
        }
}

Related Tutorials