trans.colors(palette(), alpha=0.5)
# alpha can be vectorized
trans.colors(palette(), alpha=seq(0, 1, length=length(palette())))
# lengths need not match: shorter one is repeated as necessary
trans.colors(palette(), alpha=c(.1, .2))
trans.colors(colors()[1:20])
# single color, with various alphas
trans.colors("red", alpha=seq(0,1, length=5))
# assign names
trans.colors("red", alpha=seq(0,1, length=5), names=paste("red", 1:5, sep=""))
Run the code above in your browser using DataLab