Color.unpackPixel()

<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 the
r, 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
object -

An object with the red, green and blue values set in the r, g and b properties.

Author:
  • Matt DesLauriers (@mattdesl)
Source code: utils/Color.js (Line 40)
doc_phaser
2017-02-14 10:42:14
Comments
Leave a Comment

Please login to continue.