PaintColor Struct
Represents an ARGB (alpha, red, green, blue) color.
public readonly struct PaintColor
| Fields |
|
| Empty |
Represents a color that is null. |
| Properties |
|
| A |
Gets the alpha component value of this PaintColor structure. |
| B |
Gets the blue component value of this PaintColor structure. |
| Black |
Gets a system-defined color that has an ARGB value of #FF000000. |
| C |
The cyan component, in [0, 1]. Meaningless unless IsCmyk is true. |
| G |
Gets the green component value of this PaintColor structure. |
| IsCmyk |
True if this color was authored via CSS device-cmyk() and is carried in its native CMYK components (C/M/Y/K) rather than RGB - R/G/B are meaningless when this is true. A colour-managed backend branches on this to keep the CMYK components. |
| IsEmpty |
Specifies whether this PaintColor structure is uninitialized. |
| K |
The key (black) component, in [0, 1]. Meaningless unless IsCmyk is true. |
| LightGray |
Gets a system-defined color that has an ARGB value of #FFD3D3D3. |
| M |
The magenta component, in [0, 1]. Meaningless unless IsCmyk is true. |
| R |
Gets the red component value of this PaintColor structure. |
| Transparent |
Gets a system-defined color. |
| White |
Gets a system-defined color that has an ARGB value of #FFFFFFFF. |
| WhiteSmoke |
Gets a system-defined color that has an ARGB value of #FFF5F5F5. |
| Y |
The yellow component, in [0, 1]. Meaningless unless IsCmyk is true. |
| Methods |
|
| Equals(object) |
Tests whether the specified object is a PaintColor structure and is equivalent to this PaintColor structure. |
| FromArgb(int, int, int) |
Creates a PaintColor structure from the specified 8-bit color values (red, green, and blue). The alpha value is implicitly 255 (fully opaque). Although this method allows a 32-bit value to be passed for each color component, the value of each component is limited to 8 bits. |
| FromArgb(int, int, int, int) |
Creates a PaintColor structure from the four ARGB component (alpha, red, green, and blue) values. Although this method allows a 32-bit value to be passed for each component, the value of each component is limited to 8 bits. |
| FromCmyk(int, float, float, float, float) |
Creates an PaintColor carrying native CMYK components (CSS device-cmyk()) - see IsCmyk. |
| GetHashCode() |
Returns a hash code for this PaintColor structure. |
| ToRgb() |
This color’s RGB rendition: R/G/B directly when this color is already RGB, or a naive CMYK-to-RGB approximation when IsCmyk - a backend with no color management (a screen-oriented raster canvas; a preview) has no better answer than this. A colour-managed PDF writer needs the CMYK components preserved instead (a `/DeviceCMYK` operand, not this conversion), so it branches on IsCmyk instead. |
| ToString() |
Converts this PaintColor structure to a human-readable string. |