主题
ColorScheme
A set of more than 40 colors 基于 the Material spec that can be used to configure the color properties of most components. Read more about color schemes in here.
属性
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
primary | Optional[ColorValue] | None | The color displayed most frequently across your app's screens and components. |
primary_container | Optional[ColorValue] | None | A color used for elements needing less emphasis than primary. |
secondary | Optional[ColorValue] | None | An accent color used for less prominent components in the UI, such as filter Chips, while expanding the opportunity for color expression. |
secondary_container | Optional[ColorValue] | None | A color used for elements needing less emphasis than secondary. |
tertiary | Optional[ColorValue] | None | A color used as a contrasting accent that can balance primary and secondary colors or bring heightened attention to an element, such as an input field. |
tertiary_container | Optional[ColorValue] | None | A color used for elements needing less emphasis than tertiary. |
error | Optional[ColorValue] | None | The color to use for input validation errors, e.g. for error. |
error_container | Optional[ColorValue] | None | A color used for error elements needing less emphasis than error. |
surface | Optional[ColorValue] | None | The background color for widgets like Card. |
outline | Optional[ColorValue] | None | A utility color that creates boundaries and emphasis to improve usability. |
outline_variant | Optional[ColorValue] | None | A utility color that creates boundaries for decorative elements when a 3:1 contrast isn’t required, such as for dividers or decorative elements. |
shadow | Optional[ColorValue] | None | A color use to paint the drop shadows of elevated components. |
scrim | Optional[ColorValue] | None | A color use to paint the scrim around of modal components. |
inverse_surface | Optional[ColorValue] | None | A surface color used for displaying the reverse of what’s seen in the surrounding UI, for example in a SnackBar to bring attention to an alert. |
inverse_primary | Optional[ColorValue] | None | An accent color used for displaying a highlight color on inverse_surface backgrounds, like button text in a SnackBar. |
surface_tint | Optional[ColorValue] | None | A color used as an overlay on a surface color to indicate a component's elevation. |
primary_fixed | Optional[ColorValue] | None | A substitute for primary_container that's the same color for the dark and light themes. |
secondary_fixed | Optional[ColorValue] | None | A substitute for secondary_container that's the same color for the dark and light themes. |
tertiary_fixed | Optional[ColorValue] | None | A substitute for tertiary_container that's the same color for dark and light themes. |
primary_fixed_dim | Optional[ColorValue] | None | A color used for elements needing more emphasis than primary_fixed. |
secondary_fixed_dim | Optional[ColorValue] | None | A color used for elements needing more emphasis than secondary_fixed. |
surface_bright | Optional[ColorValue] | None | A color that's always the lightest in the dark or light theme. |
surface_container | Optional[ColorValue] | None | A recommended color role for a distinct area within the surface. |
surface_container_high | Optional[ColorValue] | None | A surface container color with a darker tone. |
surface_container_highest | Optional[ColorValue] | None | A surface container color with the darkest tone. It is used to create the most emphasis against the surface. |
surface_container_low | Optional[ColorValue] | None | A surface container color with a lighter tone that creates less emphasis than surface_container but more emphasis than surface_container_lowest. |
surface_container_lowest | Optional[ColorValue] | None | A surface container color with the lightest tone and the least emphasis relative to the surface. |
surface_dim | Optional[ColorValue] | None | A color that's always darkest in the dark or light theme. |
tertiary_fixed_dim | Optional[ColorValue] | None | A color used for elements needing more emphasis than tertiary_fixed. |
事件
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
on_primary | Optional[ColorValue] | None | A color that's clearly legible when drawn on primary. |
on_primary_container | Optional[ColorValue] | None | A color that's clearly legible when drawn on primary_container. |
on_secondary | Optional[ColorValue] | None | A color that's clearly legible when drawn on secondary. |
on_secondary_container | Optional[ColorValue] | None | A color that's clearly legible when drawn on secondary_container. |
on_tertiary | Optional[ColorValue] | None | A color that's clearly legible when drawn on tertiary. |
on_tertiary_container | Optional[ColorValue] | None | A color that's clearly legible when drawn on tertiary_container. |
on_error | Optional[ColorValue] | None | A color that's clearly legible when drawn on error. |
on_error_container | Optional[ColorValue] | None | A color that's clearly legible when drawn on error_container. |
on_surface | Optional[ColorValue] | None | A color that's clearly legible when drawn on surface. |
on_surface_variant | Optional[ColorValue] | None | A color that's clearly legible when drawn on surface_container_highest. |
on_inverse_surface | Optional[ColorValue] | None | A color that's clearly legible when drawn on inverse_surface. |
on_primary_fixed | Optional[ColorValue] | None | A color that is used for text and icons that exist on top of elements having primary_fixed color. |
on_secondary_fixed | Optional[ColorValue] | None | A color that is used for text and icons that exist on top of elements having secondary_fixed color. |
on_tertiary_fixed | Optional[ColorValue] | None | A color that is used for text and icons that exist on top of elements having tertiary_fixed color. |
on_primary_fixed_variant | Optional[ColorValue] | None | A color that provides a lower-emphasis option for text and icons than on_primary_fixed. |
on_secondary_fixed_variant | Optional[ColorValue] | None | A color that provides a lower-emphasis option for text and icons than on_secondary_fixed. |
on_tertiary_fixed_variant | Optional[ColorValue] | None | A color that provides a lower-emphasis option for text and icons than on_tertiary_fixed. |