Skip to content

fix(colors): handle translucent accent when picking action key icon color - #913

Merged
LeanBitLab merged 1 commit into
mainfrom
fix/translucent-accent-crash
Nov 24, 2026
Merged

LeanBitLab merged 1 commit into
mainfrom
fix/translucent-accent-crash

Conversation

@LeanBitLab

Copy link
Copy Markdown
Owner

Fixes #909

The color settings crashed with IllegalArgumentException: background can not be translucent when the accent color had transparency: ColorUtils.calculateContrast (used to pick a dark or white action key icon) needs an opaque background.

  • isLightAccent now blends a translucent accent over the keyboard background (made opaque) before the contrast check, so the icon color matches what is shown. Opaque accents take the same path as before.
  • All six callers (DynamicColors, DefaultColors, AllColors) pass the keyboard background.
  • KeyboardView.getCompositeColor returns an opaque color for a fully transparent key, as its result is used as a contrast background.

Tests: new ColorsTest (crash colors from the reports, opaque accents unchanged, translucent accent judged on dark and light backgrounds).

…olor

calculateContrast throws for a translucent color, which crashed the color settings when the accent had transparency. Blend a translucent accent over the keyboard background before the check; opaque accents are unchanged. Also return an opaque color from KeyboardView.getCompositeColor for a fully transparent key.

Fixes #909
@LeanBitLab
LeanBitLab merged commit bd60db6 into main Nov 24, 2026
1 check passed
@LeanBitLab
LeanBitLab deleted the fix/translucent-accent-crash branch November 24, 2026 10:30
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.

[Bug]: app crash when changing theme color values

1 participant