This will set the envvar R_CLI_NUM_COLORS
to n_colors
within the scope of
.local_envir
. To avoid sideeffects through overriding
crayon::has_color()
, this function only works on_github()
.
enable_github_colors(
n_colors = as.integer(256^3),
.local_envir = parent.frame(),
quiet = FALSE
)
disable_github_colors(.local_envir = parent.frame(), quiet = FALSE)
An integer giving the number of colors. Default 24bit.
[environment]
The environment to use for scoping.
Should messages be printed?
Invisibly returns TRUE
if enabling/disabling was successful,
FALSE
otherwise.
Sys.setenv(GITHUB_ACTIONS = "true")
enable_github_colors()
#> Error in enable_github_colors(): could not find function "enable_github_colors"
Sys.setenv(GITHUB_ACTIONS = "false")
enable_github_colors()
#> Error in enable_github_colors(): could not find function "enable_github_colors"