ch_col_transparent: Adjusts colour codes to introduce transparency

View source: R/utils.R

ch_col_transparentR Documentation

Adjusts colour codes to introduce transparency

Description

ch_col_transparent is used to adjust colour codes to introduce transparency.

Usage

ch_col_transparent(colour, trans)

Arguments

colour

Vector of colours you wish to add transparency to.

trans

Integer(s) describing the degree of transparency, from ~200 (slightly transparent) to <10 (very transparent).

Value

res

returned updated colour code with transparency

See Also

See original code on post in Stack Overflow plot points transparent in R

Examples


# plot randomly distributed data
plot(rnorm(20),col='black')

# create a transparent blue colour for plotting
mycol <- ch_col_transparent('blue',100)

# plot more random points in transparent blue colour
points(rnorm(20),col=mycol)

# add transparency to multiple colours
ch_col_transparent( c('red','blue','green'), c(50,100,200))


CSHS-hydRology/CSHShydRology documentation built on Aug. 18, 2022, 4:44 p.m.