CssColorParser
Core parser for CSS color functions and notations.
Supports modern CSS Color Level 4 features including functional notations,
relative color syntax, and wide-gamut color spaces.
Methods
normalizeSpaceName
static
public static function normalizeSpaceName(string $space): string
Normalize a color space name.
Parameters
| Name | Type | Default |
|---|---|---|
$space |
string | - |
parse
static
public static function parse(string $input): ColorInterface
Parse a CSS color string into a ColorInterface instance.
Parameters
| Name | Type | Default |
|---|---|---|
$input |
string | - |
parseColorFunction
static
public static function parseColorFunction(string $s): ColorInterface
Parse a modern CSS color() function.
Parameters
| Name | Type | Default |
|---|---|---|
$s |
string | - |