User Tools

Site Tools


Sidebar

Passage markup

basics

coding

extra

list

section

whitespace

Macros

basics

colour

data structure

date and time

game state

live

maths

number

revision

saving

showing and hiding

string

styling

url

deprecated

Types of data

Special keywords

Special passage tags

harlowe:rgba

(rgba: Number, Number, Number, Number) → colour

A special version of (rgb:), this macro allows you to supply not just the red ®, 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 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 number as the CSS rgba() function.

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

See also:

harlowe/rgba.txt · Last modified: 2017/10/10 00:39 (external edit)