check lightMode for light background color
Arguments
- lightMode
logicalor NULL, indicating whether the lightMode parameter has been defined in the function call. The defaultgetOption("jam.lightMode")is NULL unless assigned. When NULL it will use logic described in Details. When assigned, it is used as-is.- positron_default
logicaldefault TRUE, applied only when running inside Positron, and whenrstudioapi::getThemeInfo()is not available, which is default for Positron as of jamba-1.0.5. When running inside RStudio, it callsrstudioapi::getThemeInfo()to determine whether the theme is light or dark.- html_default
logicaldefault TRUE, applied when knitr is running with html output.- knitr_default
logicaldefault TRUE, applied when knitr is running.- other_default
logicaldefault FALSE, applied when running outside Positron or RStudio.- ...
Additional arguments are ignored.
Details
Check the lightMode status through options('jam.lightMode'), or by determining the running environment.
Logic is applied as follows:
When
lightModeis defined upfront aslogical, it is used.When
getOption('jam.lightMode')is defined, it is used.When
lightModeis NULL, it will apply a suitable default:If running inside knitr, it will apply
html_defaultfor html output, andknitr_defaultotherwise. Typically both produce white background, however this gives the option for custom background color.If running inside Positron or RStudio, it will attempt to run
rstudioapi::getThemeInfo()and use the resulting 'theme$dark', otherwise it appliespositron_default.All other cases use
other_default, default is FALSE to apply to linux remote shell session with dark background.
To set a persistent default lightMode, add this line to .Rprofile:
options("jam.lightMode"=TRUE)
See also
Other jam practical functions:
breakDensity(),
call_fn_ellipsis(),
check_pkg_installed(),
colNum2excelName(),
color_dither(),
exp2signed(),
getAxisLabel(),
isFALSEV(),
isTRUEV(),
jargs(),
kable_coloring(),
lldf(),
log2signed(),
middle(),
minorLogTicks(),
newestFile(),
printDebug(),
reload_qmd_cache(),
reload_rmarkdown_cache(),
renameColumn(),
rmInfinite(),
rmNA(),
rmNAs(),
rmNULL(),
setPrompt()