rcols_as_hex | R Documentation |
Convert R's built-in named colours to hex codes
rcols_as_hex(vec = NULL, distinct = FALSE)
vec |
(Character) A character vector of R's built-in named colours. If left |
distinct |
(Logical) Should only distinct colours be returned? Distinct colours do
not share the same (0:255)^3 RGB space, and do not have the same hex code. Defaults
to |
A named character vector of hex colours that were converted from R's built-in
names. The names are the original R colour names that were provided in vec
.
Desi Quintans (http://www.desiquintans.com)
rcols_as_hex(c("tomato", "steelblue"))
#> tomato steelblue
#> "#FF6347" "#4682B4"
rcols_as_hex()
#> white aliceblue antiquewhite ... for all colours in colours()
#> "#FFFFFF" "#F0F8FF" "#FAEBD7" ... for all colours in colours()
rcols_as_hex(distinct = TRUE)
#> white aliceblue antiquewhite ... for all in colours(distinct = TRUE)
#> "#FFFFFF" "#F0F8FF" "#FAEBD7" ... for all in colours(distinct = TRUE)
rcols_as_hex(c("snow", "snow1"))
#> snow snow1
#> "#FFFAFA" "#FFFAFA"
rcols_as_hex(c("snow", "snow1"), distinct = TRUE)
#> snow
#> "#FFFAFA"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.