makeTransparent: small utilities functions to deal with colors in R

Description Usage Arguments Value Author(s) See Also Examples

View source: R/utils.colors.R

Description

small utilities functions to deal with colors in R

Usage

1
makeTransparent(someColor, alpha = 100)

Arguments

someColor

any color code what R understands as character

alpha

numeric 0 ... 100 setting the transparancy, 0 no color, 100 full color

Value

return a color code which can be used in plot( , col = )

Author(s)

Maik Renner, mrenner [at] bgc-jena.mpg.de

Maik Renner, mrenner [at] bgc-jena.mpg.de

See Also

<https://stackoverflow.com/questions/8047668/transparent-equivalent-of-given-color>

Examples

1
2
3
4
5
6
7
8
9
makeTransparent("green")
makeTransparent("green", alpha = 0.1)
makeTransparent(makeTransparent("green", alpha = 0.1))
plot(0,0, pch = 16, col = "green", cex = 5)
points(0.1,0, pch = 15, col = makeTransparent("green", alpha = 50), cex = 5 )
set.seed(688)
xp = rnorm(7)
yp = rnorm(7)
polygon(xp, yp, border = 3, col = makeTransparent("green", alpha = 80) )

laubblatt/phaselag documentation built on Sept. 30, 2020, 11:21 a.m.