Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

start.crayon

Switch on or off a style


Description

Make a style active. The text printed to the screen from now on will use this style.

Usage

## S3 method for class 'crayon'
start(x, ...)

finish(x, ...)

## S3 method for class 'crayon'
finish(x, ...)

Arguments

x

Style.

...

Ignored.

Details

This function is very rarely needed, e.g. for colored user input. For other reasons, just call the style as a function on the string.

Examples

## The input is red (if color is supported)
get_name <- function() {
  cat("Enter your name:", start(red))
  input <- readline()
  cat(finish(red))
  input
}
name <- get_name()
name

crayon

Colored Terminal Output

v1.4.1
MIT + file LICENSE
Authors
Gábor Csárdi [aut, cre], Brodie Gaslam [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.