Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Google’s Dynamic Colors guidance is all about a simple goal: let the system theme your app with wallpaper- and user-based color palettes (Android 12+), while still allowing your app to define brand-specific colors (predefined tokens) when needed.
The tricky part is coexistence. If you define a full static palette and also enable dynamic theming, you need predictable precedence so your UI doesn’t flicker between two different sets of colors—or worse, silently fall back to one set.
This guide explains how Dynamic Colors and predefined colors coexist in practice, what Material expects, and how to implement a hybrid strategy in both Jetpack Compose and classic Views.
What Google means by Dynamic Colors vs predefined colors
Dynamic Colors are generated from the user’s wallpaper/system palette (Android 12+). Material uses these to build a ColorScheme (or equivalent theme color set) at runtime.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errors#1 Best Overall
Predefined colors are your app’s authored values—typically a static ColorScheme (Compose) or an XML-defined set of theme attributes (Views). They’re used as a stable fallback and as a source of truth for brand constraints.
Coexistence means you can use dynamic palettes without losing control over specific brand tokens (for example, your primary brand color or specific semantic roles like error, background, or surface variants).
How the coexistence works: precedence and merging behavior
Material’s core idea is that your theme ultimately resolves to one active ColorScheme at any moment. Coexistence is achieved by choosing a base scheme (dynamic or predefined) and then optionally overriding individual tokens.
In practice, this leads to three predictable behaviors:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
- Base selection: pick dynamic ColorScheme on supported devices, otherwise use your predefined ColorScheme.
- Token precedence: explicit overrides win over the base scheme token-by-token.
- No partial chaos: Material doesn’t blend two schemes simultaneously token-by-token unless you explicitly compose them (for example, “dynamic base but override primary”).
So when Google says dynamic and predefined colors coexist, it usually means: choose dynamic as the default base, then override specific tokens with predefined values when the app needs brand consistency.
Prerequisites and setup
Android and Material versions that matter
Dynamic Colors require Android 12 (API 31) or newer. For older devices, you must supply predefined colors.
If you’re using Jetpack Compose with Material 3, ensure your setup includes Material 3 and a Compose BOM. Commonly used versions are Material 3 around the 1.x line; many projects use a setup like androidx.compose.material3:material3 and a recent Compose compiler.
Core implementation concept
Whether you’re using Compose or Views, you need a theme layer that resolves a single “active” scheme, then feeds semantic color roles into components (button, surface, text, etc.).
Rank #2
Jetpack Compose: the standard Material 3 pattern
In Compose, the most common approach is to create a theme function that selects dynamic colors when available and uses your predefined palette as fallback. Then, optionally, you override specific fields from the base ColorScheme.
Use Dynamic Color when supported, keep a predefined fallback
Material provides helper functions to get dynamic color schemes. A typical pattern is:
- Build a predefined ColorScheme (light + dark) from your brand colors.
- Check if the device runs Android 12+.
- If yes, compute a dynamic ColorScheme (light or dark).
- If not, use the predefined ColorScheme.
- Pass the resolved scheme into
MaterialTheme(colorScheme = ...).
Conceptually, you end up with one scheme value. No blending required yet—just correct base selection.
Override specific tokens while still using Dynamic Color
This is where coexistence becomes concrete: you treat the dynamic scheme as a base, then replace selected tokens with predefined values so your brand stays consistent.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →For example, you might let dynamic update surface/background relationships while forcing primary and primaryContainer to your brand values.
A typical override approach looks like this (illustrative):
- Start with dynamicScheme
- Create a new scheme by copying it and replacing fields, like
primary,primaryContainer, and any other brand-locked roles - Use the resulting scheme in your theme
The key is token-by-token precedence: any explicit value you set in the overridden scheme wins over the dynamic base for that token.
Ensure your theme doesn’t accidentally wipe Dynamic Color
Coexistence fails most often due to “theme overwrites,” where you generate a scheme but then reassign it elsewhere. Watch out for:
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #3
- Multiple theme wrappers (nested MaterialTheme with different
colorSchemeinputs) - Hard-coded color roles inside components (for example, a custom button that uses a fixed primary color instead of semantic tokens)
- Forgetting to update both light and dark schemes when you override tokens
If your UI always shows your predefined palette—even on Android 12+—you likely never actually use the dynamic scheme value in the live MaterialTheme.
Classic Android Views: Material Components approach
Views-based apps don’t have the same “copy a ColorScheme object” workflow. Instead, dynamic colors are applied by resolving theme attributes at runtime or by using Material’s dynamic color support APIs.
Prefer Material3/MaterialComponents APIs that support Dynamic Color
Make sure your app theme is compatible with Material components that can accept dynamic overlays. In older Material Components setups, you often only get static colors unless the library/device integration explicitly supports dynamic theming.
When dynamic is enabled, the runtime may generate an overlay theme that sets semantic attributes (like primary, secondary, background) based on the system palette.
Apply predefined colors without breaking dynamic overlays
The “coexistence” pattern in Views is the same conceptually: let the dynamic overlay provide the base semantic attributes, then force specific attributes to your predefined values.
To do that safely:
- Identify which semantic attributes you want to brand-lock (commonly primary, onPrimary, primaryContainer).
- Set those attributes in your app theme (or in a specific override style applied on top of the dynamic overlay).
- Leave the rest to dynamic so surfaces and tonal variants can reflect the wallpaper palette.
If you override everything, you’re no longer “coexisting”—you’re effectively disabling dynamic behavior.
Edge cases that break coexistence
Android version gaps (pre-Android 12)
Dynamic Colors don’t exist below API 31. If your theme tries to compute a dynamic scheme unconditionally, you may get crashes or “null/empty” theme resolution.
Use an explicit runtime check for API level, and always provide a predefined scheme.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallDark mode and contrast modes
Dynamic Color generation is sensitive to the requested mode (light/dark). Also consider accessibility modes that affect contrast or font scaling.
- Ensure you override brand-locked tokens in both light and dark schemes.
- Test in both system Dark mode and any high-contrast settings your app supports.
Brand colors in components with hard-coded defaults
Some UI elements or custom components might not use semantic tokens. Examples include:
- Custom views that read raw color resources instead of theme attributes
- Third-party components that ship with their own color logic
Coexistence only works when components consume the resolved semantic colors.
Custom theming layers (multiple themes, multiple contexts)
Dynamic overlays are often applied to a specific context/theme. If you inflate layouts using a different context than the one that has dynamic overlay applied, you’ll see mismatched colors.
Consistency matters: make sure the activity or composable hierarchy uses the resolved theme/scheme from the same place you generate it.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshooting: when the UI doesn’t match expectations
Dynamic Color doesn’t change anything
Try these checks:
- Confirm device is Android 12+ (API 31 or higher).
- Verify you’re actually using the dynamic scheme in
MaterialTheme(colorScheme = ...)(Compose) or in the correct dynamic overlay theme (Views). - Look for a hard-coded
colorSchemeassigned after dynamic resolution. - Check nested themes—one wrapper might be swallowing the colors.
Dynamic Color changes too much and overrides your brand
This means you’re using the dynamic scheme as the only source of tokens. Fix by overriding the tokens you want to lock.
- Override primary/secondary and their container/on variants if your brand requires it.
- For text/icon legibility, consider locking only the semantic roles you truly need.
In Compose, token overrides should be done by copying the base scheme and replacing fields—not by rebuilding everything from scratch unless you intend to fully disable dynamic.
Colors look washed out or off by a lot
That usually points to incorrect mixing of color spaces or mismatched roles (for example, using a raw brand color for a surface role that expects tonal behavior).
Use semantic roles consistently. If you lock a token, make sure you pick the correct role (primary vs primaryContainer vs surfaceVariant) rather than reusing one color everywhere.
Comparison: choose full dynamic vs hybrid token overrides
| Strategy | How it works | Pros | Trade-offs |
|---|---|---|---|
| Full Dynamic | Use dynamic ColorScheme as the complete source of semantic tokens | Best wallpaper matching; minimal theme maintenance | Harder to guarantee exact brand colors in every role |
| Predefined Only | Always use your static ColorScheme | Perfect brand consistency | Less personalized UI; can feel out of place next to system themes |
| Hybrid (coexistence) | Use dynamic as base, override selected predefined tokens | Balanced: personalization + brand constraints | Requires careful token selection and thorough light/dark testing |
If you want Google’s dynamic feel but also need brand stability, hybrid is the practical middle ground.
FAQ
Does Dynamic Color always win over predefined colors?
No. Dynamic is usually the base scheme. Any predefined values you explicitly set for specific tokens should override the dynamic base for those tokens.
Can I mix dynamic and predefined within the same token?
Don’t expect Material to “merge” within a single token automatically. The safe mental model is base scheme selection (dynamic or predefined), then explicit token overrides.
Recommended Free Tools
What happens on Android 11 and earlier?
Dynamic Colors aren’t available. Your app must fall back to predefined colors for both light and dark themes.
Why do some components ignore the new colors after I change the theme?
Common causes include custom components using hard-coded colors, third-party widgets not wired to Material semantic tokens, or using the wrong context/theme when inflating views.
How do I verify coexistence is working?
Test on Android 12+ with wallpaper/theme changes enabled, then check that only the intended semantic roles change. In hybrid mode, your locked brand tokens should remain constant while surfaces/tonal variants adapt.
Bottom Line
Dynamic and predefined colors coexist when you treat Dynamic Colors as the base scheme on Android 12+ and then override only the specific semantic tokens you want to keep predefined.
Do that correctly in your theme layer, and you’ll get predictable brand control without sacrificing the personalized Material look Google designed for modern Android.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




