WindowsCommunityToolkit
WindowsCommunityToolkit copied to clipboard
ColorPicker Bottom Shade Adjuster Resets Color to White
Describe the bug
Using the bottom shade adjuster while on the darkest shade resets the selected color to white.
- [ ] Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work:
Steps to Reproduce
- [x] Can this be reproduced in the Sample App? (Either in a sample as-is or with new XAML pasted in the editor.) If so, please provide custom XAML or steps to reproduce. If not, let us know why it can't be reproduced (e.g. more complex setup, environment, dependencies, etc...)
Steps to reproduce the behavior:
- Reproduced in the Sample App as-is
- Using box-shaped spectrum color picker, select any color on the spectrum
- Lower shade value to darkest shade using either bottom or left shade control
- Update to lighter shade value using bottom control.
- Color resets to white.
Expected behavior
Updating to lighter shade using the bottom control maintains the latest used color, instead of reverting to white.
Screenshots
Hello zateutsch, thank you for opening an issue with us!
I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌
Thanks @zateutsch, I had mentioned this to @robloo before during the initial review. I don't think the memory tracking is on his feature board in #3643, so good to have an issue tracking it. Putting out to next milestone for now.
Yea, this was called out before. Thanks for pointing this out in real-world usage.
I did initially think this needs to be fixed by remembering the last color before white. However, just operating in HSV should be enough (and a lot easier / more elegant). The Hue doesn't change in the bottom preview and accent colors area (it behaves just like a Value-channel slider with 5 discrete steps). This means the information is preserved if only HSV was being used instead of RBG.
I will have to change the converter to operate in HSV and this could be a larger tear up in this area. But all this information is internal to the ColorPicker anyway.
Bottom line: It should be fixable without remembering the color: Just switching from RGB to HSV color representation should be enough.
This was fixed in an internal version of the control.
- A new ColorPreviewer control was added to handle the bottom color preview area as well as the accent colors (this helps clean up and simplify ColorPicker code while making feature additions simpler)
- As mentioned above, the ColorPreviewer now works in HSVA color representation instead of RGBA. That preserves Hue information even in min/max Saturation. In practice that means the slider never gets reset to white/black and you can always step back into the color hue selected in the spectrum.
It's only a matter of copying over the code so it shouldn't be too much trouble to fix.
Fixed in #4502