public static function css2hsl($css) { if (strpos($css, "hsl(") !== false) { $hsl = str_replace(["%", "hsl(", ")", " "], '', $css); return $hsl; } else { if (strpos($css, "rgb(") !== false) { $rgb = str_replace(["rgb(", ")", " "], '', $css); return Convert::rgb2hsl($rgb); } else { if (strpos($css, "#") !== false) { $hex = str_replace(["#", " "], '', $css); return Convert::hex2hsl($hex); } else { if (strpos($css, "hsla(") !== false) { $hsla = str_replace(["%", "hsla(", ")"], '', $css); return Convert::hsla2hsl($hsla); } else { if (strpos($css, "rgba(") !== false) { $rgba = str_replace(["rgba(", ")"], '', $css); return Convert::rgba2hsl($rgba); } } } } } }