We are about to switch to a new forum software. Until then we have removed the registration on this forum.
this is my first ever post here. be patient. I'm learning the color functions, but I do not understand how does the function hue() works.
If I have the following sample code:
color c;
voide setup(){ colorMode(HSB,255); c=color(10,255,255); println(hue(c)); //here I would expect 10, instead I have 9.833333 }
void draw (){ ... }
thanks for any help
Answers
Please format your code - https://forum.processing.org/two/discussion/32/how-to-format-text-and-code-on-the-new-forum/p1
Also, the reason for your problem is probably just a limitation in terms of precision - conversions in colormodes will lead to such problems. Someone else may confirm this.
Thanks for your kind answer. I will read the formatting rules for the next time.
Here is how the hue function works:
https://github.com/processing/processing/blob/master/core/src/processing/core/PGraphics.java