Skip to content

Variable: hexColor

ts
const hexColor: Validator<string>;

Hex color validation / 十六进制颜色校验

Example

ts
hexColor('#fff') // => { isValid: true, message: undefined }
hexColor('red') // => { isValid: false, message: 'Invalid hex color / 十六进制颜色格式无效' }

Since

1.0.0

Released under the MIT License.