LightDarkSwitched[lightcolor,darkcolor]
displays lightcolor if used in a light mode notebook; otherwise, it displays darkcolor.
LightDarkSwitched[lightcolor,Automatic]
uses an automatic dark color alternative for lightcolor.
LightDarkSwitched[Automatic,darkcolor]
uses an automatic light color alternative for darkcolor.
LightDarkSwitched[lightcolor]
is equivalent to LightDarkSwitched[lightcolor,Automatic].


LightDarkSwitched
LightDarkSwitched[lightcolor,darkcolor]
displays lightcolor if used in a light mode notebook; otherwise, it displays darkcolor.
LightDarkSwitched[lightcolor,Automatic]
uses an automatic dark color alternative for lightcolor.
LightDarkSwitched[Automatic,darkcolor]
uses an automatic light color alternative for darkcolor.
LightDarkSwitched[lightcolor]
is equivalent to LightDarkSwitched[lightcolor,Automatic].
Details

- When applied as part of a style setting, the notebook front end resolves the value to a color as part of the process of rendering.
- LightDarkSwitched chooses between lightcolor and darkcolor based upon the value of the LightDark option in the evaluation notebook.
- LightDarkSwitched[…] does not resolve colors at the time of evaluation. It returns a LightDarkSwitched expression to the notebook front end.
- ColorQ[LightDarkSwitched[…]] is False, and the result of LightDarkSwitched cannot be used in functions that do color computation such as Blend and ColorDistance.
Examples
open all close allBasic Examples (2)
Return blue when in light mode or yellow when in dark mode:
LightDarkSwitched reacts to the LightDark option of a notebook:
Scope (5)
Automatically determine a dark mode color from a given light mode color:
Automatically determine a light mode color from a given dark mode color:
Use LightDarkSwitched as an option value:
Use LightDarkSwitched with VertexColors:
Use LightDarkSwitched with Haloing:
Properties & Relations (2)
ColorQ does not recognize LightDarkSwitched as a color:
LightDarkSwitched overrides any LightDarkAutoColorRules settings:
Possible Issues (2)
Functions that compute with color such as Blend do not recognize LightDarkSwitched:

Light and dark colors cannot simultaneously be set to Automatic:
Related Guides
-
▪
- Accessibility ▪
- Colors
History
Text
Wolfram Research (2025), LightDarkSwitched, Wolfram Language function, https://reference.wolfram.com/language/ref/LightDarkSwitched.html.
CMS
Wolfram Language. 2025. "LightDarkSwitched." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/LightDarkSwitched.html.
APA
Wolfram Language. (2025). LightDarkSwitched. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LightDarkSwitched.html
BibTeX
@misc{reference.wolfram_2025_lightdarkswitched, author="Wolfram Research", title="{LightDarkSwitched}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/LightDarkSwitched.html}", note=[Accessed: 15-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_lightdarkswitched, organization={Wolfram Research}, title={LightDarkSwitched}, year={2025}, url={https://reference.wolfram.com/language/ref/LightDarkSwitched.html}, note=[Accessed: 15-August-2025]}