Exemplo n.º 1
0
        protected void GetBoxColor()
        {
            switch (DrawStyle)
            {
            case DrawStyle.Hue:
                selectedColor.HSB.Saturation = (double)lastPos.X / (ClientWidth - 1);
                selectedColor.HSB.Brightness = 1.0 - (double)lastPos.Y / (ClientHeight - 1);
                selectedColor.HSBUpdate();
                break;

            case DrawStyle.Saturation:
                selectedColor.HSB.Hue        = (double)lastPos.X / (ClientWidth - 1);
                selectedColor.HSB.Brightness = 1.0 - (double)lastPos.Y / (ClientHeight - 1);
                selectedColor.HSBUpdate();
                break;

            case DrawStyle.Brightness:
                selectedColor.HSB.Hue        = (double)lastPos.X / (ClientWidth - 1);
                selectedColor.HSB.Saturation = 1.0 - (double)lastPos.Y / (ClientHeight - 1);
                selectedColor.HSBUpdate();
                break;

            case DrawStyle.Red:
                selectedColor.RGBA.Blue  = Round(255 * (double)lastPos.X / (ClientWidth - 1));
                selectedColor.RGBA.Green = Round(255 * (1.0 - (double)lastPos.Y / (ClientHeight - 1)));
                selectedColor.RGBAUpdate();
                break;

            case DrawStyle.Green:
                selectedColor.RGBA.Blue = Round(255 * (double)lastPos.X / (ClientWidth - 1));
                selectedColor.RGBA.Red  = Round(255 * (1.0 - (double)lastPos.Y / (ClientHeight - 1)));
                selectedColor.RGBAUpdate();
                break;

            case DrawStyle.Blue:
                selectedColor.RGBA.Red   = Round(255 * (double)lastPos.X / (ClientWidth - 1));
                selectedColor.RGBA.Green = Round(255 * (1.0 - (double)lastPos.Y / (ClientHeight - 1)));
                selectedColor.RGBAUpdate();
                break;
            }
        }
Exemplo n.º 2
0
 public override void GetSliderColor(Point lastPos, MyColor selectedColor, int ClientWidth, int ClientHeight)
 {
     selectedColor.HSB.Brightness = 1.0 - (double)lastPos.Y / (ClientHeight - 1);
     selectedColor.HSBUpdate();
 }
Exemplo n.º 3
0
 public override void GetBoxColor(Point lastPos, MyColor selectedColor, int ClientWidth, int ClientHeight)
 {
     selectedColor.HSB.Hue        = (double)lastPos.X / (ClientWidth - 1);
     selectedColor.HSB.Saturation = 1.0 - (double)lastPos.Y / (ClientHeight - 1);
     selectedColor.HSBUpdate();
 }