LightDarkSwitched

LightDarkSwitched[lightcolor,darkcolor]

如果在浅色主题的笔记本中运行此指令,返回 lightcolor;否则返回 darkcolor.

LightDarkSwitched[lightcolor,Automatic]

自动生成 lightcolor 的深色模式版本.

LightDarkSwitched[Automatic,darkcolor]

自动生成 darkcolor 的浅色模式版本.

LightDarkSwitched[lightcolor]

等价于 LightDarkSwitched[lightcolor,Automatic].

更多信息

范例

基本范例  (2)

浅色模式下返回蓝色,深色模式下返回黄色:

LightDarkSwitched reacts to the LightDark option of a notebook:

Wolfram Research (2025),LightDarkSwitched,Wolfram 语言函数,https://reference.wolfram.com/language/ref/LightDarkSwitched.html.

文本

Wolfram Research (2025),LightDarkSwitched,Wolfram 语言函数,https://reference.wolfram.com/language/ref/LightDarkSwitched.html.

CMS

Wolfram 语言. 2025. "LightDarkSwitched." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/LightDarkSwitched.html.

APA

Wolfram 语言. (2025). LightDarkSwitched. Wolfram 语言与系统参考资料中心. 追溯自 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-January-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-January-2025 ]}