User Tools

Site Tools


harlowe:rgba

Differences

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

Link to this comparison view

harlowe:rgba [2017/10/09 20:39]
harlowe:rgba [2017/10/09 20:39] (current)
Line 1: Line 1:
 +**(rgba: // [[harlowe:​Number|Number]],​ Number, Number, Number//) -> //​[[harlowe:​Colour|colour]]//​**
  
 +A special version of [[harlowe:​rgb|(rgb:​)]],​ this macro allows you to supply not just the red (r),
 +green (g) and blue (b) values, 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: ===
 +
 +''​%%(rgba:​ 178, 229, 178, 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:​hsl|(hsl:​)]],​ [[harlowe:​hsla|(hsla:​)]]
harlowe/rgba.txt ยท Last modified: 2017/10/09 20:39 (external edit)