StaticisIs the given string a hex color string?
{string} - string to check for the hex color pattern
OptionalwithAlpha: boolean{boolean} - When true, the string will be checked for a #RRGGBBAA pattern.
When false, the given string will be checked for a #RRGGBB pattern.
true if the given string is a hex color string, false otherwise.Staticis
The StringValidator class provides static methods that can be used to verify that strings contain specified patterns.
Since
2.0.0