Simon Forman
2008-02-25 02:14:52 UTC
On Feb 24, 5:09 pm, Andrew McNamara <andr... at object-craft.com.au>
(V) should remain constant, while Hue (H) varies to get your rainbow
effect.
--
Andrew McNamara, Senior Developer, Object Crafthttp://www.object-craft.com.au/
Hey thank you very much, that worked like a charm! :]
There's even a library function in the colorsys module (http://
docs.python.org/lib/module-colorsys.html)
Cheers,
~Simon
I want to map an int to a color on a rainbow spectrum, i.e. for an int
n in the range 0..N, low values (near 0) should map to the red end,
and high values (near N) to the blue/violet end.
[...]n in the range 0..N, low values (near 0) should map to the red end,
and high values (near N) to the blue/violet end.
I've tried a simple scheme of overlapping sines, but this resulted in
too much red and blue, and no indigo/violet.
Consider using an HSV->RGB conversion function. Saturation (S) and valuetoo much red and blue, and no indigo/violet.
(V) should remain constant, while Hue (H) varies to get your rainbow
effect.
--
Andrew McNamara, Senior Developer, Object Crafthttp://www.object-craft.com.au/
There's even a library function in the colorsys module (http://
docs.python.org/lib/module-colorsys.html)
Cheers,
~Simon