check lightMode for light background color

checkLightMode(lightMode = NULL, ...)

Arguments

lightMode

logical or NULL, indicating whether the lightMode parameter has been defined in the function call.

Value

logical or length=1, indicating whether lightMode is defined

Details

Check the lightMode status through function parameter, options, or environment variable. If the function defines lightMode, it is used as-is. If lightMode is NULL, then options("jam.lightMode") is used if defined. Otherwise, it tries to detect whether the R session is running inside Rstudio using the environmental variable "RSTUDIO", and if so it assumes lightMode==TRUE.

To set a default lightMode, add options("jam.lightMode"=TRUE) to .Rprofile, or to the relevant R script.

Examples

checkLightMode(TRUE);
#> [1] TRUE
checkLightMode();
#> [1] FALSE