Color.packPixel()

<static> packPixel(r, g, b, a) → {number}

Packs the r, g, b, a components into a single integer, for use with Int32Array.
If device is little endian then ABGR order is used. Otherwise RGBA order is used.

Parameters
Name Type Description
r number

The red color component, in the range 0 - 255.

g number

The green color component, in the range 0 - 255.

b number

The blue color component, in the range 0 - 255.

a number

The alpha color component, in the range 0 - 255.

Returns
number -

The packed color as uint32

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

Please login to continue.