new Color(red, green, blue, alpha)
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
red | number | ||
green | number | ||
blue | number | ||
alpha | number | 1 |
- Source
Methods
asHex() → {string}
- Source
Returns:
e.g. "#ff0000"
- Type:
- string
asRgb() → {string}
- Source
Returns:
e.g. "rgb(255, 0, 0)"
- Type:
- string
asRgba() → {string}
- Source
Returns:
e.g. "rgba(255, 0, 0, 1)"
- Type:
- string
equals(other) → {boolean}
Parameters:
| Name | Type | Description |
|---|---|---|
other | * |
- Source
Returns:
- Type:
- boolean
setOpacity(alpha)
Sets opacity (alpha channel).
Parameters:
| Name | Type | Description |
|---|---|---|
alpha | number |
- Source
toString()
- Source
(static) fromString(value) → {Color}
Guesses the input color format and returns a Color instance.
Parameters:
| Name | Type | Description |
|---|---|---|
value | string |
- Source
Returns:
- Type:
- Color