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

public static function normalizeSpaceName(string $space): string

Normalize a color space name.

Parameters
NameTypeDefault
$space string -

parse

static
public static function parse(string $input): ColorInterface

Parse a CSS color string into a ColorInterface instance.

Parameters
NameTypeDefault
$input string -
public static function parseColorFunction(string $s): ColorInterface

Parse a modern CSS color() function.

Parameters
NameTypeDefault
$s string -