respect-validation/docs/rules/HexRgbColor.md
Henrique Moody 48405271c5
Replace placeholder "name" with "subject"
The `{{name}}` placeholder could represent different things depending on
the state of the Result, and referring to it as `{{name}}` seems
arbitrary. This commit changes it to `{{subject}}`, which is much more
generic and it describes well what that placeholder can mean.
2025-12-26 21:30:01 +01:00

1.2 KiB

HexRgbColor

  • HexRgbColor()

Validates weather the input is a hex RGB color or not.

v::hexRgbColor()->isValid('#FFFAAA'); // true
v::hexRgbColor()->isValid('#ff6600'); // true
v::hexRgbColor()->isValid('123123'); // true
v::hexRgbColor()->isValid('FCD'); // true

Templates

HexRgbColor::TEMPLATE_STANDARD

Mode Template
default {{subject}} must be a hex RGB color
inverted {{subject}} must not be a hex RGB color

Template placeholders

Placeholder Description
subject The validated input or the custom validator name (if specified).

Categorization

  • Strings

Changelog

Version Description
2.1.0 Allow hex RGB colors to be case-insensitive
2.0.0 Allow hex RGB colors with 3 integers
0.7.0 Created

See also: