Skip to main content
A newer version of this page is available. .

Color Class

Declaration

export class Color

constructor(colorValue)

Declaration

constructor(
    colorValue: number
)

Parameters

Name Type
colorValue number

Properties

A Property

Declaration

readonly A: any

Property Value

Type
any

B Property

Declaration

readonly B: any

Property Value

Type
any

css Property

Declaration

readonly css: string

Property Value

Type
string

G Property

Declaration

readonly G: any

Property Value

Type
any

R Property

Declaration

readonly R: any

Property Value

Type
any

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

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