Class

Color

:

0-255 RGBA color.

group Math

r

: number

Red (0-255.

g

: number

Green (0-255).

b

: number

Blue (0-255).

static

fromArray

(arr: number[]) => Color
static

fromHex

(hex: string | number) => Color

Create color from hex string or literal.

Color.fromHex(0xfcef8d)
Color.fromHex("#5ba675")
Color.fromHex("d46eb3")

since v3000.0

static

fromHSL

(h: number, s: number, l: number) => Color
static

RED

: Color
static

GREEN

: Color
static

BLUE

: Color
static

YELLOW

: Color
static

MAGENTA

: Color
static

CYAN

: Color
static

WHITE

: Color
static

BLACK

: Color

clone

() => Color

lighten

(a: number) => Color

Lighten the color (adds RGB by n).

darken

(a: number) => Color

Darkens the color (subtracts RGB by n).

invert

() => Color

mult

(other: Color) => Color

lerp

(dest: Color, t: number) => Color

Linear interpolate to a destination color.

since v3000.0

toHSL

() => [number, number, number]

Convert color into HSL format.

since v3001.0

eq

(other: Color) => boolean

toHex

() => string

Return the hex string of color.

since v3000.0

toArray

() => Array<number>

Return the color converted to an array.

since v3001.0

kaplay logo

Layer

Miscalenous