<static> unpackPixel(rgba, out, hsl, hsv) → {object}
Unpacks the r, g, b, a components into the specified color object, or a new
object, for use with Int32Array. If little endian, then ABGR order is used when
unpacking, otherwise, RGBA order is used. The resulting color object has ther, g, b, a
properties which are unrelated to endianness.
Note that the integer is assumed to be packed in the correct endianness. On little-endian
the format is 0xAABBGGRR and on big-endian the format is 0xRRGGBBAA. If you want a
endian-independent method, use fromRGBA(rgba) and toRGBA(r, g, b, a).
Parameters
Name | Type | Argument | Default | Description |
---|---|---|---|---|
rgba | number | The integer, packed in endian order by packPixel. | ||
out | object | <optional> | An object into which 3 properties will be created: r, g and b. If not provided a new object will be created. | |
hsl | boolean | <optional> | false | Also convert the rgb values into hsl? |
hsv | boolean | <optional> | false | Also convert the rgb values into hsv? |
Returns
An object with the red, green and blue values set in the r, g and b properties.
- Source code: utils/Color.js (Line 40)
Please login to continue.