Skip to content
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

Saturation gradient isn't being rendered correctly on Android #2

Closed
Sind opened this issue Apr 4, 2017 · 6 comments
Closed

Saturation gradient isn't being rendered correctly on Android #2

Sind opened this issue Apr 4, 2017 · 6 comments
Assignees
Labels

Comments

@Sind
Copy link

Sind commented Apr 4, 2017

screenshot_iro

Using Chromium on Android (Also looks the same in FireFox)

Strangely enough, the picked color is correct(what color should be at that location on the wheel).

@jaames
Copy link
Owner

jaames commented Apr 4, 2017

Now that's certainly a strange one. Thank you for the report!

It looks like the hue ring is fine, but the radial gradient used to represent saturation isn't being drawn correctly, which pretty much narrows down the issue to these lines of code: https://github.com/jaames/iro.js/blob/master/src/iro.js#L557:L561.

I've recreated the bug in a codepen here:
http:https://codepen.io/rakujira/pen/rybVXW?editors=1011

I don't personally have an Android device to test with (hence why it managed slipped past me in the first place), however a friend was able to confirm that this is an issue on their device too.

If I'm honest here, I'm pretty sure that this is an Android bug since I'm not be doing anything out of the ordinary as far as I can tell. I'll be sure to do more testing first, though.

--

Oh, and yeah, as you noted this won't present any change with the picked color. That's calculated based on the position of the markers. (:

@jaames jaames self-assigned this Apr 4, 2017
@jaames jaames added the bug label Apr 4, 2017
@jaames jaames changed the title Color wheel looks wrong on mobile Saturation gradient isn't being rendered correctly on Android Apr 4, 2017
@Sind
Copy link
Author

Sind commented Apr 4, 2017

I have only tested this in Android so far, but changing the "2" to "0" seems to fix the issue.

@Sind
Copy link
Author

Sind commented Apr 4, 2017

And yea. Seems like createRadialGradient on Android struggles with radiuses between 0 and 15. Strange =/

jaames added a commit that referenced this issue Apr 4, 2017
@jaames
Copy link
Owner

jaames commented Apr 5, 2017

That's... certainly odd. Oh well, at least we know what's causing it ¯\_(ツ)_/¯

I've committed a hotfix for the issue which implements the changes that you suggested, I hope it's resolved now

Thanks again!

@Sind
Copy link
Author

Sind commented Apr 5, 2017

Looks good. I'll close this issue then.

Btw, it's good practice to close an issue when you think you've fixed it, and leave it to the other users to re-open it if there's more.

Also, no problem. I've been looking for a lightweight colorpicker widget, and this looks perfect!(All the other nice looking ones require jQuery, bleh)

@Sind Sind closed this as completed Apr 5, 2017
@jaames
Copy link
Owner

jaames commented Apr 5, 2017

I see, thanks for the tip!

I hope you find it useful for your needs. By the way, I'm currently rewriting everything from the ground up over in the v2 branch, so please feel free to open up another issue if you have any feature requests or anything. It would be helpful to get some feedback. (:

jaames added a commit that referenced this issue Nov 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants