powered by
Make a style active. The text printed to the screen from now on will use this style.
# S3 method for crayon start(x, ...)finish(x, ...)# S3 method for crayon finish(x, ...)
finish(x, ...)
# S3 method for crayon finish(x, ...)
Style.
Ignored.
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.
## 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
Run the code above in your browser using DataLab