Skip to contents

Produces a <span style='color:#…'>text</span> tag for use with ggtext::element_markdown() or ggtext::element_textbox(). Color is resolved through hfv_color(), so invalid names error with the valid list.

Usage

hfv_span(text, color)

Arguments

text

Character string to wrap.

color

A valid HFV color name (e.g. "Shadow", "Sky").

Value

A character string containing the HTML span tag.

Examples

hfv_span("HousingForward Virginia", "Shadow")
#> [1] "<span style='color:#334a66'>HousingForward Virginia</span>"
hfv_span("note", "Sky")
#> [1] "<span style='color:#66cccc'>note</span>"