I need convert a HSL or RGB string color to array. I get by parameter something like:
$str = "rgb(40, 50, 60)"; // or "hsl(40, 50%, 60%)"
convert to:
array(40, 50, 60); // or array(50, "50%", "60%")
I preferer a solution using regex, I dont want to use split function ;-(
NOTE: I have a solution for RGB, but I dont work with HSL:
$rgb_color = sscanf($str, "rgb(%d, %d, %d)");