Class: Color

Color(r, g, b, a)

A color made up of red, green, blue and alpha.

Constructor

new Color(r, g, b, a)

Parameters:
Name Type Description
r number

The red component.

g number

The green component.

b number

The blue component.

a number

The alpha component.

Source:

Members

(readonly) accent :Color

#ffd37f

Type:
Source:

(readonly) black :Color

#000000

Type:
Source:

(readonly) blue :Color

#0000ff

Type:
Source:

(readonly) clear :Color

#00000000

Type:
Source:

(readonly) coral :Color

#ff7f50

Type:
Source:

(readonly) gray :Color

#7f7f7f

Type:
Source:

(readonly) green :Color

#00ff00

Type:
Source:

(readonly) heal :Color

#84f490

Type:
Source:

(readonly) hit :Color

#ff584c

Type:
Source:

(readonly) magenta :Color

#ff00ff

Type:
Source:

(readonly) orange :Color

#ffa500

Type:
Source:

(readonly) pink :Color

#ff69b4

Type:
Source:

(readonly) purple :Color

#a020f0

Type:
Source:

(readonly) red :Color

#ff0000

Type:
Source:

(readonly) royal :Color

#4169e1

Type:
Source:

(readonly) shadow :Color

#00000066

Type:
Source:

(readonly) ui :Color

#bfecf3

Type:
Source:

(readonly) uiDark :Color

#57639a

Type:
Source:

(readonly) white :Color

#ffffff

Type:
Source:

(readonly) yellow :Color

#ffff00

Type:
Source:

Methods

(static) mix(col1, col2, amount, modeopt) → {Color}

Mixes two colors together according to its mode.

  • mix: Interpolate between the colors.
  • add: Add the two colors.
  • sub: Subtract col2 from col1.
  • mul: Multiply the two colors.
  • div: Divide col1 by col2.
  • and: Bitwise AND.
  • or: Bitwise OR.
  • xor: Bitwise XOR.
  • not: Bitwise NOT on col1.
Parameters:
Name Type Attributes Default Description
col1 Color

The first color.

col2 Color

The second color.

amount number

The amount of the second color.

mode string <optional>
"mix"

The mixing mode.

Source:
Returns:

The mixed color.

Type
Color

(static) parse(str) → {Color}

Parses a color from a string.

Parameters:
Name Type Description
str string

The string

Source:
Returns:

The parsed color

Type
Color