private static byte GetWhite(Color rgb) { return (byte)((255.0 - GetSaturation(rgb)) / 255.0 * (rgb.R + rgb.G + rgb.B) / 3.0); }