This function converts a named color to RGB and adds an alpha (relative transparency) value.

add_alpha(col, alpha)

Arguments

col

A character string specifying the named color

alpha

A numeric value specifying the transparency (0 for fully transparent)

Value

The output of a rgb call.

Examples

transparent_red <- add_alpha("red", 0.3)