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:

Wolfram Research (2025), LightDarkSwitched, Wolfram Language function, https://reference.wolfram.com/language/ref/LightDarkSwitched.html.

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_2024_lightdarkswitched, author="Wolfram Research", title="{LightDarkSwitched}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/LightDarkSwitched.html}", note=[Accessed: 15-January-2025 ]}

BibLaTeX

@online{reference.wolfram_2024_lightdarkswitched, organization={Wolfram Research}, title={LightDarkSwitched}, year={2025}, url={https://reference.wolfram.com/language/ref/LightDarkSwitched.html}, note=[Accessed: 15-January-2025 ]}