Add graph lane tokens to the color scheme - #74
Merged
Conversation
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.
Why
GitGraphGutterbuilds a categorical palette — indexedpalette[lane % size]purely to tell branch lanes apart. The colours carry no meaning; they only need to be distinguishable. It was assembled from three unrelated sources:Measured in CIE-Lab ΔE, three real defects:
Plus two hardcoded lanes that never adapt between light and dark, and Material pink/lavender belonging to no palette this app uses.
What changed
Added
AslColorScheme.graphLanes: List<Color>— a genuinely new kind of token. Every other colour here is semantic (error,warning,success,accentPrimary); this one is categorical, which is why nothing existing fit and why substituting an existing token would have been wrong.GitGraphGutternow readscolors.graphLanes. The lane indexing, Canvas geometry, stroke widths and gutter dimensions are untouched.How the colours were chosen
Not by eye. An exhaustive search over hues already present in this app's design language, required to satisfy three constraints at once:
The second constraint means a lane can never read as a status colour. The third means no accent setting can make two lanes look alike — the current palette fails this, since lane 0 follows the accent.
Worst-case separation improves from 17.9 to 40.4.
Behavior
Branch lane colours change. This is deliberate and is the point of the change. Everything else about the graph renders identically.
Light and dark were verified as correctly assigned rather than swapped — a swap would compile cleanly and look wrong only at runtime.
Scope
This is the last
MaterialTheme.colorSchemeusage outside the design system. The only remaining one in the whole repo isTheme.kt:67, insideAslAppThemeitself — the adapter that installs the Asl tokens into Material3, and the one legitimate consumer.The hardcoded literals
0xFF43A047and0xFFFF8F00are gone; no other file duplicates them.Tests
No new tests. A token addition with no logic; the palette's properties were verified analytically before implementation rather than asserted at runtime.
Verification
./gradlew test— all modules pass../gradlew :app:compileDebugKotlin— passes../gradlew detekt— passes.AslLightColorsand dark inAslDarkColors.palette[...]index sites are unchanged apart from their source.Baseline
feature/git/detekt-baseline.xmlregenerated — 1 removed, 0 added. Project total 241 → 240.Correction to an earlier claim
A previous PR description asserted the Amber accent collided with lane 5 "at RGB distance 60". That used Euclidean RGB distance, which is a poor perceptual proxy. Measured properly, that pair is ΔE 28.2 and the Emerald/green pair is ΔE 27.7 — both distinguishable. The genuinely confusable pair was
tertiaryvssecondaryat ΔE 17.9, which is what this change fixes.