@kismet.ts/core / Exports / KismetColor

Class: KismetColor

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new KismetColor(options?)

Parameters

NameType
options?Object
options.Anumber
options.Bnumber
options.Gnumber
options.Rnumber

Defined in

util/Color.ts:11open in new window

Properties

A

A: number

Defined in

util/Color.ts:9open in new window


B

B: number

Defined in

util/Color.ts:8open in new window


G

G: number

Defined in

util/Color.ts:7open in new window


MAX_COLOR_VALUE

MAX_COLOR_VALUE: number

Defined in

util/Color.ts:5open in new window


MIN_COLOR_VALUE

MIN_COLOR_VALUE: number

Defined in

util/Color.ts:4open in new window


R

R: number

Defined in

util/Color.ts:6open in new window

Methods

_validateNumber

Private _validateNumber(value): void

Parameters

NameType
valuenumber

Returns

void

Defined in

util/Color.ts:23open in new window


_validateOptions

Private _validateOptions(options): void

Parameters

NameType
optionsRecord<string, number>

Returns

void

Defined in

util/Color.ts:38open in new window


setColor

setColor(type, value): KismetColor

Parameters

NameType
type"R" | "G" | "B" | "A"
valuenumber

Returns

KismetColor

Defined in

util/Color.ts:62open in new window


setColors

setColors(colors): KismetColor

Parameters

NameType
colors[number, number, number, number]

Returns

KismetColor

Defined in

util/Color.ts:72open in new window


setHexColor

setHexColor(hexColor, alpha?): KismetColor

Parameters

NameTypeDefault value
hexColor`#${string}`undefined
alphanumber1

Returns

KismetColor

Defined in

util/Color.ts:84open in new window


toString

toString(): string

Returns

string

Defined in

util/Color.ts:90open in new window


hexToRgba

Static hexToRgba(hex, alpha?): [number, number, number, number]

Parameters

NameTypeDefault value
hex`#${string}`undefined
alphanumber1

Returns

[number, number, number, number]

Defined in

util/Color.ts:46open in new window