Paint~ Color

A color object

Constructor

new Color(r, g, b)

Creates a new color object
Parameters:
NameTypeDescription
rnumberRed
gnumberBlue
bnumberGreen
Example
// Create a new color object with the RGB values of (255, 0, 0)
const color = new Color(255, 0, 0);

Members

(readonly) Black :Color

Black
Type:
  • Color

(readonly) Blue :Color

Blue
Type:
  • Color

(readonly) Green :Color

Green
Type:
  • Color

(readonly) None :Color

Do not paint
Type:
  • Color

(readonly) Red :Color

Red
Type:
  • Color

(readonly) White :Color

White
Type:
  • Color

b :number

Blue
Type:
  • number

(readonly) depth :number

Type:
  • number

g :number

Green
Type:
  • number

r :number

Red
Type:
  • number

Methods

toNumber() → {number}

Creates a new color from the given number
Returns:
Type: 
number

(static) fromNumber(num) → {Color}

Creates a color from a number
Parameters:
NameTypeDescription
numnumberNumber to convert
Returns:
Type: 
Color