Skip to content

feat: dynamic album art color extraction for Now Playing glow #94

@jaxkodex

Description

@jaxkodex

Context

Per specs/design.md, the ambient glow behind album art in NowPlayingScreen should use the dominant color extracted from the current track's album art, rather than the static AccentPrimary green currently used.

Proposed changes

  • Use Android Palette API to extract dominant/vibrant swatch from the loaded bitmap
  • Apply luminance gating: if extracted color is too dark (<30 luminance) or too light (>80), fall back to AccentPrimary
  • Animate color transition between tracks using animateColorAsState
  • Fallback: AccentPrimary when no album art is present or Palette extraction fails

Implementation notes

Palette.from(bitmap).generate { palette ->
    val dominant = palette?.getDominantColor(AccentPrimary.toArgb())
    // luminance gate, then update state
}

Coil's ImageRequest supports a listener or target that provides the loaded Drawable/Bitmap for Palette extraction.

Files affected

  • ui/nowplaying/NowPlayingScreen.ktNowPlayingAlbumArt composable
  • ui/nowplaying/NowPlayingViewModel.kt — expose extracted color as state
  • app/build.gradle.ktsandroidx.palette:palette-ktx dependency

Flagged from

Design language PR #91

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions