Skip to content

Color

Defined in: utils/color.ts:7

Constructor utils/color.ts:10

new Color(input): Color

Parameters

ParameterType
inputany

Returns

Color

Methods

getAlpha() utils/color.ts:47

getAlpha(): number

Returns

number

getRgb() utils/color.ts:56

getRgb(): object

Returns

object

NameType
b
color.ts:56
number
g
color.ts:56
number
r
color.ts:56
number

isGrayscale() utils/color.ts:51

isGrayscale(): boolean

Returns

boolean

toPDFFill() utils/color.ts:73

toPDFFill(): string

Returns

string

toPDFFillValue() utils/color.ts:61

toPDFFillValue(): string

Returns

string

toPDFStroke() utils/color.ts:78

toPDFStroke(): string

Returns

string

toPDFStrokeValue() utils/color.ts:69

toPDFStrokeValue(): string

Returns

string

coerce() utils/color.ts:23

static coerce(color): Color

Parameters

ParameterType
colorany

Returns

Color

hex() utils/color.ts:38

static hex(hexStr): Color

Parameters

ParameterType
hexStrstring

Returns

Color

hsl() utils/color.ts:34

static hsl(h, s, l, a?): Color

Parameters

ParameterType
hnumber
snumber
lnumber
a?number

Returns

Color

oklab() utils/color.ts:42

static oklab(l, a, b, alpha?): Color

Parameters

ParameterType
lnumber
anumber
bnumber
alpha?number

Returns

Color

rgb() utils/color.ts:30

static rgb(r, g, b, a?): Color

Parameters

ParameterType
rnumber
gnumber
bnumber
a?number

Returns

Color

Released under the MIT License.