Class
RgbColor

Device RGB color with ARGB components for drawing content; use to specify red/green/blue values with optional transparency.

Definition

Namespace:Telerik.Windows.Documents.Fixed.Model.ColorSpaces

Assembly:Telerik.Windows.Documents.Fixed.dll

Syntax:

cs-api-definition
public class RgbColor : SimpleColor, IEquatable<ColorBase>

Inheritance: objectColorBaseSimpleColorRgbColor

Implements: IEquatable<ColorBase>

Inherited Members ColorBase.Equals(object)

Constructors

RgbColor()

Creates an RgbColor with default alpha (fully opaque).

Declaration

cs-api-definition
public RgbColor()

RgbColor(byte, byte, byte)

Creates an RgbColor from RGB components with default alpha (fully opaque).

Declaration

cs-api-definition
public RgbColor(byte r, byte g, byte b)

Parameters

r

byte

The red component value (0-255).

g

byte

The green component value (0-255).

b

byte

The blue component value (0-255).

RgbColor(byte, byte, byte, byte)

Creates an RgbColor from explicit ARGB components.

Declaration

cs-api-definition
public RgbColor(byte a, byte r, byte g, byte b)

Parameters

a

byte

The alpha (transparency) component value (0-255), where 0 is fully transparent and 255 is fully opaque.

r

byte

The red component value (0-255).

g

byte

The green component value (0-255).

b

byte

The blue component value (0-255).

Fields

A

Gets or sets the alpha (transparency) component, 0–255 (0 = transparent, 255 = opaque).

Declaration

cs-api-definition
public byte A

Field Value

byte

The alpha component value, where 0 represents fully transparent and 255 represents fully opaque.

B

Gets or sets the blue component, 0–255.

Declaration

cs-api-definition
public byte B

Field Value

byte

The blue component value.

G

Gets or sets the green component, 0–255.

Declaration

cs-api-definition
public byte G

Field Value

byte

The green component value.

R

Gets or sets the red component, 0–255.

Declaration

cs-api-definition
public byte R

Field Value

byte

The red component value.

Methods

Equals(ColorBase)

Determines whether the specified color is equal to the current RGB color.

Declaration

cs-api-definition
public override bool Equals(ColorBase other)

Parameters

other

ColorBase

The color to compare with the current color.

Returns

bool

True if the specified color is equal to the current RGB color; otherwise, false.

Overrides ColorBase.Equals(ColorBase)

GetHashCode()

Calculates a hash code for this RGB color instance based on its component values.

Declaration

cs-api-definition
public override int GetHashCode()

Returns

int

A hash code for the current RGB color.

Overrides ColorBase.GetHashCode()

ToString()

Returns a string representation of this RGB color showing its ARGB component values.

Declaration

cs-api-definition
public override string ToString()

Returns

string

A string representation of the RGB color in the format "<A=alpha R=red G=green B=blue>".

Overrides object.ToString()