Class: SystemColor

SystemColor

new SystemColor (json)

Name Type Description
json Object optional Json object describing the color
Properties:
Name Type Description
red number The red color between 0 and 255
green number The green color between 0 and 255
blue number The blue color between 0 and 255
alpha number The alpha value between 0 and 1
rgb string The rgb value used for ctx
color THREE.Color The three.js color

Methods

SystemColor.createColor (r, g, b, a)SystemColor static

Create a new color according to RGBA values
Name Type Description
r number The red color between 0 and 255
g number The green color between 0 and 255
b number The blue color between 0 and 255
a number The alpha value between 0 and 255
Returns:
Type Description
SystemColor

SystemColor.mix (x, y, aThe)THREE.Vector3 static

Used for mixing vectors according to alpha in getHex algorithm
Name Type Description
x THREE.Vector3 The x position
y THREE.Vector3 The y position
aThe number alpha value between 0 and 1
Returns:
Type Description
THREE.Vector3

initialize (r, g, b, a)

Initialize the color according to RGBA values
Name Type Default Description
r number The red color between 0 and 255
g number The green color between 0 and 255
b number The blue color between 0 and 255
a number 255 The alpha value between 0 and 255

read (json)

Read the JSON associated to the color
Name Type Description
json Object Json object describing the color

getHex (tone)string

Get the hex value of the color
Name Type Description
tone THREE.Vector4 The tone value
Returns:
Type Description
string