There is a bug - probably there for ages - that is specially notable in Square SV color picker If you want to give it a try.
If you...
- Have the picker cursor over left or bottom edge... you can't change the Hue value cause it is reset to 0 no matter what.
- Have the Hue in other value than 0 (default), if you move picker cursor to left (Saturation = 0) it will reset Hue to 0 and if you move it to the bottom edge (Value = 0) it will reset both Hue and Saturation to 0.
See video to see the evident issues causing an annoying UX:
Why is this caused?
- I debugged a little and HSV and conversion to RGB is right, all that process looks right I guess BUT there is a design issue in the color pickers, that is, if each RGB component is equal, it completely lose which color tone/hue it was, so in color conversion from RGB to HSV, hue takes value of 0.
What this patch make?
- This patch change the minimun clamp value when calculing relative position within color picker box/rect from 0 to a number close to 0, this is a quick workaround that solves the mentioned issues.
- The ideal would be to solve the issue from root, but I'm not too confident in that area for required changes and is a little messy but as short term fix that can be reverted later easily if root problem is solved I believe is worth it in exhange of what it solves, improving UX a lot.