% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/colToTransp.R
\name{colToTransp}
\alias{colToTransp}
\title{Adding transparency to a color}
\usage{
colToTransp(col, percent = 50)
}
\arguments{
\item{col}{color vector specified similar to the \code{col} argument in
\code{\link[grDevices]{col2rgb}}}

\item{percent}{numeric between 0 and 100 giving the level of transparency. 
Defaults to 50.}
}
\description{
Adding transparency to a color
}
\examples{
# Excepts hexadecimal strings, written colors, or numbers as input
colToTransp("#FF0000FF", 50)
colToTransp("black", 50)
colToTransp(2)

# Different shades of red
r80 <- colToTransp("red", 80)
r50 <- colToTransp("red", 50)
r20 <- colToTransp("red", 20)

barplot(rep(5, 4), col=c("red", r20, r50, r80), names.arg = 1:4)

# Vector as input
rain_transp <- colToTransp(rainbow(5), 50)

barplot(rep(5, 5), col = rain_transp, names.arg = 1:5)

}
