1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/colors.R
\name{alphacol}
\alias{alphacol}
\title{Colour utilities}
\usage{
alphacol(col, alpha = FALSE)
}
\arguments{
\item{col}{vector of any of the three kinds of \R color specifications,
i.e., either a color name (as listed by \code{\link[grDevices]{colors}()}), a
hexadecimal string of the form \code{"#rrggbb"} or
\code{"#rrggbbaa"} (see \code{\link[grDevices]{rgb}}), or a positive integer
\code{i} meaning \code{\link[grDevices]{palette}()[i]}.}
\item{alpha}{logical value indicating whether the alpha channel (opacity)
values should be returned.}
}
\value{
a character vector of color specifications.
}
\description{
\code{alphacol} adds an alpha value to a colour specification and convert to
a hexadecimal colour string.
}
\examples{
# Alphas
alphacol('red') # do nothing
alphacol('red', 10)
alphacol('#aabbcc', 5)
alphacol(4, 5)
}
|