Skip to content

fix(holo): gray functional/action keys with dynamic colors in light mode - #2687

Open
MiMoHo wants to merge 1 commit into
HeliBorg:mainfrom
MiMoHo:2052-holo-functional-key-tint
Open

fix(holo): gray functional/action keys with dynamic colors in light mode#2687
MiMoHo wants to merge 1 commit into
HeliBorg:mainfrom
MiMoHo:2052-holo-functional-key-tint

Conversation

@MiMoHo

@MiMoHo MiMoHo commented Jul 22, 2026

Copy link
Copy Markdown

Fixes #2052.

Cause

Holo's functional-key background is an intrinsically gray 9-patch (themes-holo_base.xmlbtn_keyboard_key_pressed_klp_light, center pixel RGB(131,131,131)), and DynamicColors.setColor tints key backgrounds with PorterDuff.Mode.MULTIPLY. Multiplying the light dynamic accents (system_accent2_100 etc.) 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 (see KeyboardTheme.kt: "should be 222222, but the key drawable is already grey") — DynamicColors doesn't. Dark mode isn't affected because the night functional tint is gray anyway.

Fix

Use SRC_IN instead of MULTIPLY, limited to DynamicColors + Holo + light + the functional/action backgrounds. SRC_IN rather than SRC_ATOP on purpose: with key borders disabled the normal-state tint is Color.TRANSPARENT, and SRC_IN keeps that invisible. DefaultColors is left untouched — its static themes are tuned around MULTIPLY.

Result — Holo + dynamic colors + light + key borders

before after

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 DynamicColors in light mode, only the functional/action backgrounds. Dark mode, the other theme styles, and the static themes are unchanged.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Holo Keyboard style's special buttons (shift, comma, enter, etc) are gray in light mode

1 participant