Apply custom colours faithfully, add WCAG palettes and background control#81
Merged
Merged
Conversation
…trol
The custom theme discarded most of what the user picked: dark mode
hardcoded primary lightness to 0.75 and clamped saturation, so every
dark custom theme converged on the same pastel wash, and the picker
swatches never matched the applied theme. There was also no
high-contrast option, backgrounds could not be changed directly, and
the saved-theme mechanics were janky.
- Custom colours are now applied verbatim to their roles in both light
and dark mode; on-colours are chosen by relative luminance so text
stays legible on any pick. Containers and neutrals derive from the
picked hues with mode-appropriate lightness.
- The raw HSL slider stacks are replaced by one row per colour role
opening a shared colour picker dialog (HSV square, hue bar, hex
entry), matching the picker style used in GoFlo.
- New "Background (light)" and "Background (dark)" rows override the
derived background, with an Auto reset (stored as ARGB, 0 = auto;
Room v2 -> v3 additive migration for saved profiles).
- New "WCAG accessible colours" toggle derives high-contrast variants
of the built-in palettes programmatically (accents pushed to 7:1
against the background, outlines to 4.5:1), hidden while Custom is
active since custom on-colours are already luminance-guarded.
- Saved themes: tapping a row loads it; profiles record the brightness
mode they were saved under and restore it on load (the mode column
was previously always written "LIGHT" and never read); deleting the
active profile no longer resets the app to Mist.
- Fix CLAUDE.md architecture drift ("no local database", "single sage
palette") and add a LESSONS.md entry on theme-builder clamping.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YEGQ585q9wtogd9G1v7Ef1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This fixes the "colours are always murky and the settings don't do anything" problem at its root, and closes the feature gaps against GoFlo and the template.
Why custom themes looked murky:
buildCustomColorSchemeclamped or discarded most of what the user picked. In dark mode the primary's lightness was hardcoded to0.75and its saturation capped at0.55(secondary/tertiary capped even harder), so every dark custom theme converged on the same pastel wash regardless of the sliders. In light mode the role colours survived, but all containers, surfaces, and backgrounds used fixed low saturations, so the overall look barely changed. The picker swatches drew the raw HSL values, which the applied theme then didn't use — hence "picked colours don't match the theme".Changes
Theme engine (
Color.kt,Theme.kt)Background (light)/Background (dark)) with an Auto option that keeps the old derive-from-primary-hue behaviour. Neutrals (surfaceVariant, outline, inverse surfaces) derive from whichever background is in effect.Picker UI (
CompactThemePicker.kt, newColorPickerDialog.kt)Saved themes (
SavedThemesList.kt,SettingsViewModel.kt, Room v2 → v3)modecolumn was previously always written"LIGHT"and never read despite its docs promising faithful restore.Docs
CLAUDE.mdarchitecture notes corrected: the repo does have a Room database (saved themes only), and the theme is no longer "a single sage-green palette".LESSONS.mdentry on why theme builders must not clamp user input and why previews must resolve through the builder's code path.Changelog fragment:
changelog/unreleased/custom-theme-overhaul.json(minor).a11y_check.pypasses (71 files, clean).Companion PRs: mapgie/Android-App-Template#24 (canonical custom colour model), GoFlo and GaMeD PRs to follow.
🤖 Generated with Claude Code
https://claude.ai/code/session_01YEGQ585q9wtogd9G1v7Ef1
Generated by Claude Code