public function JQueryColorpickerServiceInterface::validateColor in Jquery Colorpicker 8
Validates a hecidecimal color string.
The following rules are validated:
- Length is six characters
- Value is hexidecimal.
Parameters
string $color: The color string to be validated.
Return value
bool|\Drupal\Core\StringTranslation\TranslatableMarkup FALSE if there are no errors, or a TranslateabeMarkup object containing the error message if there are any errors.
1 method overrides JQueryColorpickerServiceInterface::validateColor()
- JQueryColorpickerService::validateColor in src/
Service/ JQueryColorpickerService.php - Validates a hecidecimal color string.
File
- src/
Service/ JQueryColorpickerServiceInterface.php, line 38
Class
- JQueryColorpickerServiceInterface
- Interface for jQuery Colorpicker service.
Namespace
Drupal\jquery_colorpicker\ServiceCode
public function validateColor($color);