This is often useful within a glue::glue function for a graph title or subtitle.

color_text(color, text, weight = "bold")

Arguments

color

character, valid CSS color

text

character, text to color

weight

character, which CSS font-weight to apply: c("bold", "normal", "900"), etc.

Value

character, HTML-span-wrapped version of text styled according to color and weight

Examples

color_text("#190C65", "predicted")
#> <span style="color: #190C65; font-weight: bold;">predicted</span>