The col_*
functions change the (foreground) color to the text.
These are the eight original ANSI colors. Note that in some terminals,
they might actually look differently, as terminals have their own
settings for how to show them. col_none()
is the default color, this
is useful in a substring of a colored string.
The col_br_*
functions are bright versions of the eight ANSI colors.
Note that on some terminal configurations and themes they might be the
same as the non-bright colors.
The bg_*
functions change the background color of the text.
These are the eight original ANSI background colors. These, too, can
vary in appearance, depending on terminal settings. bg_none()
the
the default background color, this is useful in a substring of a
background-colored string.
The bg_br_*
functions are the bright versions of the eight ANSI
background colors. Note that on some terminal configurations and themes
they might be the same as the non-bright colors.
The style_*
functions apply other styling to the text. The currently
supported styling functions are:
style_reset()
to remove any style, including color,
style_bold()
for boldface / strong text, although some terminals
show a bright, high intensity text instead,
style_dim()
(or style_blurred()
reduced intensity text.
style_italic()
(not widely supported).
style_underline()
,
style_inverse()
,
style_hidden()
,
style_strikethrough()
(not widely supported).
The style functions take any number of character vectors as arguments,
and they concatenate them using paste0()
before adding the style.
Styles can also be nested, and then inner style takes precedence, see
examples below.
Sometimes you want to revert back to the default text color, in the
middle of colored text, or you want to have a normal font in the middle
of italic text. You can use the style_no_*
functions for this. Every
style_*()
function has a style_no_*()
pair, which defends its
argument from taking on the style. See examples below.