Exemplo n.º 1
0
        private void UpdateControls(MyColor color, ColorType type)
        {
            DrawPreviewColors();
            _controlChangingColor = true;

            if (type != ColorType.HSB)
            {
                nudHue.SetValue((decimal)Math.Round(color.Hsb.Hue360));
                nudSaturation.SetValue((decimal)Math.Round(color.Hsb.Saturation100));
                nudBrightness.SetValue((decimal)Math.Round(color.Hsb.Brightness100));
            }

            if (type != ColorType.RGBA)
            {
                nudRed.SetValue(color.Rgba.Red);
                nudGreen.SetValue(color.Rgba.Green);
                nudBlue.SetValue(color.Rgba.Blue);
                nudAlpha.SetValue(color.Rgba.Alpha);
            }

            if (type != ColorType.CMYK)
            {
                nudCyan.SetValue((decimal)color.Cmyk.Cyan100);
                nudMagenta.SetValue((decimal)color.Cmyk.Magenta100);
                nudYellow.SetValue((decimal)color.Cmyk.Yellow100);
                nudKey.SetValue((decimal)color.Cmyk.Key100);
            }

            if (type != ColorType.Hex)
            {
                txtHex.Text = ColorHelpers.ColorToHex(color);
            }

            if (type != ColorType.Decimal)
            {
                txtDecimal.Text = ColorHelpers.ColorToDecimal(color).ToString();
            }

            _controlChangingColor = false;
        }
Exemplo n.º 2
0
 /// <inheritdoc />
 /// <summary>
 /// </summary>
 /// <param name="color"></param>
 /// <param name="drawStyle"></param>
 public ColorEventArgs(MyColor color, DrawStyle drawStyle)
 {
     Color     = color;
     DrawStyle = drawStyle;
 }
Exemplo n.º 3
0
 public bool Equals(MyColor other)
 {
     return(Rgba.Equals(other.Rgba));
 }
Exemplo n.º 4
0
 /// <inheritdoc />
 /// <summary>
 /// </summary>
 /// <param name="color"></param>
 /// <param name="colorType"></param>
 public ColorEventArgs(MyColor color, ColorType colorType)
 {
     Color     = color;
     ColorType = colorType;
 }