Get Color illumination - CSharp System.Drawing

CSharp examples for System.Drawing:Color Brightness

Description

Get Color illumination

Demo Code


using Windows.UI.Xaml;
using Windows.UI;

public class Main{
        public static float GetLuma(this Color color)
        {//from w  w  w.  ja  v  a  2 s  .  c  o m
            return (0.2126f * (color.R / 255.0f)) + (0.7152f * (color.G / 255.0f)) + (0.0722f * (color.B / 255.0f));
        }
}

Related Tutorials