-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong color when picking from left bottom #14
Comments
I'd really appreciate if you could attach a screenshot with some log, so I can appreciate which is your exact case. We are using https://github.com/netbeast/colorsys to convert colors back and forward. Highly saturated colors (whites) can be translated to red in some scenarios, since they lose their color information in (white in rgb is {255,255,255} but in hsv, hue is an independent variable, so its info is kept safe). Don't know if that's the case of tinycolor, in colorsys there it is a test implementation: https://github.com/netbeast/colorsys/blob/master/test/test.js#L39-L47 |
Thanks for your quick reply @jsdario Actually I just found the reason and fixed it like this: When dragging in that area, for instance at 7 o'clock blue color, picker returns a value like so:
The correct range for h is [0, 360], so obviously tinycolor converting to hex will return some other colors like red (I was just logging the final result at the beginning). All I did is a small check:
That's it. Hopefully it would be helpful for anyone else who is using this component. |
Oh I see! Since I am collaborator here and in Thanks a lot for your contribution! Will close the issue with a |
Thanks for this component.
I found out that the area from 5 o'clock to 9 o'clock always returns something red in console.
BTW I am using tinycolor to convert the hsv to hex. But I don't think that's related in some ways.
The text was updated successfully, but these errors were encountered: