Phaser API Documentation

  Version: 
<static> ComponentToHex(color)

Description:

Returns a string containing a hex representation of the given color component.

Parameters:

name type description
color number

The color channel to get the hex value for, must be a value between 0 and 255.

Returns:
Description:

A string of length 2 characters, i.e. 255 = ff, 100 = 64.

Type:
  • string
Since: 3.0.0