You are here

private function HexColorConstraintValidator::isHexColorString in Color API 8

Check if a string is a valid hexadecimal color string.

Parameters

mixed $value: The item to check as a hexadecimal color string.

Return value

bool TRUE if the given value is a valid hexadecimal color string. FALSE if it is not.

1 call to HexColorConstraintValidator::isHexColorString()
HexColorConstraintValidator::validate in src/Plugin/Validation/Constraint/HexColorConstraintValidator.php
Checks if the passed value is valid.

File

src/Plugin/Validation/Constraint/HexColorConstraintValidator.php, line 70

Class

HexColorConstraintValidator
Validates the hexadecimal_color constraint.

Namespace

Drupal\colorapi\Plugin\Validation\Constraint

Code

private function isHexColorString($value) {
  return $this->colorapiService
    ->isValidHexadecimalColorString($value);
}