fix(holo): gray functional/action keys with dynamic colors in light mode - #2687
Open
MiMoHo wants to merge 1 commit into
Open
fix(holo): gray functional/action keys with dynamic colors in light mode#2687MiMoHo wants to merge 1 commit into
MiMoHo wants to merge 1 commit into
Conversation
The Holo functional/action key backgrounds are grey nine-patches. Tinting them with PorterDuff.MULTIPLY turns a light dynamic (Material You) accent into grey, because grey * pastel stays grey (HeliBorg#2052). Use SRC_IN instead, limited to Holo + light mode + the functional/action backgrounds, so tuned static themes and dark mode are unaffected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Fixes #2052.
Cause
Holo's functional-key background is an intrinsically gray 9-patch (
themes-holo_base.xml→btn_keyboard_key_pressed_klp_light, center pixel RGB(131,131,131)), andDynamicColors.setColortints key backgrounds withPorterDuff.Mode.MULTIPLY. Multiplying the light dynamic accents (system_accent2_100etc.) by that gray caps brightness and strips the chroma, so the keys turn gray. The other styles use white/neutral drawables, where MULTIPLY passes the tint through. The static Holo themes already compensate for this in their color choices (seeKeyboardTheme.kt: "should be 222222, but the key drawable is already grey") —DynamicColorsdoesn't. Dark mode isn't affected because the night functional tint is gray anyway.Fix
Use
SRC_INinstead ofMULTIPLY, limited toDynamicColors+ Holo + light + the functional/action backgrounds.SRC_INrather thanSRC_ATOPon purpose: with key borders disabled the normal-state tint isColor.TRANSPARENT, and SRC_IN keeps that invisible.DefaultColorsis left untouched — its static themes are tuned around MULTIPLY.Result — Holo + dynamic colors + light + key borders
Pixel check on those shots: functional key (shift / ?123) RGB(125,114,98) → (244,224,191); action key (119,98,62) → (232,193,121); a normal letter key is identical in both (248,236,222).
Scope: only
DynamicColorsin light mode, only the functional/action backgrounds. Dark mode, the other theme styles, and the static themes are unchanged.