<static> createColor(r, g, b, a, h, s, l, v) → {object}
A utility function to create a lightweight 'color' object with the default components.
Any components that are not specified will default to zero.
This is useful when you want to use a shared color object for the getPixel and getPixelAt methods.
Parameters
Name | Type | Argument | Default | Description |
---|---|---|---|---|
r | number | <optional> | 0 | The red color component, in the range 0 - 255. |
g | number | <optional> | 0 | The green color component, in the range 0 - 255. |
b | number | <optional> | 0 | The blue color component, in the range 0 - 255. |
a | number | <optional> | 1 | The alpha color component, in the range 0 - 1. |
h | number | <optional> | 0 | The hue, in the range 0 - 1. |
s | number | <optional> | 0 | The saturation, in the range 0 - 1. |
l | number | <optional> | 0 | The lightness, in the range 0 - 1. |
v | number | <optional> | 0 | The value, in the range 0 - 1. |
Returns
object -
The resulting object with r, g, b, a properties and h, s, l and v.
- Source code: utils/Color.js (Line 438)
Please login to continue.