In Hex Mode bug
Issue #1
open
In hex mode, if i enter #425968, it changes the value to #415967
Comments (3)
-
repo owner -
Account Deleted Removing all occurrences of Math.round seemed to fix the issue for me
-
Account Deleted Also replaced the return line in _toRgba to do a Math.round instead of parseInt:
return [Math.round(r * 255), Math.round(g * 255), Math.round(b * 255), a];
- Log in to comment
This is most likely because the color picker internally uses HSLA. When you enter a hex/RGB(A) color, the color picker translates it to HSLA, then back to hex/RGB(A) again. This may just be a simple rounding error somewhere.
I'll try to have a look at it soon. Feel free to open a pull request if anyone else solves it before me.