fix(artist): restore artwork accents with neutral portrait fallback

This commit is contained in:
zarzet committed 2026-09-27 01:13:02 +07:00
1 parent be69ab4b80
commit c263feb722
3 files changed
+81 -6

No files matched your search

+5 -2
View File
@@ -90,16 +90,19 @@ class _MornyeArtistSurfaceState extends State<MornyeArtistSurface> {
final logoColor = logo == null
? null
: CoverPalette.sourceColor(logo, Brightness.dark);
// Keep the artwork accent for colorful portraits. A neutral
// portrait can acquire a blue Material accent; use white there,
// while allowing an explicit logo color to take precedence.
final primary = widget.neutralActions
? Colors.white
: logoColor ?? palette.primary;
: logoColor ?? (useAccent ? palette.primary : Colors.white);
final primaryLuminance = primary.computeLuminance();
final surfaceContrast =
(primaryLuminance + 0.05) /
(surface.computeLuminance() + 0.05);
final onPrimary = widget.neutralActions
? Colors.black
: logoColor == null
: logoColor == null && useAccent
? palette.onPrimary
: surfaceContrast >= 4.5
? surface