mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-10 16:33:27 +00:00
commons ColorScheme.isLight tested `primary.luminance() < 0.5f`. With the default purple accent the primary is a deep purple in the light theme (lum 0.09) AND a light purple in the dark theme (lum 0.35) — both < 0.5 — so it reported "light" in BOTH modes. The Android app decides the same thing from the background (`background != Color.Black`); `background.luminance() > 0.5f` is the multiplatform-safe equivalent (light bg ≈ 0.98, dark bg = 0.0). Surfaced while reviewing the note-ui extraction: the new commons theme helpers that branch on isLight — subtleBorder / replyModifier (card hairline borders) and allGoodColor / warningColor (RelayDiscovery latency chips) — were rendering their light-theme variant in dark mode, a regression vs the Android originals which use the app's background-based isLight. This restores parity. Also corrects two pre-existing consumers that had the same latent bug and now behave correctly in dark mode (worth a dark-mode glance in review): - UserAvatar → CachedRobohash light/dark variant selection; - ChatTheme.chatBubbleBackground alpha. Verified: :commons:compileKotlinJvm passes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gmrt3jwYPDJ38MJGJ6GaNr