Beispiel #1
0
 public void UpdateCMYK()
 {
     this.argb = cmyk.ToColor();
     this.hsl  = cmyk;
     this.hsb  = cmyk;
     this.xyz  = cmyk;
 }
Beispiel #2
0
 public void UpdateXYZ()
 {
     this.hsb  = xyz;
     this.cmyk = xyz;
     this.hsb  = xyz;
     this.argb = xyz;
 }
Beispiel #3
0
 public void UpdateHSL()
 {
     this.argb = hsl.ToColor();
     this.hsb  = hsl;
     this.cmyk = hsl;
     this.xyz  = hsl;
 }
Beispiel #4
0
 public void UpdateHSB()
 {
     this.argb = hsb.ToColor();
     this.hsl  = hsb;
     this.cmyk = hsb;
     this.xyz  = hsb;
 }
Beispiel #5
0
 public _Color(Color color)
 {
     argb  = color;
     hsb   = color;
     hsl   = color;
     cmyk  = color;
     alpha = color.A;
     xyz   = color;
 }
Beispiel #6
0
        protected override void DrawGreen()
        {
            using (Graphics g = Graphics.FromImage(bmp))
            {
                ARGB start = new ARGB(SelectedColor.argb.A, SelectedColor.argb.R, 255, SelectedColor.argb.B);
                ARGB end   = new ARGB(SelectedColor.argb.A, SelectedColor.argb.R, 0, SelectedColor.argb.B);

                using (LinearGradientBrush brush = new LinearGradientBrush(new Rectangle(0, 0, clientWidth, clientHeight), start, end, LinearGradientMode.Vertical))
                {
                    g.FillRectangle(brush, new Rectangle(0, 0, clientWidth, clientHeight));
                }
            }
        }
Beispiel #7
0
        // slider controls blue
        // x = red 0 -> 255
        // y = green 255 -> 0
        protected override void DrawBlue()
        {
            using (Graphics g = Graphics.FromImage(bmp))
            {
                ARGB start = new ARGB(selectedColor.argb.A, 0, 0, (int)selectedColor.argb.B);
                ARGB end   = new ARGB(selectedColor.argb.A, 255, 0, (int)selectedColor.argb.B);

                for (int y = 0; y < clientHeight; y++)
                {
                    start.G = end.G = (int)Math.Round(255 - ((double)y / (clientHeight)) * 255);

                    using (LinearGradientBrush brush = new LinearGradientBrush(new Rectangle(0, 0, clientWidth, 1), start, end, LinearGradientMode.Horizontal))
                    {
                        g.FillRectangle(brush, new Rectangle(0, y, clientWidth, 1));
                    }
                }
            }
        }