# Saturation returning the wrong values

**URL:** <https://discourse.processing.org/t/saturation-returning-the-wrong-values/22286>\
**Category:** p5.js\
**Created:** [June 30, 2020, 8:26pm UTC](https://discourse.processing.org/t/saturation-returning-the-wrong-values/22286 "2020-06-30T20:26:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoeMcKay](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@JoeMcKay](https://discourse.processing.org/u/JoeMcKay)\
**Post date:** [June 30, 2020, 8:26pm UTC](https://discourse.processing.org/t/saturation-returning-the-wrong-values/22286/1 "2020-06-30T20:26:31Z")

</div>

Hi all.  
I’m trying to make a color picker and ran into a bug - saturation() isn’t giving me the correct values.  
I created a gradient using hsb color. When I mouseOver the gradient and use get(mouseX, mouseY) to collect color under the mouse it returns all the correct values but the saturation is wrong.  
Here’s an example of what I mean.  
[https://editor.p5js.org/Joemckay/sketches/2NMSFqN7u](https://editor.p5js.org/Joemckay/sketches/2NMSFqN7u)  
When I duplicated the sketch in Processing it works fine.  
Anyone else run into this problem, or is it a known issue? I don’t see any bug reports for it, but I suck at githubbing so maybe I missed it?

---

<div class="post-metadata">

**Author:** ![SomeOne](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/someone/32/8639_2.png) [@SomeOne](https://discourse.processing.org/u/SomeOne)\
**Post date:** [July 1, 2020, 6:42am UTC](https://discourse.processing.org/t/saturation-returning-the-wrong-values/22286/2 "2020-07-01T06:42:19Z")

</div>

Hi,  
I found no problems, it seemed to work just fine. It indicates that problem could be browser or OS related or a combination of them. I ran the script on Windows 10 with Chrome browser.

---

<div class="post-metadata">

**Author:** ![janmaltel](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@janmaltel](https://discourse.processing.org/u/janmaltel)\
**Post date:** [July 1, 2020, 8:41am UTC](https://discourse.processing.org/t/saturation-returning-the-wrong-values/22286/3 "2020-07-01T08:41:49Z")

</div>

Seems to work fine on MacOS and Firefox 77.
