Learn R Programming

sampSurf (version 0.7-6)

transparentColorBase: Set Transparancey in Base Graphics

Description

Setting transparency in base graphics is not as easy as in Lattice, so here's a little functon to help.

Usage

transparentColorBase(color, alphaTrans = alphaTrans)

Arguments

color

The color, or a vector of colors from colors().

alphaTrans

The alpha transparency value between [0,1] with 0 opaque and 1 fully transparent.

Value

The rgb value(s), which can be passed to any base graphics routine to get transparency.

Details

As above.

See Also

col2rgb, rgb

Examples

Run this code
# NOT RUN {
cols = transparentColorBase('red', alphaTrans=c(0.3,0.6,0.9))
symbols(c(1,1.5,2), c(1,1.5,2), circles=rep(1,3), bg=cols, xlim=c(0,4), ylim=c(0,4))
# }

Run the code above in your browser using DataLab