as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
Ring
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持
跳转到主要内容
The Appearance module exposes information about the user’s appearance preferences, such as their preferred color scheme (light or dark).

Developer notes

The color scheme preference will map to the user’s Light Mode on Vega.

Example

You can use the Appearance module to determine if the user prefers a dark color scheme:
Although the color scheme is available immediately, this may change (e.g. scheduled color scheme change at sunrise or sunset). Any rendering logic or styles that depend on the user preferred color scheme should try to call this function on every render, rather than caching the value.

Reference

Methods

getColorScheme()

Indicates the current user preferred color scheme. The value may be updated later, either through direct user action (e.g. theme selection in device settings or application-level selected user interface style via setColorScheme) or on a schedule (e.g. light and dark themes that follow the day/night cycle). Supported color schemes:
  • light: The user prefers a light color theme.
  • dark: The user prefers a dark color theme.
  • null: The user has not indicated a preferred color theme.
See also: useColorScheme hook.
Note: getColorScheme() will always return light on Vega and when debugging with Chrome.

最后修改于 2026年10月26日