fix(whiteboard): keep the chosen hue visible when the brush is dark#21333
Open
criticalAY wants to merge 1 commit into
Open
fix(whiteboard): keep the chosen hue visible when the brush is dark#21333criticalAY wants to merge 1 commit into
criticalAY wants to merge 1 commit into
Conversation
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.
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.
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
ColorPickerDialogTestScreen_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.