Color::validateHex

public static function Color::validateHex

public static Color::validateHex($hex)

Validates whether a hexadecimal color value is syntactically correct.

Parameters

$hex: The hexadecimal string to validate. May contain a leading '#'. May use the shorthand notation (e.g., '123' for '112233').

Return value

bool TRUE if $hex is valid or FALSE if it is not.

File

core/lib/Drupal/Component/Utility/Color.php, line 20

Class

Color
Performs color conversions.

Namespac