User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

harlowe:hsla [2017/10/09 20:39] (current)
Line 1: Line 1:
 +**(hsla: // [[harlowe:​Number|Number]],​ Number, Number, Number//) -> //​[[harlowe:​Colour|colour]]//​**
 +A special version of [[harlowe:​hsl|(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 [[harlowe:​colour|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.
 +=== Details: ===
 +This macro takes the same range of [[harlowe:​number|number]] as the CSS ''​%%rgba()%%''​ function.
 +Giving alpha percentages higher than 1 or lower than 0 will cause an error.
 +=== See also: ===
 +[[harlowe:​rgb|(rgb:​)]],​ [[harlowe:​rgba|(rgba:​)]],​ [[harlowe:​hsl|(hsl:​)]]
harlowe/hsla.txt ยท Last modified: 2017/10/09 20:39 (external edit)