Phaser API Documentation

  Version: 
<static> HexStringToColor(hex)

Description:

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 description
hex string

The hex color value to convert, such as #0033ff or the short-hand format: #03f.

Returns:
Description:

A Color object populated by the values of the given string.

Since: 3.0.0