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 35 36 37 38 39
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/toRGB.R
\name{toRGB}
\alias{toRGB}
\title{Convert R colours to RGBA hexadecimal colour values}
\usage{
toRGB(x, alpha = 1)
}
\arguments{
\item{x}{see the \code{col} argument in \code{col2rgb} for valid specifications}
\item{alpha}{alpha channel on 0-1 scale}
}
\value{
hexadecimal colour value (if is.na(x), return "transparent" for compatibility with Plotly)
}
\description{
Convert R colours to RGBA hexadecimal colour values
}
\examples{
\dontshow{if (interactive() || !identical(.Platform$OS.type, "windows")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}
toRGB("steelblue")
# [1] "rgba(70,130,180,1)"
m <- list(
color = toRGB("red"),
line = list(
color = toRGB("black"),
width = 19
)
)
plot_ly(x = 1, y = 1, marker = m)
\dontshow{\}) # examplesIf}
}
\seealso{
\code{\link[=showRGB]{showRGB()}}
}
|