Phaser API Documentation

  Version: 
<static> RGBToString(r, g, b, [a], [prefix])

Description:

Converts the color values into an HTML compatible color string, prefixed with either # or 0x.

Parameters:

name type arguments Default description
r number

The red color value. A number between 0 and 255.

g number

The green color value. A number between 0 and 255.

b number

The blue color value. A number between 0 and 255.

a number <optional> 255

The alpha value. A number between 0 and 255.

prefix string <optional> #

The prefix of the string. Either # or 0x.

Returns:
Description:

A string-based representation of the color values.

Type:
  • string
Since: 3.0.0