(hsla: Number, Number, Number, Number) → colour

A special version of (hsl:), this macro allows you to supply not just the hue (h) angle in degrees, saturation (s) and lightness (l) percentages, but also the transparency (alpha, or a) percentage, which is a fractional value between 0 (fully transparent) and 1 (fully visible).

Anything drawn with a partially transparent colour will itself be partially transparent. You can then layer such elements to produce a few interesting visual effects.

Example usage:

(hsla: 120, 0.5, 0.8, 0.6) produces a 40% transparent faint green.


This macro takes the same range of number as the CSS rgba() function.

Giving alpha percentages higher than 1 or lower than 0 will cause an error.

See also:

(rgb:), (rgba:), (hsl:)