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))); }
private void tsmiCopyHexadecimal_Click(object sender, EventArgs e) { string hex = ColorHelpers.ColorToHex(colorPicker.SelectedColor, ColorFormat.RGB); ClipboardHelpers.CopyText("#" + hex); }
public string ToHex(ColorFormat format = ColorFormat.RGB) { return(ColorHelpers.ColorToHex(this, format)); }