fade: A function for creating transparent colours

View source: R/fade.R

fadeR Documentation

A function for creating transparent colours

Description

fade provides the name of a semi-transparent R colour after passing the name of a base colour or colours (e.g. "blue") and the degree of opacity desired.

Usage

fade(colors, alpha)

Arguments

colors

is a character string of colour names to which transparency should be added.

alpha

is a numeric vector specifying the desired opactity for each colour in colors. This should be an integer between 0 and 255

Value

The function returns a string containing the hexidecimal colour code and is then easily used as the colour to use in standard R plot commands.

Examples

newColour <- fade(c("blue", "green", "purple"), c(50, 100, 200))

dpagendam/friedsIndex documentation built on July 17, 2022, 5:41 a.m.