ParserUtils

Internal utility methods for color string parsing.

Methods

between

static
public static function between(string $haystack, string $start, string $end): string

Extract content between two substrings.

Parameters
NameTypeDefault
$haystack string -
$start string -
$end string -
public static function normalizeSpaceName(string $space): string

Normalize a color space name.

Parameters
NameTypeDefault
$space string -
public static function parseUnitOrPercent(string $token): float

Parse a numeric value or percentage into a float in range [0, 1].

Parameters
NameTypeDefault
$token string -
public static function splitBySlashOutsideParens(string $str): array

Split a string by slash only if it is outside of parentheses.

Parameters
NameTypeDefault
$str string -
public static function splitChannelExpressions(string $channelPart): array

Split channel expressions by whitespace, respecting parentheses.

Parameters
NameTypeDefault
$channelPart string -