LightDarkSwitched
LightDarkSwitched[lightcolor,darkcolor]
returns lightcolor if evaluated in a light-themed notebook; otherwise, it returns darkcolor.
LightDarkSwitched[lightcolor,Automatic]
generates an automatic dark color alternative for lightcolor.
LightDarkSwitched[Automatic,darkcolor]
generates an automatic light color alternative for darkcolor.
LightDarkSwitched[lightcolor]
is equivalent to LightDarkSwitched[lightcolor,Automatic].
Details
- LightDarkSwitched chooses between lightcolor and darkcolor based upon the value of the LightDark option in the evaluation notebook.
Examples
Basic Examples (2)
Return blue when in light mode or yellow when in dark mode:
LightDarkSwitched reacts to the LightDark option of a notebook:
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