Skip to content

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.

属性 ​

名称类型默认值说明
primaryOptional[ColorValue]NoneThe color displayed most frequently across your app's screens and components.
primary_containerOptional[ColorValue]NoneA color used for elements needing less emphasis than primary.
secondaryOptional[ColorValue]NoneAn accent color used for less prominent components in the UI, such as filter Chips, while expanding the opportunity for color expression.
secondary_containerOptional[ColorValue]NoneA color used for elements needing less emphasis than secondary.
tertiaryOptional[ColorValue]NoneA 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_containerOptional[ColorValue]NoneA color used for elements needing less emphasis than tertiary.
errorOptional[ColorValue]NoneThe color to use for input validation errors, e.g. for error.
error_containerOptional[ColorValue]NoneA color used for error elements needing less emphasis than error.
surfaceOptional[ColorValue]NoneThe background color for widgets like Card.
outlineOptional[ColorValue]NoneA utility color that creates boundaries and emphasis to improve usability.
outline_variantOptional[ColorValue]NoneA utility color that creates boundaries for decorative elements when a 3:1 contrast isn’t required, such as for dividers or decorative elements.
shadowOptional[ColorValue]NoneA color use to paint the drop shadows of elevated components.
scrimOptional[ColorValue]NoneA color use to paint the scrim around of modal components.
inverse_surfaceOptional[ColorValue]NoneA 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_primaryOptional[ColorValue]NoneAn accent color used for displaying a highlight color on inverse_surface backgrounds, like button text in a SnackBar.
surface_tintOptional[ColorValue]NoneA color used as an overlay on a surface color to indicate a component's elevation.
primary_fixedOptional[ColorValue]NoneA substitute for primary_container that's the same color for the dark and light themes.
secondary_fixedOptional[ColorValue]NoneA substitute for secondary_container that's the same color for the dark and light themes.
tertiary_fixedOptional[ColorValue]NoneA substitute for tertiary_container that's the same color for dark and light themes.
primary_fixed_dimOptional[ColorValue]NoneA color used for elements needing more emphasis than primary_fixed.
secondary_fixed_dimOptional[ColorValue]NoneA color used for elements needing more emphasis than secondary_fixed.
surface_brightOptional[ColorValue]NoneA color that's always the lightest in the dark or light theme.
surface_containerOptional[ColorValue]NoneA recommended color role for a distinct area within the surface.
surface_container_highOptional[ColorValue]NoneA surface container color with a darker tone.
surface_container_highestOptional[ColorValue]NoneA surface container color with the darkest tone. It is used to create the most emphasis against the surface.
surface_container_lowOptional[ColorValue]NoneA surface container color with a lighter tone that creates less emphasis than surface_container but more emphasis than surface_container_lowest.
surface_container_lowestOptional[ColorValue]NoneA surface container color with the lightest tone and the least emphasis relative to the surface.
surface_dimOptional[ColorValue]NoneA color that's always darkest in the dark or light theme.
tertiary_fixed_dimOptional[ColorValue]NoneA color used for elements needing more emphasis than tertiary_fixed.

事件 ​

名称类型默认值说明
on_primaryOptional[ColorValue]NoneA color that's clearly legible when drawn on primary.
on_primary_containerOptional[ColorValue]NoneA color that's clearly legible when drawn on primary_container.
on_secondaryOptional[ColorValue]NoneA color that's clearly legible when drawn on secondary.
on_secondary_containerOptional[ColorValue]NoneA color that's clearly legible when drawn on secondary_container.
on_tertiaryOptional[ColorValue]NoneA color that's clearly legible when drawn on tertiary.
on_tertiary_containerOptional[ColorValue]NoneA color that's clearly legible when drawn on tertiary_container.
on_errorOptional[ColorValue]NoneA color that's clearly legible when drawn on error.
on_error_containerOptional[ColorValue]NoneA color that's clearly legible when drawn on error_container.
on_surfaceOptional[ColorValue]NoneA color that's clearly legible when drawn on surface.
on_surface_variantOptional[ColorValue]NoneA color that's clearly legible when drawn on surface_container_highest.
on_inverse_surfaceOptional[ColorValue]NoneA color that's clearly legible when drawn on inverse_surface.
on_primary_fixedOptional[ColorValue]NoneA color that is used for text and icons that exist on top of elements having primary_fixed color.
on_secondary_fixedOptional[ColorValue]NoneA color that is used for text and icons that exist on top of elements having secondary_fixed color.
on_tertiary_fixedOptional[ColorValue]NoneA color that is used for text and icons that exist on top of elements having tertiary_fixed color.
on_primary_fixed_variantOptional[ColorValue]NoneA color that provides a lower-emphasis option for text and icons than on_primary_fixed.
on_secondary_fixed_variantOptional[ColorValue]NoneA color that provides a lower-emphasis option for text and icons than on_secondary_fixed.
on_tertiary_fixed_variantOptional[ColorValue]NoneA color that provides a lower-emphasis option for text and icons than on_tertiary_fixed.

关注我,学习大模型、大数据、Python等热门技术。