function parseToHSVA(str) {

    // Check if string is a color-name
    str = str.match(/^[a-zA-Z]+$/) ? standardizeColor(str) : str;

    // Regular expressions to match different types of color represention
    const regex = {
        cmyk: /^cmyk\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)/i,
        rgba: /^rgba?\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D*?(([\d.]+)(%?)|$)/i,
        hsla: /^hsla?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,
        hsva: /^hsva?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,
        hexa: /^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i
    };

    /**
     * Takes an Array of any type, convert strings which represents
     * a number to a number an anything else to undefined.
     * @param array
     * @return {*}
     */
    const numarize = array => array.map(v => /^(|\d+)\.\d+|\d+$/.test(v) ? Number(v) : undefined);

    let match;
    invalid: for (const type in regex) {

        // Check if current scheme passed
        if (!(match = regex[type].exec(str))) {
            continue;
        }

        // Try to convert
        switch (type) {
            case 'cmyk': {
                const [, c, m, y, k] = numarize(match);

                if (c > 100 || m > 100 || y > 100 || k > 100) {
                    break invalid;
                }

                return {values: cmykToHsv(c, m, y, k), type};
            }
            case 'rgba': {
                let [, r, , g, , b, , , a] = numarize(match);

                r = match[2] === '%' ? (r / 100) * 255 : r;
                g = match[4] === '%' ? (g / 100) * 255 : g;
                b = match[6] === '%' ? (b / 100) * 255 : b;
                a = match[9] === '%' ? (a / 100) : a;

                if (r > 255 || g > 255 || b > 255 || a < 0 || a > 1) {
                    break invalid;
                }

                return {values: [...rgbToHsv(r, g, b), a], a, type};
            }
            case 'hexa': {
                let [, hex] = match;

                if (hex.length === 4 || hex.length === 3) {
                    hex = hex.split('').map(v => v + v).join('');
                }

                const raw = hex.substring(0, 6);
                let a = hex.substring(6);

                // Convert 0 - 255 to 0 - 1 for opacity
                a = a ? (parseInt(a, 16) / 255) : undefined;

                return {values: [...hexToHsv(raw), a], a, type};
            }
            case 'hsla': {
                let [, h, s, l, , a] = numarize(match);
                a = match[6] === '%' ? (a / 100) : a;

                if (h > 360 || s > 100 || l > 100 || a < 0 || a > 1) {
                    break invalid;
                }

                return {values: [...hslToHsv(h, s, l), a], a, type};
            }
            case 'hsva': {
                let [, h, s, v, , a] = numarize(match);
                a = match[6] === '%' ? (a / 100) : a;

                if (h > 360 || s > 100 || v > 100 || a < 0 || a > 1) {
                    break invalid;
                }

                return {values: [h, s, v, a], a, type};
            }
        }
    }

    return {values: null, type: null};
}
Try's to parse a string which represents a color to a HSV array.
Current supported types are cmyk, rgba, hsla and hexadecimal.
@param str
@return {*}