Skip to content

[Color] Expose more powerful dynamic color extraction #4159

Open
@OxygenCobalt

Description

@OxygenCobalt

Is your feature request related to a problem? Please describe.
I want to implement dynamic coloring in part of my app, but MDC currently provides color extraction functionality that is extremely limited:

  1. It uses theming overrides that only work on Android 12+
  2. None of the colors are exposed, which makes it impossible to use outside of a self-contained fragment or activity unless you do some extremely messy Context workarounds
  3. You seemingly cannot switch/animate between different palettes at runtime, making it useless for i.e music apps whose cover art regularly changes while it's being used.

Describe the solution you'd like
Update dynamic color extraction to be:

  1. Backwards-compatible with pre-Android 12 versions, assuming that an existing Material3-compliant theme is already provided to harmonize with
  2. Able to return a general Theming object that allows the colors to be easily applied or accessed.

Describe alternatives you've considered
Using unmaintained third-party libraries like MonetCompat that are largely proofs-of-concept that likely don't align with the current palette extraction/color harmonization that the M3 spec recommends.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions