 |
PdfColor Class |
Represents a color used in PDF graphic elements. Construct one from red / green / blue byte
components, from a gray level, from CMYK components, or convert implicitly to and from
Color.
Inheritance HierarchySystemObject
SelectPdf.UniversalPdfColor
Namespace: SelectPdf.UniversalAssembly: SelectPdf.HtmlToPdf.Universal (in SelectPdf.HtmlToPdf.Universal.dll) Version: 26.4
SyntaxThe PdfColor type exposes the following members.
Constructors
Properties| | Name | Description |
|---|
 | Blue |
Gets or sets the blue component of the color (0-255).
|
 | Cyan |
Gets or sets the cyan component of this color (0 to 1).
|
  | Empty |
Gets a transparent (empty) color.
|
 | Gray |
Gets or sets the gray level of this color (0 to 1).
|
 | Green |
Gets or sets the green component of the color (0-255).
|
 | IsEmpty |
Gets a value indicating whether this color is empty (transparent).
|
 | Key |
Gets or sets the key (black) component of this color (0 to 1).
|
 | Magenta |
Gets or sets the magenta component of this color (0 to 1).
|
 | Red |
Gets or sets the red component of the color (0-255).
|
 | Yellow |
Gets or sets the yellow component of this color (0 to 1).
|
Top
Operators
Remarks
The color operators actually written to the document are chosen by the document's color
space (see
ColorSpace), which defaults to RGB. A color carries
all three representations, so the CMYK components set here are used verbatim when the
document color space is CMYK, and the gray level when it is gray scale.
ExamplePdfColor navy = new PdfColor(0, 32, 96);
byte red = navy.Red;
PdfColor midGray = new PdfColor(0.5f);
PdfColor cmyk = new PdfColor(0.1f, 0.9f, 0.2f, 0.05f);
PdfColor fromDrawing = SelectPdf.Universal.Drawing.Color.Red;
Dim navy As New PdfColor(0, 32, 96)
Dim red As Byte = navy.Red
Dim midGray As New PdfColor(0.5F)
Dim cmyk As New PdfColor(0.1F, 0.9F, 0.2F, 0.05F)
Dim fromDrawing As PdfColor = SelectPdf.Universal.Drawing.Color.Red
See Also