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
readonlystaticBLACK:Color
Defined in: utils/color.ts:12
readonlystaticBLUE:Color
Defined in: utils/color.ts:16
readonlystaticCYAN:Color
Defined in: utils/color.ts:19
readonlystaticGREEN:Color
Defined in: utils/color.ts:15
readonlystaticGREY:Color
Defined in: utils/color.ts:13
MAGENTA
Section titled “MAGENTA”
readonlystaticMAGENTA:Color
Defined in: utils/color.ts:18
readonlystaticRED:Color
Defined in: utils/color.ts:14
readonlystaticWHITE:Color
Defined in: utils/color.ts:11
YELLOW
Section titled “YELLOW”
readonlystaticYELLOW: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()”
staticlerp(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()”
staticlerpHex(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()”
staticrandom():Color
Defined in: utils/color.ts:50
Creates a random Color.
Returns
Section titled “Returns”Color
The new Color.
rgbToFullHexString()
Section titled “rgbToFullHexString()”
staticrgbToFullHexString(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()”
staticrgbToHex(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()”
staticrgbToHexString(pNumber):string
Defined in: utils/color.ts:66
Parameters
Section titled “Parameters”pNumber
Section titled “pNumber”number
Returns
Section titled “Returns”string