Color
Defined in: utils/color.ts:10
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Color(
r?
,g?
,b?
):Color
Defined in: utils/color.ts:31
A Color reresented by a red, green and blue component.
Parameters
Section titled “Parameters”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.
Returns
Section titled “Returns”Color
Properties
Section titled “Properties”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
MAGENTA
Section titled “MAGENTA”
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
YELLOW
Section titled “YELLOW”
readonly
static
YELLOW:Color
Defined in: utils/color.ts:17
Methods
Section titled “Methods”toHex()
Section titled “toHex()”toHex():
number
Defined in: utils/color.ts:111
Convert this Color to hex.
Returns
Section titled “Returns”number
The Color in hex format.
toHexString()
Section titled “toHexString()”toHexString():
string
Defined in: utils/color.ts:115
Returns
Section titled “Returns”string
toWebGL()
Section titled “toWebGL()”toWebGL():
number
[]
Defined in: utils/color.ts:123
Converts the Color components to the 0…1 range.
Returns
Section titled “Returns”number
[]
The new Color.
lerp()
Section titled “lerp()”
static
lerp(pA
,b
,pPerc
):Color
Defined in: utils/color.ts:90
Creates a new Color that is linearly interpolated from pA to b .
Parameters
Section titled “Parameters”Color
The start Color.
Color
The end Color.
number
The percentage on the path from pA to b .
Returns
Section titled “Returns”Color
The new Color.
lerpHex()
Section titled “lerpHex()”
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 .
Parameters
Section titled “Parameters”number
The first Color hex.
number
The second Color hex.
number
The percentage along the path from pA to b .
Returns
Section titled “Returns”number
The new hex Color.
random()
Section titled “random()”
static
random():Color
Defined in: utils/color.ts:50
Creates a random Color.
Returns
Section titled “Returns”Color
The new Color.
rgbToFullHexString()
Section titled “rgbToFullHexString()”
static
rgbToFullHexString(r
,g
,b
):string
Defined in: utils/color.ts:75
Parameters
Section titled “Parameters”number
number
number
Returns
Section titled “Returns”string
rgbToHex()
Section titled “rgbToHex()”
static
rgbToHex(r
,g
,b
):number
Defined in: utils/color.ts:61
Converts the rgb values passed in to hex.
Parameters
Section titled “Parameters”number
The red component to convert.
number
The green component to convert.
number
The blue component to convert.
Returns
Section titled “Returns”number
The hex value.
rgbToHexString()
Section titled “rgbToHexString()”
static
rgbToHexString(pNumber
):string
Defined in: utils/color.ts:66
Parameters
Section titled “Parameters”pNumber
Section titled “pNumber”number
Returns
Section titled “Returns”string