CssColor::EXTENDED_NAMED_COLORS => self::PATTERN_EXTENDED_NAMED_COLORS,
CssColor::SYSTEM_COLORS => self::PATTERN_SYSTEM_COLORS,
CssColor::KEYWORDS => self::PATTERN_KEYWORDS,
CssColor::RGB => self::PATTERN_RGB,
CssColor::RGBA => self::PATTERN_RGBA,
CssColor::HSL => self::PATTERN_HSL,
CssColor::HSLA => self::PATTERN_HSLA,
];
public function validate($value, Constraint
$constraint): void
{ if (!
$constraint instanceof CssColor
) { throw new UnexpectedTypeException($constraint, CssColor::
class);
} if (null ===
$value || '' ===
$value) { return;
} if (!\
is_string($value)) { throw new UnexpectedValueException($value, 'string'
);
}