Struct XColor
Represents an RGB, CMYK, or gray scale color.
public struct XColor
- Inherited Members
Fields
Empty
Represents the empty color.
public static readonly XColor Empty
Field Value
Properties
A
Gets or sets the alpha value the specifies the transparency. The value is in the range from 1 (opaque) to 0 (completely transparent).
public double A { get; set; }
Property Value
B
Gets or sets the blue value.
public byte B { get; set; }
Property Value
C
Gets or sets the cyan value.
public double C { get; set; }
Property Value
ColorSpace
Gets or sets the color space to be used for PDF generation.
public XColorSpace ColorSpace { get; set; }
Property Value
G
Gets or sets the green value.
public byte G { get; set; }
Property Value
GS
Gets or sets the gray scale value.
public double GS { get; set; }
Property Value
IsEmpty
Indicates whether this XColor structure is uninitialized.
public bool IsEmpty { get; }
Property Value
IsKnownColor
Gets a value indicating whether this color is a known color.
public bool IsKnownColor { get; }
Property Value
K
Gets or sets the black (or key) value.
public double K { get; set; }
Property Value
M
Gets or sets the magenta value.
public double M { get; set; }
Property Value
R
Gets or sets the red value.
public byte R { get; set; }
Property Value
RgbCmykG
Special property for XmlSerializer only.
public string RgbCmykG { get; set; }
Property Value
Y
Gets or sets the yellow value.
public double Y { get; set; }
Property Value
Methods
Equals(object?)
Determines whether the specified object is a Color structure and is equivalent to this Color structure.
public override bool Equals(object? obj)
Parameters
obj
object
Returns
FromArgb(int)
Creates an XColor structure from a 32-bit ARGB value.
public static XColor FromArgb(int argb)
Parameters
argb
int
Returns
FromArgb(int, XColor)
Creates an XColor structure from the specified alpha value and color.
public static XColor FromArgb(int alpha, XColor color)
Parameters
Returns
FromArgb(int, int, int)
Creates an XColor structure from the specified 8-bit color values (red, green, and blue). The alpha value is implicitly 255 (fully opaque).
public static XColor FromArgb(int red, int green, int blue)
Parameters
Returns
FromArgb(int, int, int, int)
Creates an XColor structure from the four ARGB component (alpha, red, green, and blue) values.
public static XColor FromArgb(int alpha, int red, int green, int blue)
Parameters
Returns
FromArgb(uint)
Creates an XColor structure from a 32-bit ARGB value.
public static XColor FromArgb(uint argb)
Parameters
argb
uint
Returns
FromCmyk(double, double, double, double)
Creates an XColor structure from the specified CMYK values.
public static XColor FromCmyk(double cyan, double magenta, double yellow, double black)
Parameters
Returns
FromCmyk(double, double, double, double, double)
Creates an XColor structure from the specified CMYK values.
public static XColor FromCmyk(double alpha, double cyan, double magenta, double yellow, double black)
Parameters
Returns
FromGrayScale(double)
Creates an XColor structure from the specified gray value.
public static XColor FromGrayScale(double grayScale)
Parameters
grayScale
double
Returns
FromKnownColor(XKnownColor)
Creates an XColor from the specified pre-defined color.
public static XColor FromKnownColor(XKnownColor color)
Parameters
color
XKnownColor
Returns
FromName(string)
Creates an XColor from the specified name of a pre-defined color.
[Obsolete("Not really implemented and not useful. See XColorResourceManager.")]
public static XColor FromName(string name)
Parameters
name
string
Returns
GetBrightness()
Gets the hue-saturation-brightness (HSB) brightness value for this color.
public double GetBrightness()
Returns
- double
The brightness of this color. The brightness ranges from 0 through 1, where 0 represents black and 1 represents white.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
GetHue()
Gets the hue-saturation-brightness (HSB) hue value, in degrees, for this color.
public double GetHue()
Returns
- double
The hue, in degrees, of this color. The hue is measured in degrees, ranging from 0 through 360, in HSB color space.
GetSaturation()
Gets the hue-saturation-brightness (HSB) saturation value for this color.
public double GetSaturation()
Returns
- double
The saturation of this color. The saturation ranges from 0 through 1, where 0 is grayscale and 1 is the most saturated.
Operators
operator ==(XColor, XColor)
Determines whether two colors are equal.
public static bool operator ==(XColor left, XColor right)
Parameters
Returns
operator !=(XColor, XColor)
Determines whether two colors are not equal.
public static bool operator !=(XColor left, XColor right)