transparent: Add transparency to a color

Description Usage Arguments Value Author(s) See Also Examples

View source: R/transparent.R

Description

Add transparency to a color

Usage

1
transparent(col, alpha = 0.5)

Arguments

col

is a color or vector/array of colors, specified as text (e.g. 'purple') or 7/9-character (e.g. '#A020F0')

alpha

transparency value between 0 and 1 or a vector/array thereof

Value

Returns a 9-character color or vector/array of 9-character colors.

Author(s)

Danail Obreschkow

See Also

lightness

Examples

1
2
3
4
5
# Add different transparencies of the same color
plot(runif(50),runif(50),pch=20,cex=10,col=transparent('purple',runif(50)))

# Add the same transparency to different colors
plot(runif(50),runif(50),pch=20,cex=10,col=transparent(rainbow(50)))

graphx documentation built on Feb. 3, 2022, 5:07 p.m.

Related to transparent in graphx...