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
Name | Type | Description |
---|---|---|
string | string |
The string color (e.g., |
Type | Description |
---|---|
number |
Number in hexadecimal. |