with_clr | R Documentation |
Create HTML span tag with text and color style
with_clr(text, color = "black", alpha = 1, ...)
text |
character, text that will be colored. |
color |
character, color applied to the text, defaults to black. |
alpha |
numeric, opacity in interval 0–1, where 1 is no transparency, i.e. full opacity |
... |
Arguments passed on to
|
an object of class shiny.tag
, coercible to character
html <- paste0(
with_clr("Red", "red"), ", ",
with_clr("green", "green"),
" and ",
with_clr("blue", "blue"),
" are the basic colors."
)
library(ggplot2)
library(ggtext)
ggplot() +
geom_richtext(aes(x = 1, y = 1, label = html), size = 8) +
theme_void()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.