Color Class

An ARGB (alpha, red, green, blue) color.

Declaration

export class Color

constructor(colorValue)

Initializes a new instance of the Color class with specified settings.

Declaration

constructor(
    colorValue: number
)

Parameters

Name Type
colorValue number

Properties

A Property

Gets the alpha component value of this Color structure.

Declaration

readonly A: any

Property Value

Type Description
any

The alpha component value of this Color.

B Property

Gets the blue component value of this Color structure.

Declaration

readonly B: any

Property Value

Type Description
any

The blue component value of this Color.

css Property

Declaration

readonly css: string

Property Value

Type
string

G Property

Gets the green component value of this Color structure.

Declaration

readonly G: any

Property Value

Type Description
any

The green component value of this Color.

R Property

Gets the red component value of this Color structure.

Declaration

readonly R: any

Property Value

Type Description
any

The red component value of this Color.

Methods

blend(blendColor, opacity) Method

Declaration

blend(
    blendColor: any,
    opacity: any
): Color

Parameters

Name Type
blendColor any
opacity any

Returns

Type
Color

contrastColor(baseColor) Method

Declaration

static contrastColor(
    baseColor: Color
): Color

Parameters

Name Type
baseColor Color

Returns

Type
Color

equals(color1, color2) Method

Declaration

static equals(
    color1: Color,
    color2: Color
): boolean

Parameters

Name Type
color1 Color
color2 Color

Returns

Type
boolean

fromAppearance(appearanceType) Method

Declaration

static fromAppearance(
    appearanceType: string
): Color

Parameters

Name Type
appearanceType string

Returns

Type
Color

fromArgb(alpha, red, green, blue) Method

Declaration

static fromArgb(
    alpha: number,
    red: number,
    green: number,
    blue: number
): Color

Parameters

Name Type
alpha number
red number
green number
blue number

Returns

Type
Color

fromDxColor(dxColor) Method

Declaration

static fromDxColor(
    dxColor: any
): Color

Parameters

Name Type
dxColor any

Returns

Type
Color

fromJSON(jsonValue) Method

Declaration

static fromJSON(
    jsonValue: string
): Color

Parameters

Name Type
jsonValue string

Returns

Type
Color

fromRgbaString(rgbaColor) Method

Declaration

static fromRgbaString(
    rgbaColor: string
): Color

Parameters

Name Type
rgbaColor string

Returns

Type
Color

toHex Method

Declaration

toHex(): any

Returns

Type
any

toHex(colorValue) Method

Declaration

static toHex(
    colorValue: number
): string

Parameters

Name Type
colorValue number

Returns

Type
string

toJSON(color) Method

Declaration

static toJSON(
    color: Color
): number

Parameters

Name Type
color Color

Returns

Type
number

toNumber Method

Declaration

toNumber(): number

Returns

Type
number

toNumber(alpha, red, green, blue) Method

Declaration

static toNumber(
    alpha: number,
    red: number,
    green: number,
    blue: number
): number

Parameters

Name Type
alpha number
red number
green number
blue number

Returns

Type
number