public static function parseRgbaString(string $string) : array
    {
        if (!preg_match(self::REGEX_RGBA, $string, $matches)) {
            throw InvalidArgumentException::format(
                    'Invalid rgba string passed to %s: expecting format "rgb(0-255, 0-255, 0-255, 0-1)", "%s" given',
                    __METHOD__, $string
            );
        }

        return [(int)$matches[1], (int)$matches[2], (int)$matches[3], (float)$matches[4]];
    }
public static function parseRgbaString(string $string) : array
    {
        if (!preg_match(self::REGEX_RGBA, $string, $matches)) {
            throw InvalidArgumentException::format(
                    'Invalid rgba string passed to %s: expecting format "rgb(0-255, 0-255, 0-255, 0-1)", "%s" given',
                    __METHOD__, $string
            );
        }

        return [(int)$matches[1], (int)$matches[2], (int)$matches[3], (float)$matches[4]];
    }
public static function parseRgbaString ( string $ string ) : array { if ( ! preg_match ( self :: REGEX_RGBA , $ string , $ matches ) ) { throw InvalidArgumentException :: format ( 'Invalid rgba string passed to %s: expecting format "rgb(0-255, 0-255, 0-255, 0-1)", "%s" given' , __METHOD__ , $ string ) ; } return [ ( int ) $ matches [ 1 ] , ( int ) $ matches [ 2 ] , ( int ) $ matches [ 3 ] , ( float ) $ matches [ 4 ] ] ; }
Parses the supplied rgba string into an array of channels.

@param string $string eg: "rgba(100, 100, 100, 0.5)"

@return int[] eg: [100, 100, 100, 0.5]
@throws InvalidArgumentException
Parses the supplied rgba string into an array of channels .