Table of Contents

Class DeviceRgb

Namespace
iText.Kernel.Colors
Assembly
itext.kernel.dll

Color space to specify colors according to RGB color model.

public class DeviceRgb : Color
Inheritance
DeviceRgb
Inherited Members

Constructors

DeviceRgb()

Creates DeviceRgb color with all colorants intensities initialised as zeroes.

public DeviceRgb()

DeviceRgb(Color)

Create DeviceRGB color from R, G, B values of System.Drawing.Color
Note, that alpha chanel is ignored, but opacity still can be achieved in some places by using 'setOpacity' method or 'TransparentColor' class.

public DeviceRgb(Color color)

Parameters

color Color

the color which RGB values are used

DeviceRgb(int, int, int)

Creates DeviceRgb color by intensities of red, green and blue colorants.

public DeviceRgb(int r, int g, int b)

Parameters

r int

the intensity of red colorant

g int

the intensity of green colorant

b int

the intensity of blue colorant

Remarks

Creates DeviceRgb color by intensities of red, green and blue colorants. The intensities are considered to be in [0, 255] gap, if not, the intensity will be considered as 255 (when colorant's value is bigger than 255) or 0 (when colorant's value is less than 0).

DeviceRgb(float, float, float)

Creates DeviceRgb color by intensities of red, green and blue colorants.

public DeviceRgb(float r, float g, float b)

Parameters

r float

the intensity of red colorant

g float

the intensity of green colorant

b float

the intensity of blue colorant

Remarks

Creates DeviceRgb color by intensities of red, green and blue colorants. The intensities are considered to be in [0, 1] interval, if not, the intensity will be considered as 1 (when colorant's value is bigger than 1) or 0 (when colorant's value is less than 0).

Fields

BLACK

Predefined black DeviceRgb color

public static readonly Color BLACK

Field Value

Color

BLUE

Predefined blue DeviceRgb color

public static readonly Color BLUE

Field Value

Color

GREEN

Predefined green DeviceRgb color

public static readonly Color GREEN

Field Value

Color

RED

Predefined red DeviceRgb color

public static readonly Color RED

Field Value

Color

WHITE

Predefined white DeviceRgb color

public static readonly Color WHITE

Field Value

Color

Methods

MakeDarker(DeviceRgb)

Returns DeviceRgb color which is darker than given one

public static DeviceRgb MakeDarker(DeviceRgb rgbColor)

Parameters

rgbColor DeviceRgb

the DeviceRgb color to be made darker

Returns

DeviceRgb

darker color

MakeLighter(DeviceRgb)

Returns DeviceRgb color which is lighter than given one

public static DeviceRgb MakeLighter(DeviceRgb rgbColor)

Parameters

rgbColor DeviceRgb

the DeviceRgb color to be made lighter

Returns

DeviceRgb

lighter color