Пример #1
0
 public CMYK(Color color)
 {
     this = ColorHelpers.ColorToCMYK(color);
 }
Пример #2
0
 public Color ToColor()
 {
     return(ColorHelpers.CMYKToColor(this));
 }
Пример #3
0
 public HSB ToHSB()
 {
     return(ColorHelpers.ColorToHSB(this));
 }
Пример #4
0
 public CMYK ToCMYK()
 {
     return(ColorHelpers.ColorToCMYK(this));
 }
Пример #5
0
 public string ToHex(ColorFormat format = ColorFormat.RGB)
 {
     return(ColorHelpers.ColorToHex(this, format));
 }
Пример #6
0
 public int ToDecimal(ColorFormat format = ColorFormat.RGB)
 {
     return(ColorHelpers.ColorToDecimal(this, format));
 }
Пример #7
0
        public override string ToString()
        {
            return(String.Format(
                       @"RGBA (Red, Green, Blue, Alpha) = {0}, {1}, {2}, {3}
HSB (Hue, Saturation, Brightness) = {4:0.0}°, {5:0.0}%, {6:0.0}%
CMYK (Cyan, Magenta, Yellow, Key) = {7:0.0}%, {8:0.0}%, {9:0.0}%, {10:0.0}%
Hex (RGB, RGBA, ARGB) = #{11}, #{12}, #{13}
Decimal (RGB, RGBA, ARGB) = {14}, {15}, {16}",
                       RGBA.Red, RGBA.Green, RGBA.Blue, RGBA.Alpha,
                       HSB.Hue360, HSB.Saturation100, HSB.Brightness100,
                       CMYK.Cyan100, CMYK.Magenta100, CMYK.Yellow100, CMYK.Key100,
                       ColorHelpers.ColorToHex(this), ColorHelpers.ColorToHex(this, ColorFormat.RGBA), ColorHelpers.ColorToHex(this, ColorFormat.ARGB),
                       ColorHelpers.ColorToDecimal(this), ColorHelpers.ColorToDecimal(this, ColorFormat.RGBA), ColorHelpers.ColorToDecimal(this, ColorFormat.ARGB)));
        }
Пример #8
0
        private void tsmiCopyDecimal_Click(object sender, EventArgs e)
        {
            int dec = ColorHelpers.ColorToDecimal(colorPicker.SelectedColor, ColorFormat.RGB);

            ClipboardHelpers.CopyText(dec.ToString());
        }
Пример #9
0
        private void tsmiCopyHexadecimal_Click(object sender, EventArgs e)
        {
            string hex = ColorHelpers.ColorToHex(colorPicker.SelectedColor, ColorFormat.RGB);

            ClipboardHelpers.CopyText("#" + hex);
        }
Пример #10
0
 public Color ToColor()
 {
     return(ColorHelpers.HSBToColor(this));
 }
Пример #11
0
 public HSB(Color color)
 {
     this = ColorHelpers.ColorToHSB(color);
 }