color_trans: Make opaque color transparent

View source: R/color_trans.r

color_transR Documentation

Make opaque color transparent

Description

This function allows you to modify opaque colors you are already using and make transparent versions. It's handy for adding confidence bands around mean values.

Usage

color_trans(hexcolor, alpha = 0.25)

Arguments

x

numeric vector

Author(s)

Nikolai Klibansky

Examples

## Not run: 
n <- 7
myalpha <- 0.25
mycol <- rainbow(n) # Opaque rainbow
mycol_tr <- rainbow(n,alpha=myalpha) # Transparent rainbow using alpha argument
mycol_tr2 <- color_trans(mycol,alpha=myalpha) # Transparent rainbow modifing mycol, using alpha argument from color_trans

par(cex=2,pch=16)
plot(1:n,rep(1,n),col=mycol,ylim=c(0,5))
points(1:n,rep(2,n),col=mycol_tr)
points(1:n,rep(3,n),col=mycol_tr2)

## End(Not run)


nikolaifish/bamExtras documentation built on July 21, 2023, 8:26 a.m.