forked from plotly/plotly.R
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoRGB.Rd
More file actions
38 lines (33 loc) · 753 Bytes
/
toRGB.Rd
File metadata and controls
38 lines (33 loc) · 753 Bytes
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
% 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{
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)
}
\seealso{
\code{\link[=showRGB]{showRGB()}}
}