Namespace: PdfSharp.Drawing
Represents an RGB, CMYK, or gray scale color.
public struct XColor
Inheritance Object → ValueType → XColor
Represents the empty color.
public static XColor Empty;
Gets or sets the color space to be used for PDF generation.
public XColorSpace ColorSpace { get; set; }
Indicates whether this XColor structure is uninitialized.
public bool IsEmpty { get; }
Gets a value indicating whether this color is a known color.
public bool IsKnownColor { get; }
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; }
Gets or sets the red value.
public byte R { get; set; }
Gets or sets the green value.
public byte G { get; set; }
Gets or sets the blue value.
public byte B { get; set; }
Gets or sets the cyan value.
public double C { get; set; }
Gets or sets the magenta value.
public double M { get; set; }
Gets or sets the yellow value.
public double Y { get; set; }
Gets or sets the black (or key) value.
public double K { get; set; }
Gets or sets the gray scale value.
public double GS { get; set; }
Special property for XmlSerializer only.
public string RgbCmykG { get; set; }
Creates an XColor structure from a 32-bit ARGB value.
XColor FromArgb(int argb)
argb
Int32
Creates an XColor structure from a 32-bit ARGB value.
XColor FromArgb(uint argb)
argb
UInt32
Creates an XColor structure from the specified 8-bit color values (red, green, and blue). The alpha value is implicitly 255 (fully opaque).
XColor FromArgb(int red, int green, int blue)
red
Int32
green
Int32
blue
Int32
Creates an XColor structure from the four ARGB component (alpha, red, green, and blue) values.
XColor FromArgb(int alpha, int red, int green, int blue)
alpha
Int32
red
Int32
green
Int32
blue
Int32
Creates an XColor structure from the specified alpha value and color.
XColor FromArgb(int alpha, XColor color)
alpha
Int32
color
XColor
Creates an XColor structure from the specified CMYK values.
XColor FromCmyk(double cyan, double magenta, double yellow, double black)
cyan
Double
magenta
Double
yellow
Double
black
Double
Creates an XColor structure from the specified CMYK values.
XColor FromCmyk(double alpha, double cyan, double magenta, double yellow, double black)
alpha
Double
cyan
Double
magenta
Double
yellow
Double
black
Double
Creates an XColor structure from the specified gray value.
XColor FromGrayScale(double grayScale)
grayScale
Double
Creates an XColor from the specified pre-defined color.
XColor FromKnownColor(XKnownColor color)
color
XKnownColor
Not really implemented and not useful. See XColorResourceManager.
Creates an XColor from the specified name of a pre-defined color.
XColor FromName(string name)
name
String
Determines whether the specified object is a Color structure and is equivalent to this Color structure.
bool Equals(object obj)
obj
Object
Returns the hash code for this instance.
int GetHashCode()
Gets the hue-saturation-brightness (HSB) hue value, in degrees, for this color.
double GetHue()
Double
The hue, in degrees, of this color. The hue is measured in degrees, ranging from 0 through 360, in HSB color space.
Gets the hue-saturation-brightness (HSB) saturation value for this color.
double GetSaturation()
Double
The saturation of this color. The saturation ranges from 0 through 1, where 0 is grayscale and 1 is the most saturated.
Gets the hue-saturation-brightness (HSB) brightness value for this color.
double GetBrightness()
Double
The brightness of this color. The brightness ranges from 0 through 1, where 0 represents black and 1 represents white.