combine_ansi_styles | R Documentation |
Combine two or more styles or style functions into a new style function that can be called on strings to style them.
combine_ansi_styles(...)
... |
The styles to combine. For character strings, the
|
It does not usually make sense to combine two foreground colors (or two background colors), because only the first one applied will be used.
It does make sense to combine different kind of styles, e.g. background color, foreground color, bold font.
The combined style function.
Other ANSI styling:
ansi-styles
,
make_ansi_style()
,
num_ansi_colors()
## Use style names
alert <- combine_ansi_styles("bold", "red4")
cat(alert("Warning!"), "\n")
## Or style functions
alert <- combine_ansi_styles(style_bold, col_red, bg_cyan)
cat(alert("Warning!"), "\n")
## Combine a composite style
alert <- combine_ansi_styles(
"bold",
combine_ansi_styles("red", bg_cyan))
cat(alert("Warning!"), "\n")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.