colortext: Colourise text for display in the terminal.

Description Usage Arguments Details Author(s) Examples

View source: R/colortext.R

Description

If R is not currently running in a system that supports terminal colours the text will be returned unchanged.

Usage

1
colortext(text, fg = "red", bg = NULL)

Arguments

text

character vector

fg

foreground colour, defaults to white

bg

background colour, defaults to transparent

Details

Allowed colours are: black, blue, brown, cyan, dark gray, green, light blue, light cyan, light gray, light green, light purple, light red, purple, red, white, yellow

Author(s)

testthat package

Examples

1
2
3
print(colortext("Red", "red"))
cat(colortext("Red", "red"), "\n")
cat(colortext("White on red", "white", "red"), "\n")

inti documentation built on Sept. 8, 2021, 9:08 a.m.