Learn R Programming

prismatic (version 1.1.2)

clr_alpha: Sets alpha in color

Description

Sets alpha in color

Usage

clr_alpha(col, alpha = 0.5)

Value

a colors object

Arguments

col

a color object or vector of any of the three kinds of R color specifications, i.e., either a color name (as listed by colors()), a hexadecimal string of the form "#rrggbb" or "#rrggbbaa" (see rgb), or a positive integer i meaning palette()[i].

alpha

Numeric between 0 and 1. 0 will result in full transparency and 1 results in no transparency.

Examples

Run this code
plot(clr_alpha(rainbow(10), 0.5))

plot(clr_alpha(rainbow(10), 0.2))

plot(clr_alpha(rainbow(10), seq(0, 1, length.out = 10)))

Run the code above in your browser using DataLab