is an option for Style that specifies how to map fixed colors from light to dark mode.


LightDarkAutoColorRules
is an option for Style that specifies how to map fixed colors from light to dark mode.
Details

- When LightDarkAutoColorRules is applied to a construct containing colors, any explicit color col in the construct that satisfies one or more of the rules will be displayed as if LightDarkSwitched[col] had instead been used.
- Settings of LightDarkAutoColorRules have no effect for notebooks rendered in light mode.
- With the default setting LightDarkAutoColorRules<||>, colors are not remapped in dark mode unless an explicit mapping is provided using LightDarkSwitched.
- The following keys can be given:
-
"AllColors" if True, maps all colors "ListedColors" map all color expressions in the given list "NonPlotColors" whether to map all colors not generally used in visualizations - LightDarkAutoColorRulesAll is equivalent to setting "AllColors"True.
- LightDarkAutoColorRules has no effect on colors that are already wrapped in LightDarkSwitched.
- Inherited color rules can be explicitly disabled by setting LightDarkAutoColorRules{}.
Examples
open all close allBasic Examples (1)
An expression may use colors that were picked for light-mode viewing:
Such colors may display poorly in dark mode:
Wrap the expression with a LightDarkAutoColorRules setting to automatically change all colors:
Scope (1)
Start with a typical visualization example with many colors:
"AllColors" affects every color:
"NonPlotColors" affects all colors except for default colors produced by functions like Plot:
"ListedColors" only affects the colors provided in the list:
Properties & Relations (3)
LightDarkAutoColorRules changes how colors are displayed:
The underlying color expressions remain unchanged, however:
LightDarkAutoColorRules does not affect LightDarkSwitched colors:
Like any other option, LightDarkAutoColorRules can be used in BaseStyle and other style options:
Related Guides
-
▪
- Accessibility ▪
- Colors
History
Text
Wolfram Research (2025), LightDarkAutoColorRules, Wolfram Language function, https://reference.wolfram.com/language/ref/LightDarkAutoColorRules.html.
CMS
Wolfram Language. 2025. "LightDarkAutoColorRules." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/LightDarkAutoColorRules.html.
APA
Wolfram Language. (2025). LightDarkAutoColorRules. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LightDarkAutoColorRules.html
BibTeX
@misc{reference.wolfram_2025_lightdarkautocolorrules, author="Wolfram Research", title="{LightDarkAutoColorRules}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/LightDarkAutoColorRules.html}", note=[Accessed: 04-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_lightdarkautocolorrules, organization={Wolfram Research}, title={LightDarkAutoColorRules}, year={2025}, url={https://reference.wolfram.com/language/ref/LightDarkAutoColorRules.html}, note=[Accessed: 04-August-2025]}