alp: Add transparency to colours

Description Usage Arguments Value Author(s) Examples

Description

The function adds transparency to a character of colours names or hexadecimal values.

Usage

1
alp(x, alpha)

Arguments

x

A character of colours. Either as names (e.g. "blue") or hexadecimal ("#00FF00").

alpha

A numeric vector of values with the alpha level. If alpha = 0 is completely transparent and alpha = 1 is opaque.

Value

A character of hexadecimal values with alpha value added.

Author(s)

Anders Ellern Bilgrau <anders.ellern.bilgrau (at) gmail.com>

Examples

1
2
x <- c("Blue", "#402000", NA, "Tomato", "#00FF0250")
alp(x, alpha = 0.5)

AEBilgrau/Bmisc documentation built on May 5, 2019, 11:28 a.m.