colorize: Add color to text.

Description Usage Arguments Value Examples

Description

Transforms the input text by adding colors to substrings specified in ....

Usage

1
2
3
colorize(text, ..., default = "default")

colorize_(text, repl, default = "default")

Arguments

text

character string to amend.

...

substrings with colors assigned as names.

default

default color.

repl

named vector or list; names are colors, values are substrings.

Value

text with ANSI control sequences around colorized substrings.

Examples

1
2
colorize("text with words", yellow = "with")
colorize("longer text with many words", yellow = "text", red = "many")

lbartnik/utilities documentation built on May 3, 2019, 11:52 p.m.