diff --git a/src/Validation/Validator/Color.php b/src/Validation/Validator/Color.php index 88df0c07..e0924bb8 100644 --- a/src/Validation/Validator/Color.php +++ b/src/Validation/Validator/Color.php @@ -45,8 +45,8 @@ public function validate(Validation $validation, $field): bool */ private function isValidColor(?string $color): bool { - // Hexadecimal color regex pattern - $pattern = '/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/'; + // Hexadecimal color regex pattern (supports 3, 4, 6, or 8 digits) + $pattern = '/^#([A-Fa-f0-9]{3,4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/'; return preg_match($pattern, $color) === 1; }