thlShade: Transparent or lighter versions of colors

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/thlShade.R

Description

For each color, create a lighter version either by introducing transparency or by just dimming down.

Usage

1
thlShade(col, alpha = 0.25, thin = 1)

Arguments

col

A color. Eighter a name such as "red" or preferrably a hex string such as "#FF0000"

alpha

Amount of transparency, 1=not transparent, 0=fully transparent. Recycled.

thin

Amount of lightening, 1=none, 0=white.

Details

Same thin is used for all components of RGB. Thus thin=0 always results in white. No value checking is done, so either thin or alpha outside 0,1 most likely results in error.

Value

A vector of rgba values suitable for using in graphics.

Note

Not all graphics devices support transparency. Parameter thin may be helpful in these situations.

Author(s)

Mikko J Virtanen, Petteri Mäntymaa, Tarja Palosaari, Salla Toikkanen

See Also

col2rgb, rgb

Examples

1
2
thlShade("red", alpha = .40)
thlShade(thlColors(type = "main"), alpha = .8, thin = .5)

THLfi/thlGraphs documentation built on Oct. 31, 2019, 12:09 a.m.