Skip to content

fix(whiteboard): keep the chosen hue visible when the brush is dark#21333

Open
criticalAY wants to merge 1 commit into
ankidroid:mainfrom
criticalAY:fix/color-issue
Open

fix(whiteboard): keep the chosen hue visible when the brush is dark#21333
criticalAY wants to merge 1 commit into
ankidroid:mainfrom
criticalAY:fix/color-issue

Conversation

@criticalAY

Copy link
Copy Markdown
Contributor

Purpose / Description

The whiteboard color picker ignores the color you choose when the current brush is dark: you tap a color on the wheel, press OK, and the brush stays black (or comes back near-black). This makes it impossible to add a custom brush color starting from the default black brush.

The cause is how the picker is built. The wheel only controls hue and saturation; brightness is a separate slider below it. When the picker opens on a dark color, that slider is parked near zero, and the final color is assembled from the slider's
brightness. So no matter where you tap on the wheel, the result assembles back to near-black and the picker looks broken.

Fixes

Approach

On the first touch of the wheel, if the current color's brightness is near zero (the slider is parked there), snap the brightness slider to full before the tap is handled. This covers pure black and dark non-black seeds like #030000, without affecting normal picking.

How Has This Been Tested?

Pixel 10 and added Robolectric unit tests in ColorPickerDialogTest

Screen_recording_20260702_182437.mp4

Learning (optional, can help others)

Describe the research stage

Links to blog posts, patterns, libraries or addons used to solve this problem

Checklist

Please, go through these checks before submitting the PR.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

The color wheel only sets hue and saturation. Brightness comes from the
slider below it, and a dark brush parks that slider near zero, so every
color picked on the wheel assembled back to near black and the picker
looked like it ignored the selection.

Restore full brightness the moment the user starts picking a hue from a
near-black color, so the color they tap is the color they get.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to select custom brush color for whiteboard

1 participant