Skip to content

hex_color ​

Checks that the value is a hex color: # and 3, 4, 6 or 8 hex digits, for example #f80 or #FF8800.

Error codes: WRONG_HEX_COLOR, FORMAT_ERROR

Live example · edit rules or inputOpen in playground
rules
input
Invaliderrors
{
  "color": "WRONG_HEX_COLOR"
}

Hex digits are case-insensitive, and the case of the input is kept in the output.