October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Mountain View desk7 min

Google explains how Dynamic & predefined Colors coexist

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • 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.).

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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:

  1. Build a predefined ColorScheme (light + dark) from your brand colors.
  2. Check if the device runs Android 12+.
  3. If yes, compute a dynamic ColorScheme (light or dark).
  4. If not, use the predefined ColorScheme.
  5. 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Multiple theme wrappers (nested MaterialTheme with different colorScheme inputs)
  • 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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:

  1. Identify which semantic attributes you want to brand-lock (commonly primary, onPrimary, primaryContainer).
  2. Set those attributes in your app theme (or in a specific override style applied on top of the dynamic overlay).
  3. 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Dark 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.Support on Ko-Fi

Troubleshooting: when the UI doesn’t match expectations

Dynamic Color doesn’t change anything

Try these checks:

  1. Confirm device is Android 12+ (API 31 or higher).
  2. Verify you’re actually using the dynamic scheme in MaterialTheme(colorScheme = ...) (Compose) or in the correct dynamic overlay theme (Views).
  3. Look for a hard-coded colorScheme assigned after dynamic resolution.
  4. 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).

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.