Table of Contents

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

R float

Red component (0-1).

G float

Green component (0-1).

B float

Blue component (0-1).

Fields

Black

Black color (0, 0, 0).

public static readonly PdfColor Black

Field Value

PdfColor

Gray

Gray color (#808080).

public static readonly PdfColor Gray

Field Value

PdfColor

LightGray

Light gray color (#ddd).

public static readonly PdfColor LightGray

Field Value

PdfColor

Transparent

Sentinel value representing a transparent/no color.

public static readonly PdfColor Transparent

Field Value

PdfColor

VeryLightGray

Very light gray color (#f5f5f5).

public static readonly PdfColor VeryLightGray

Field Value

PdfColor

White

White color (1, 1, 1).

public static readonly PdfColor White

Field Value

PdfColor

Properties

B

Blue component (0-1).

public float B { get; init; }

Property Value

float

G

Green component (0-1).

public float G { get; init; }

Property Value

float

IsTransparent

Gets a value indicating whether this color is transparent.

public bool IsTransparent { get; }

Property Value

bool

R

Red component (0-1).

public float R { get; init; }

Property Value

float

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

css string

The CSS color string.

Returns

PdfColor

The parsed color.