Color Roles

Raw
GuidancelatestM3Retrieved 2026-05-11

Material Design 3 — Color Roles

Overview

Color roles are the semantic layer of the M3 color system. Each role defines where a color is used and what purpose it serves in the UI. Roles are the names that components consume — not palette values. This semantic naming is what enables theme switching: the role name stays constant, the resolved value changes.

M3's official description: "Color roles are like the numbers in a paint-by-number canvas. They're the connective tissue between elements of the UI and what color goes where."


Role Families

Roles are organized into families. Each family represents a visual "tier" of the UI.

Primary Family

The main brand color family. Used for the most prominent interactive elements.

RolePurpose
primaryHigh-emphasis interactive elements: filled buttons, FABs, active states
on-primaryText and icons placed directly on primary
primary-containerLower-emphasis containers: selected chips, tinted cards
on-primary-containerText and icons on primary-container
inverse-primaryPrimary color for use on dark surfaces in a light theme (e.g. snackbar action)

Secondary Family

A supporting accent. Less visually prominent than primary.

RolePurpose
secondaryMedium-emphasis interactive elements
on-secondaryContent on secondary
secondary-containerTinted background for chips, filter components
on-secondary-containerContent on secondary-container

Tertiary Family

A contrasting accent for expressive moments or differentiation.

RolePurpose
tertiaryDecorative or differentiation use
on-tertiaryContent on tertiary
tertiary-containerTinted surfaces using tertiary hue
on-tertiary-containerContent on tertiary-container

Error Family

Reserved exclusively for error states.

RolePurpose
errorError indicators, destructive action buttons
on-errorContent on error
error-containerBackground for error banners, input error states
on-error-containerContent on error-container

Surface Family

Drives backgrounds and UI planes. Derived from the neutral palette.

RolePurpose
surfaceDefault background for cards, sheets, menus
on-surfacePrimary text and icons on surface
on-surface-variantSecondary text, icons, and borders on surface
surface-variantAn alternative surface with slight tinting
surface-dimA dimmed surface for scrim backgrounds
surface-brightA brighter surface variant
surface-container-lowestLowest-emphasis container
surface-container-lowLow-emphasis container
surface-containerDefault container
surface-container-highHigh-emphasis container
surface-container-highestHighest-emphasis container (e.g. filled text fields)
inverse-surfaceA dark surface for use in light themes (e.g. tooltips, snackbars)
inverse-on-surfaceText on inverse-surface
backgroundThe app background behind all surfaces
on-backgroundText on background

Outline Family

RolePurpose
outlineBorders for interactive components (text fields, outlined buttons)
outline-variantDecorative borders, dividers — lower emphasis

Inverse Family

Inverse roles are applied selectively to components to achieve colors that are the reverse of those in the surrounding UI, creating a contrasting effect.

RolePurpose
inverse-surfaceBackground fills for elements that contrast against surface (e.g. snackbars, tooltips)
inverse-on-surfaceText and icons against inverse-surface
inverse-primaryActionable elements (e.g. text buttons) against inverse-surface

Shadow and Scrim

RolePurpose
shadowDrop shadow color
scrimScrim overlays (modal backgrounds)

The on-* Pattern

Every colored surface role has a paired on-* role for content placed on it. This is M3's primary accessibility mechanism: the tone relationship between a surface role and its on-* pair is always at least 4.5:1 contrast.

The pattern applies universally:

  • primary / on-primary
  • primary-container / on-primary-container
  • surface / on-surface
  • error-container / on-error-container

Never place content using a role directly on a surface of the same family. Always use the appropriate on-* partner.


Container vs. Non-Container Roles

The *-container pattern creates two tiers of emphasis within each color family:

  • Non-container (e.g. primary): Higher saturation, higher visual weight. For high-emphasis interactive elements — filled buttons, FABs, active navigation indicators.
  • Container (e.g. primary-container): More muted, larger surface areas. For lower-emphasis elements — selected states, tinted cards, filter chips.

This distinction allows designers to express hierarchy within a color family without introducing additional hues.


Surface Containers

The five surface container roles (surface-container-lowest through surface-container-highest) represent a tonal elevation system. Rather than using drop shadows to convey depth (as in M2), M3 uses progressively tinted surface colors.

Higher-numbered containers appear slightly more tinted with the primary color, which creates depth without shadows. Common usage:

  • surface-container-lowest: App background behind main content
  • surface-container-low: Navigation drawers, side panels
  • surface-container: Cards, dialogs
  • surface-container-high: Modal sheets, text field fills
  • surface-container-highest: Filled text fields, highest-elevation modals

Pairing and Layering Rules

Apply colors only in their intended pairs. Improper pairings break accessible contrast, especially when colors shift with dynamic color or user-controlled contrast levels.

Do: Pair primary with on-primary, secondary-container with on-secondary-container, etc. These pairs maintain legibility across all three contrast levels (standard, medium, high).

Don't: Mix roles from different families (e.g. primary background with primary-container text, or on-surface text on a secondary-container background). These combinations may appear fine at default contrast but break at medium or high contrast.


Add-on Color Roles

Most products don't need these. Add-on roles provide greater flexibility for specific use cases — if you're unsure whether you need them, you probably don't.

Fixed Accent Colors

Fixed colors maintain the same tone in both light and dark themes (unlike regular container colors, which shift between themes). Use them where theme-independent color is required.

RolePurpose
primary-fixedFill color against surface; same tone in light and dark
primary-fixed-dimA deeper, more emphasized version of primary-fixed
secondary-fixedFixed secondary fill
secondary-fixed-dimDeeper fixed secondary fill
tertiary-fixedFixed tertiary fill
tertiary-fixed-dimDeeper fixed tertiary fill

Don't use fixed colors where contrast matters — they don't adapt to theme context and will likely cause contrast failures.

On-Fixed Accent Colors

RolePurpose
on-primary-fixedText and icons on primary-fixed
on-primary-fixed-variantLower-emphasis text and icons on primary-fixed
on-secondary-fixedText and icons on secondary-fixed
on-secondary-fixed-variantLower-emphasis text and icons on secondary-fixed
on-tertiary-fixedText and icons on tertiary-fixed
on-tertiary-fixed-variantLower-emphasis text and icons on tertiary-fixed

Bright and Dim Surface Roles

RolePurpose
surface-dimDimmest surface in both light and dark themes
surface-brightBrightest surface in both light and dark themes

Unlike the default surface role (which is lightest in light theme and flips to darkest in dark theme), surface-bright and surface-dim preserve their relative brightness across both themes. Use them where you need a consistently brighter or dimmer area regardless of theme — for example, a navigation rail (surface-dim) alongside a content panel (surface-bright).


Sources