Skip to content

Color

Defined in: utils/color.ts:10

new Color(r?, g?, b?): Color

Defined in: utils/color.ts:31

A Color reresented by a red, green and blue component.

number

The red component of the Color OR the full Color in HEX.

number

The green component of the Color.

number

The blue component of the Color.

Color

b: number

Defined in: utils/color.ts:23


g: number

Defined in: utils/color.ts:22


r: number

Defined in: utils/color.ts:21


readonly static BLACK: Color

Defined in: utils/color.ts:12


readonly static BLUE: Color

Defined in: utils/color.ts:16


readonly static CYAN: Color

Defined in: utils/color.ts:19


readonly static GREEN: Color

Defined in: utils/color.ts:15


readonly static GREY: Color

Defined in: utils/color.ts:13


readonly static MAGENTA: Color

Defined in: utils/color.ts:18


readonly static RED: Color

Defined in: utils/color.ts:14


readonly static WHITE: Color

Defined in: utils/color.ts:11


readonly static YELLOW: Color

Defined in: utils/color.ts:17

toHex(): number

Defined in: utils/color.ts:111

Convert this Color to hex.

number

The Color in hex format.


toHexString(): string

Defined in: utils/color.ts:115

string


toWebGL(): number[]

Defined in: utils/color.ts:123

Converts the Color components to the 0…1 range.

number[]

The new Color.


static lerp(pA, b, pPerc): Color

Defined in: utils/color.ts:90

Creates a new Color that is linearly interpolated from pA to b .

Color

The start Color.

Color

The end Color.

number

The percentage on the path from pA to b .

Color

The new Color.


static lerpHex(pA, b, pPerc): number

Defined in: utils/color.ts:101

Creates a new hex Color that is linearly interpolated from pA to b .

number

The first Color hex.

number

The second Color hex.

number

The percentage along the path from pA to b .

number

The new hex Color.


static random(): Color

Defined in: utils/color.ts:50

Creates a random Color.

Color

The new Color.


static rgbToFullHexString(r, g, b): string

Defined in: utils/color.ts:75

number

number

number

string


static rgbToHex(r, g, b): number

Defined in: utils/color.ts:61

Converts the rgb values passed in to hex.

number

The red component to convert.

number

The green component to convert.

number

The blue component to convert.

number

The hex value.


static rgbToHexString(pNumber): string

Defined in: utils/color.ts:66

number

string