alpha2col: set R color alpha value

alpha2colR Documentation

set R color alpha value

Description

Define the alpha transparency per R color

Usage

alpha2col(x, alpha = 1, maxValue = 1, ...)

Arguments

x

R compatible color, either a color name, or hex value, or a mixture of the two. Any value compatible with col2rgb.

alpha

numeric alpha transparency to use per x color. alpha is recycled to length(x) as needed.

maxValue

numeric maximum value to return, useful when the downstream alpha range should be 255. By default maxValue=1 is returned.

See Also

Other jam color functions: applyCLrange(), col2alpha(), col2hcl(), col2hsl(), col2hsv(), color2gradient(), fixYellowHue(), fixYellow(), getColorRamp(), hcl2col(), hsl2col(), hsv2col(), isColor(), kable_coloring(), makeColorDarker(), make_html_styles(), make_styles(), rgb2col(), setCLranges(), setTextContrastColor(), showColors(), unalpha(), warpRamp()

Examples

par("mfrow"=c(2,2));
for (alpha in c(1, 0.8, 0.5, 0.2)) {
   nullPlot(plotAreaTitle=paste0("alpha=", alpha),
      doMargins=FALSE);
   usrBox(fill=alpha2col("yellow",
      alpha=alpha));
}


jmw86069/jamba documentation built on March 26, 2024, 5:26 a.m.