public static System.Windows.Media.Color ByChangingLightness(this System.Windows.Media.Color self, double l) { RGBComponents rgb = self.GetRGB(); HSL hsl = RGBToHSL(rgb.Red, rgb.Green, rgb.Blue); return(FromHSL(hsl.Hue, hsl.Saturation, l, rgb.Alpha)); }