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. |
Members
(readonly) accent :Color
#ffd37f
Type:
(readonly) black :Color
#000000
Type:
(readonly) blue :Color
#0000ff
Type:
(readonly) clear :Color
#00000000
Type:
(readonly) coral :Color
#ff7f50
Type:
(readonly) gray :Color
#7f7f7f
Type:
(readonly) green :Color
#00ff00
Type:
(readonly) heal :Color
#84f490
Type:
(readonly) hit :Color
#ff584c
Type:
(readonly) magenta :Color
#ff00ff
Type:
(readonly) orange :Color
#ffa500
Type:
(readonly) pink :Color
#ff69b4
Type:
(readonly) purple :Color
#a020f0
Type:
(readonly) red :Color
#ff0000
Type:
(readonly) royal :Color
#4169e1
Type:
(readonly) shadow :Color
#00000066
Type:
(readonly) ui :Color
#bfecf3
Type:
(readonly) uiDark :Color
#57639a
Type:
(readonly) white :Color
#ffffff
Type:
(readonly) yellow :Color
#ffff00
Type:
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
col2fromcol1. - mul: Multiply the two colors.
- div: Divide
col1bycol2. - 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. |
Returns:
The mixed color.
- Type
- Color
(static) parse(str) → {Color}
Parses a color from a string.
Parameters:
| Name | Type | Description |
|---|---|---|
str |
string | The string |
Returns:
The parsed color
- Type
- Color