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 vha_color(), so invalid names error with the valid list.

Usage

vha_span(text, color)

Arguments

text

Character string to wrap.

color

A valid VHA color name (e.g. "Dark Turq", "Yellow").

Value

A character string containing the HTML span tag.

Examples

vha_span("Virginia Housing Alliance", "Dark Turq")
#> [1] "<span style='color:#0C4D4F'>Virginia Housing Alliance</span>"
vha_span("note", "Yellow")
#> [1] "<span style='color:#ECC51E'>note</span>"