

From a seed color
ContentView().m3eTheme(seed: 0x006A6A, variant: .expressive, contrast: 0)Variants: tonalSpot (default, calm), expressive (hue-shifted, playful), vibrant (saturated), fidelity and content (close to the seed), neutral, monochrome, rainbow, fruitSalad. Contrast runs from -1 to 1; 0.5 and 1 give the medium and high contrast schemes for accessibility settings.
Color roles
Always put text and icons in the “on” role of the surface they sit on. Those pairs are designed for contrast.
primary
onPrimary
primaryContainer
onPrimaryContainer
secondaryContainer
onSecondaryContainer
tertiaryContainer
onTertiaryContainer
Brand colors & fonts
let brand = M3ETheme(
colors: M3EColorScheme([.primary: Color(m3eHex: 0x006A6A), .onPrimary: .white]),
typography: .baseline(brandFontFamily: "Fraunces"),
motion: .expressive
)
ContentView().m3eTheme(brand)Motion
| Spring | Expressive (ζ, k) | Standard (ζ, k) | Used for |
|---|---|---|---|
| Fast spatial | 0.6, 800 | 0.9, 1400 | Press morphs, toggles, small moves |
| Default spatial | 0.8, 380 | 0.9, 700 | Shape morphs, layout changes |
| Slow spatial | 0.8, 200 | 0.9, 300 | Large moves |
| Effects | 1, 3800 / 1600 / 800 | same | Color and opacity |
Use standard for utilitarian apps (finance, productivity) and expressive for consumer apps.
Rules of thumb
- Pick one seed (your brand color); let the scheme do the rest.
- Never hard-code hex values inside screens; use roles so dark mode and contrast settings just work.
- Use containers for emphasis (primaryContainer for a hero card), not saturated primary everywhere.
- Re-theme a section with a nested theme only when it carries its own identity (an album, a category).