In Hex Mode bug

Issue #1 open
Former user created an issue

In hex mode, if i enter #425968, it changes the value to #415967

Comments (3)

  1. Olav Andreas Lindekleiv repo owner

    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.

  2. Former user 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];

  3. Log in to comment