コード例 #1
0
        public static Color ShiftSaturation(Color c, float saturationDelta)
        {
            ColorHSB hsb = ColorHSB.FromColor(c);

            hsb.s += saturationDelta;
            hsb.s  = Math.Min(Math.Max(hsb.s, 0), 255);
            return(FromHSB(hsb));
        }
コード例 #2
0
        public static Color ShiftBrighness(Color c, float brightnessDelta)
        {
            ColorHSB hsb = ColorHSB.FromColor(c);

            hsb.b += brightnessDelta;
            hsb.b  = Math.Min(Math.Max(hsb.b, 0), 255);
            return(FromHSB(hsb));
        }
コード例 #3
0
        public static Color ShiftHue(Color c, float hueDelta)
        {
            ColorHSB hsb = ColorHSB.FromColor(c);

            hsb.h += hueDelta;
            hsb.h  = Math.Min(Math.Max(hsb.h, 0), 360);
            return(FromHSB(hsb));
        }