convColorToTransp: Assign new transparency to given colors

View source: R/convColorToTransp.R

convColorToTranspR Documentation

Assign new transparency to given colors

Description

This function alows (re-)defining a new transparency. A color encoding vector will be transformed to the same color(s) but with new transparency (alpha).

Usage

convColorToTransp(color, alph = 1)

Arguments

color

(character) color input

alph

(numeric) transparency value (1 for no transparency, 0 for complete opaqueness), values <1 will be treated as percent-values

Value

character vector (of same length as input) with color encoding for new transparency

See Also

rgb, par

Examples

col0 <- c("#998FCC","#5AC3BA","#CBD34E","#FF7D73")
col1 <- convColorToTransp(col0,alph=0.7)
layout(1:2)
pie(rep(1,length(col0)),col=col0)
pie(rep(1,length(col1)),col=col1,main="new transparency")

wrMisc documentation built on Jan. 7, 2023, 1:27 a.m.