public static function css2rgb($css) { if (strpos($css, "hsl(") !== false) { $hsl = str_replace(["%", "hsl(", ")"], '', $css); return Convert::hsl2rgb($hsl); } else { if (strpos($css, "rgb(") !== false) { $rgb = str_replace(["rgb(", ")"], '', $css); return $rgb; } else { if (strpos($css, "#") !== false) { $hex = str_replace("#", '', $css); return Convert::hex2rgb($hex); } else { if (strpos($css, "hsla(") !== false) { $hsla = str_replace(["%", "hsla(", ")"], '', $css); return Convert::hsla2rgb($hsla); } else { if (strpos($css, "rgba(") !== false) { $rgba = str_replace(["rgba(", ")"], '', $css); return Convert::rgba2rgb($rgba); } } } } } }