View source: R/GeneTonic-extras.R
check_colors | R Documentation |
Check correct specification of colors
check_colors(x)
x |
A vector of strings specifying colors |
This is a vectorized version of grDevices::col2rgb()
A vector of logical values, one for each specified color - TRUE
if
the color is specified correctly
# simple case
mypal <- c("steelblue", "#FF1100")
check_colors(mypal)
mypal2 <- rev(
scales::alpha(
colorRampPalette(RColorBrewer::brewer.pal(name = "RdYlBu", 11))(50), 0.4
)
)
check_colors(mypal2)
# useful with long vectors to check at once if all cols are fine
all(check_colors(mypal2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.