Esempio n. 1
0
        public static ColorF WithLightness(this IColorType original, double lightness)
        {
            double hue0To1;
            double saturation0To1;
            double lightness0To1;

            ColorF colorF = original is ColorF ? (ColorF)original : original.ToColorF();

            colorF.GetHSL(out hue0To1, out saturation0To1, out lightness0To1);

            return(ColorF.FromHSL(hue0To1, saturation0To1, lightness));
        }
Esempio n. 2
0
        public static ColorF WithLightnessAdjustment(this IColorType original, double lightnessMultiplier)
        {
            double hue0To1;
            double saturation0To1;
            double lightness0To1;

            ColorF colorF = original is ColorF ? (ColorF)original : original.ToColorF();

            colorF.GetHSL(out hue0To1, out saturation0To1, out lightness0To1);
            lightness0To1 *= lightnessMultiplier;

            return(ColorF.FromHSL(hue0To1, saturation0To1, lightness0To1));
        }