Beispiel #1
0
        // Y = Blue 255 -> 0
        protected override void DrawBlue()
        {
            using (Graphics g = Graphics.FromImage(bmp))
            {
                RGBA color = new RGBA(SelectedColor.RGBA.Red, SelectedColor.RGBA.Green, 0, SelectedColor.RGBA.Alpha);

                for (int y = 0; y < ClientHeight; y++)
                {
                    color.Blue = 255 - Round(255 * (double)y / (ClientHeight - 1));

                    using (Pen pen = new Pen(color))
                    {
                        g.DrawLine(pen, 0, y, ClientWidth, y);
                    }
                }
            }
        }
Beispiel #2
0
        // X = Red 0 -> 255
        // Y = Green 255 -> 0
        protected override void DrawBlue()
        {
            using (Graphics g = Graphics.FromImage(bmp))
            {
                RGBA start = new RGBA(0, 0, SelectedColor.RGBA.Blue, SelectedColor.RGBA.Alpha);
                RGBA end = new RGBA(255, 0, SelectedColor.RGBA.Blue, SelectedColor.RGBA.Alpha);

                for (int y = 0; y < ClientHeight; y++)
                {
                    start.Green = end.Green = Round(255 - (255 * (double)y / (ClientHeight - 1)));

                    using (LinearGradientBrush brush = new LinearGradientBrush(new Rectangle(0, 0, ClientWidth, 1), start, end, LinearGradientMode.Horizontal))
                    {
                        g.FillRectangle(brush, new Rectangle(0, y, ClientWidth, 1));
                    }
                }
            }
        }
Beispiel #3
0
 public void CMYKUpdate()
 {
     RGBA = CMYK;
     HSB = CMYK;
 }
Beispiel #4
0
 public void HSBUpdate()
 {
     RGBA = HSB;
     CMYK = HSB;
 }
Beispiel #5
0
 public MyColor(Color color)
 {
     RGBA = color;
     HSB = color;
     CMYK = color;
 }