Skip to main content

Color

Colors are defined either as keywords, hex values, rgb values or with an operator.

RGB values

Provide three values between 0 and 255, alpha is assumed to be 255.

style color {
BackgroundColor = rgb(128, 255, 255);
}

RGBA values

Provide four values between 0 and 255

style color {
BackgroundColor = rgba(128, 255, 255, 32);
}

Hex values

If 8 values are provided the color is derived from decoding the hex pairs into r, g, b, and a components.

If only 6 values are provided, the alpha is assumed to be equal to ff or 255

style color {
BackgroundColor = #ff0000ff;
BackgroundTint = #aabb99;
}

Color keywords

The list of accepted color keywords is here

style color {
BackgroundColor = red;
BackgroundTint = cornflowerblue;
}

Color operators

  • opacity(color, Range01) replaces the alpha component of the input color with the range argument
style color {
BackgroundColor = opacity(red, 50%);
BackgroundTint = opacity(#aabbcc, 0.1);
}