/// <summary> /// /// </summary> /// <param name="color"></param> /// <param name="brightness">Valid values are 0.0 to 1.0. 0 is dark, 1 is light.</param> /// <returns></returns> public static Color ChangeBrightness(Color color, double brightness) { if (brightness < 0 || brightness > 1) { throw new InvalidOperationException("Brightness parameter must have a value between 0 and 1."); } return(RGBHSL.SetBrightness(color, brightness)); }
public static double GetBrightness(Color color) { return(RGBHSL.RGB_to_HSL(color).L); }