From 181a0fd10fdeef5d65046e18101a7c2608c05ebc Mon Sep 17 00:00:00 2001 From: MiMoHo Date: Wed, 22 Jul 2026 23:09:26 +0200 Subject: [PATCH] Holo: recolor functional/action keys with SRC_IN in light mode 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 (#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 --- .../java/helium314/keyboard/latin/common/Colors.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/helium314/keyboard/latin/common/Colors.kt b/app/src/main/java/helium314/keyboard/latin/common/Colors.kt index e14e10b8fe..672d4b7874 100644 --- a/app/src/main/java/helium314/keyboard/latin/common/Colors.kt +++ b/app/src/main/java/helium314/keyboard/latin/common/Colors.kt @@ -312,7 +312,15 @@ class DynamicColors(context: Context, override val themeStyle: String, override drawable.colorFilter = getColorFilter(color) return } - DrawableCompat.setTintMode(drawable, PorterDuff.Mode.MULTIPLY) + // The Holo functional/action key backgrounds are grey nine-patches. Tinting them with + // MULTIPLY turns a light (e.g. dynamic/Material You) accent into grey (#2052), because + // grey * pastel stays grey. SRC_IN replaces the grey with the tint instead. Restricted to + // Holo light + these two backgrounds so tuned static themes and dark mode are unaffected. + val tintMode = if (themeStyle == STYLE_HOLO && !isNight + && (color == FUNCTIONAL_KEY_BACKGROUND || color == ACTION_KEY_BACKGROUND)) + PorterDuff.Mode.SRC_IN + else PorterDuff.Mode.MULTIPLY + DrawableCompat.setTintMode(drawable, tintMode) DrawableCompat.setTintList(drawable, colorStateList) }