Struct PdfColor
- Namespace
- SimpleSign.HtmlToPdf.Parsing
- Assembly
- SimpleSign.HtmlToPdf.dll
RGB color in 0-1 range for direct use in PDF operators.
public readonly record struct PdfColor : IEquatable<PdfColor>
- Implements
- Inherited Members
Constructors
PdfColor(float, float, float)
RGB color in 0-1 range for direct use in PDF operators.
public PdfColor(float R, float G, float B)
Parameters
Fields
Black
Black color (0, 0, 0).
public static readonly PdfColor Black
Field Value
Gray
Gray color (#808080).
public static readonly PdfColor Gray
Field Value
LightGray
Light gray color (#ddd).
public static readonly PdfColor LightGray
Field Value
Transparent
Sentinel value representing a transparent/no color.
public static readonly PdfColor Transparent
Field Value
VeryLightGray
Very light gray color (#f5f5f5).
public static readonly PdfColor VeryLightGray
Field Value
White
White color (1, 1, 1).
public static readonly PdfColor White
Field Value
Properties
B
Blue component (0-1).
public float B { get; init; }
Property Value
G
Green component (0-1).
public float G { get; init; }
Property Value
IsTransparent
Gets a value indicating whether this color is transparent.
public bool IsTransparent { get; }
Property Value
R
Red component (0-1).
public float R { get; init; }
Property Value
Methods
Parse(string)
Parses a CSS color value into a PdfColor. Supports #RGB, #RRGGBB, rgb(r,g,b), and named CSS colors.
public static PdfColor Parse(string css)
Parameters
cssstringThe CSS color string.
Returns
- PdfColor
The parsed color.