Guides

Material 3 color roles explained

Material 3 components don't use fixed colors. They use color roles: named slots such as primary or surface that are filled in from a color scheme. Change the scheme, or switch to dark mode, and every component updates.

Where the colors come from

A Material 3 scheme starts from one seed color. Google's material-color-utilities library converts it to the HCT color space (hue, chroma, tone) and builds five tonal palettes: primary, secondary, tertiary, neutral and neutral variant. Each role takes a tone from one palette. Light themes use dark tones for primary and light tones for containers; dark themes flip that.

Accent roles

Each accent color comes as a group of four: the color, the color to put on it, a softer container, and the color to put on the container.

RoleUse it for
primary / onPrimaryThe most important actions: filled buttons, active states, the FAB in some styles. Text and icons on it use onPrimary.
primaryContainer / onPrimaryContainerLess prominent emphasis: FABs, selected chips, highlighted cards.
secondary / secondaryContainerSupporting elements: filter chips, tonal buttons, the selected item in a navigation bar.
tertiary / tertiaryContainerContrasting accents that balance primary and secondary, such as badges or an input field you want to stand out.
error / errorContainerErrors and destructive actions.

Surface roles

RoleUse it for
surface / onSurfaceThe default background and the main text on it.
onSurfaceVariantSecondary text and icons, such as subtitles and inactive icons.
surfaceContainerLowest … surfaceContainerHighestFive levels for layered areas: cards, navigation bars, sheets and dialogs. Higher containers sit "closer" to the user. They replace the tinted elevation overlays of earlier Material 3 versions.
surfaceDim / surfaceBrightThe darkest and brightest surface, for areas that should stay dim or bright in both themes.
inverseSurface / inverseOnSurface / inversePrimaryElements that contrast with the rest of the screen, such as snackbars.

Outline and other roles

RoleUse it for
outlineBorders that must be visible: text fields, outlined buttons.
outlineVariantDecorative borders and dividers.
scrim / shadowThe dimmed layer behind modals, and shadows.
primaryFixed, secondaryFixed, tertiaryFixed (and Dim)Colors that stay the same in light and dark themes.

Rules of thumb

palette Build a Material 3 theme colorize Check contrast