CSharp examples for System.Drawing:Color
gray scale a Color
using Microsoft.Xna.Framework; using System;/* w ww .j a v a 2 s . c o m*/ public class Main{ static public Color grayscale( this Color color ) { return new Color( (int)( color.R * 0.3 + color.G * 0.59 + color.B * 0.11 ), (int)( color.R * 0.3 + color.G * 0.59 + color.B * 0.11 ), (int)( color.R * 0.3 + color.G * 0.59 + color.B * 0.11 ), color.A ); } }