Hi,
My aim is to generate color harmonies in PHP.
For that I need to be able to change the hue of a given color on the RYB wheel. Luckily I found the colorlib library which does just that, so all I have to do is to transpose one of its function to PHP.
Please keep in mind that I know nothing of the processing syntax !
That function can be seen here : https://code.google.com/p/colorlib/source/browse/trunk/colorLib/src/colorLib/Swatch.java#260
I managed to transpose most of it, except for one thing I don't understand, lines 262 and 296 :
Thanks for your time,
C.
My aim is to generate color harmonies in PHP.
For that I need to be able to change the hue of a given color on the RYB wheel. Luckily I found the colorlib library which does just that, so all I have to do is to transpose one of its function to PHP.
Please keep in mind that I know nothing of the processing syntax !
That function can be seen here : https://code.google.com/p/colorlib/source/browse/trunk/colorLib/src/colorLib/Swatch.java#260
I managed to transpose most of it, except for one thing I don't understand, lines 262 and 296 :
- float hue = ((p.hue(c)) / 256f) * 360;
- hue = 1f * y0 + (y1 - y0) * (angle - x0) / (x1 - x0);
Thanks for your time,
C.
1