PIXI.utils.string2hex

string2hex(string: string) → {number}

Converts a string to a hexadecimal color number. It can handle: hex strings starting with #: "#ffffff" hex strings starting with 0x: "0xffffff" hex strings without prefix: "ffffff" css colors: "black"


 PIXI.utils.string2hex("#ffffff"); // returns 0xffffff
Parameters:
Name Type Description
string string

The string color (e.g., "#ffffff")

Returns:
Type Description
number

Number in hexadecimal.

Powered by webdoc!