Learn R Programming

pkgmaker (version 0.10.1)

alphacol: Colour utilities

Description

alphacol adds an alpha value to a colour specification and convert to a hexadecimal colour string.

Usage

alphacol(col, alpha = FALSE)

Arguments

col
vector of any of the three kind of Rcolors, i.e., either a color name (an element of colors()), a hexadecimal string of the form "#rrggbb" or "#rrggbbaa" (see
alpha
logical value indicating whether alpha channel (opacity) values should be returned.

Examples

Run this code
# Alphas
alphacol('red') # do nothing
alphacol('red', 10)
alphacol('#aabbcc', 5)
alphacol(4, 5)

Run the code above in your browser using DataLab