Skip to main content

ColorCode

The content of key shall represent a color in RGB or HSL format with optional alpha channel. Refer to the valid examples for syntax. Standard color pickers will provide a valid format.

Parameter table

paramunitrequireddescription
keyyesThe key of the value to be a color code (key).
allowAlphanoAllow the use of alpha channel (transparency).

How to setup

The rule makes sure that the provided key can be read as a color by most tools.

Examples

valuevalidallowAlphadescription
#fc4Reduced HEX starting with #
0xfc41Reduced HEX starting with 0x
#ffcc44Full HEX starting with #
0xffcc44ff1Full HEX with alpha starting with 0x
rgb(255, 204, 68)RGB function
rgba(255, 20, 68, 0.8)1RGB function with alpha channel
hsl(0.12, 1.00, 0.63)HSL function