Color.hexToColor()

<static> hexToColor(hex, out) → {object}

Converts a hex string into a Phaser Color object.

The hex string can supplied as '#0033ff' or the short-hand format of '#03f'; it can begin with an optional "#" or "0x", or be unprefixed.

An alpha channel is not supported.

Parameters
Name Type Argument Description
hex string

The color string in a hex format.

out object <optional>

An object into which 3 properties will be created or set: r, g and b. If not provided a new object will be created.

Returns
object -

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

Source code: utils/Color.js (Line 564)
doc_phaser
2017-02-14 10:42:03
Comments
Leave a Comment

Please login to continue.