View source: R/plot_Utilities.R
alter.cols | R Documentation |
This function alters a vector of colors by modifying their transparency and/or mixing them with other colors.
alter.cols(x, alpha = NA, mix = NA, wgt = 0.5)
x |
A vector of colors specified either by name, hexadecimal code, or numbers (corresponding to colors defined in
|
alpha |
A numeric vector of alpha (transparency) values, with 0 corresponding to complete transparency and 1 to complete
opaqueness. Use NA to not modify transparency of colors in |
mix |
Another vector of colors to mix with the colors in |
wgt |
A numeric vector of weights to control how colors in |
a character vector of color values in hexadecimal code.
colors<-c('red','green','blue')
alter.cols(colors,alpha=c(0,1,0.5),mix=c('white','black','gray'),wgt=c(0,0.5,1))
#recycling behavior--recycled to maximum possible length
alter.cols(colors,alpha=0.2,mod.val=c('black','white'),wgt=c(0.1,0.2,0.8,0.9))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.