Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Struct

PdfColor

Namespace OfficeIMO.Pdf
Assembly OfficeIMO.Pdf
Source revision c8404474f9f2 with working tree changes
Base ValueType
Modifiers sealed

Represents an RGB color where each component is expressed in the 0..1 range. Use with writer APIs to color text and vector shapes.

Inheritance

  • ValueType
  • PdfColor

Usage

Explore 182 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 68

Accepted by parameters 114

Constructors

public PdfColor(Double r, Double g, Double b) #

Initializes a new PdfColor.

Parameters

r System.Double requiredposition: 0
Red component (0..1).
g System.Double requiredposition: 1
Green component (0..1).
b System.Double requiredposition: 2
Blue component (0..1).

Methods

public static PdfColor FromOfficeColor(OfficeColor color) #
Returns: PdfColor

Creates a PDF RGB color from a shared OfficeIMO color. Alpha is ignored because opacity is handled separately from RGB color components.

Parameters

color OfficeIMO.Drawing.OfficeColor requiredposition: 0
public static PdfColor? FromOfficeColorOrNull(OfficeColor color) #
Returns: PdfColor?

Creates a PDF RGB color from a shared OfficeIMO color, returning null for fully transparent colors. Partially transparent colors retain their RGB components; apply opacity separately.

Parameters

color OfficeIMO.Drawing.OfficeColor requiredposition: 0
public static PdfColor FromRgb(Byte r, Byte g, Byte b) #
Returns: PdfColor

Creates a color from 0..255 byte RGB components.

Parameters

r System.Byte requiredposition: 0
g System.Byte requiredposition: 1
b System.Byte requiredposition: 2
public static PdfColor op_Implicit(OfficeColor color) #
Returns: PdfColor

Converts a shared OfficeIMO color to a PDF RGB color.

Parameters

color OfficeIMO.Drawing.OfficeColor requiredposition: 0
public OfficeColor ToOfficeColor(Byte alpha = 255) #
Returns: OfficeColor

Converts this color to the shared OfficeIMO color type.

Parameters

alpha System.Byte = 255 optionalposition: 0

Properties

public Double R { get; } #

Red component in the 0..1 range.

public Double G { get; } #

Green component in the 0..1 range.

public Double B { get; } #

Blue component in the 0..1 range.

public static PdfColor Black { get; } #

Pure black color (#000000).

public static PdfColor White { get; } #

Pure white color (#FFFFFF).

public static PdfColor LightGray { get; } #

Light gray color useful for fills and separators.

public static PdfColor Gray { get; } #

Mid gray color useful for text and borders.