addAlpha: add transparency to a color

Description Usage Arguments Value Examples

Description

from http://www.magesblog.com/2013/04/how-to-change-alpha-value-of-colours-in.html

Usage

1
addAlpha(col, alpha = 1)

Arguments

col

the color, or vector of colors, you want to add transparency to

alpha

the amount of transparency. ranges from 0 to 1 inclusive, where 0 is completely transparent and 1 is completely opaque

Value

color value with transparency added

Examples

1
2
3
4
5
6
"red" %>% addAlpha(0.5)
viridis(5) %>% addAlpha(0.7)
compare:
x <- list(rnorm(50,5),rnorm(50,5),rnorm(50,5),rnorm(50,5),rnorm(50,5),rnorm(50,5),rnorm(50,5),rnorm(50,5),rnorm(50,5))
simple(x, point_col = plasma(10))
simple(x, point_col = plasma(10) %>% addAlpha(0.5))

lukereding/redingPlot documentation built on May 21, 2019, 8:58 a.m.