new Color(r, g, b, a)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
r | number | Red value of the color. | |
g | number | Green value of the color. | |
b | number | Blue value of the color. | |
a | number | 1 | Alpha value of the color. |
- Source
Methods
(static) FromHex(hex) → {Color}
Generate Color from A Hexadecimal string.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
hex | number | 0x000000 | The hex value of the color. |
- Source
Returns:
The color.
- Type:
- Color
(static) FromHSL(h, s, l) → {Color}
Generate a color from HSL values.
Parameters:
Name | Type | Description |
---|---|---|
h | number | Hue value of the color. |
s | number | Saturation value of the color. |
l | number | Lightness value of the color. |
- Source
Returns:
The color.
- Type:
- Color
(static) FromRGB(r, g, b) → {Color}
Generate a color from RGB values.
Parameters:
Name | Type | Description |
---|---|---|
r | number | Red value of the color. |
g | number | Green value of the color. |
b | number | Blue value of the color. |
- Source
Returns:
The color.
- Type:
- Color
(static) FromRGBA(r, g, b, a) → {Color}
Generate a color from RGBA values.
Parameters:
Name | Type | Description |
---|---|---|
r | number | Red value of the color. |
g | number | Green value of the color. |
b | number | Blue value of the color. |
a | number | Blue value of the color. |
- Source
Returns:
The color.
- Type:
- Color
(static) Random() → {Color}
Generate a Random Color.
- Source
Returns:
The color.
- Type:
- Color
toString() → {string}
Convert the color into RGB javascript string. rgba(r,g,b,a)
or rgb(r,g,b)
.
- Source
Returns:
The color in RGB format.
- Type:
- string