function string2hex(string) {
    if (typeof string === 'string') {
        string = cssColorNames[string.toLowerCase()] || string;
        if (string[0] === '#') {
            string = string.slice(1);
        }
    }
    return parseInt(string, 16);
}
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"
@example
PIXI.utils.string2hex("#ffffff"); // returns 0xffffff
@memberof PIXI.utils
@function string2hex
@param {string} string - The string color (e.g., `"#ffffff"`)
@returns {number} Number in hexadecimal.