CSharp examples for System.Drawing:Color Brightness
Get Color Luminance
using System.Drawing.Imaging; using System.Drawing; using System.Threading.Tasks; using System.Text; using System.Runtime.InteropServices; using System.Linq; using System.Collections.Generic; using System;/*from www .j av a 2 s. c om*/ public class Main{ public static int GetLuminance (this Color color) { return (int) (color.R * 0.2126 + color.G * 0.7152 + color.B * 0.0722); } }