Re: How to make rainbow RGB values?

2008-02-25 Thread Andrew McNamara
Consider using an HSV-RGB conversion function. Saturation (S) and value (V) should remain constant, while Hue (H) varies to get your rainbow effect. Hey thank you very much, that worked like a charm! :] There's even a library function in the colorsys module (http://

How to make rainbow RGB values?

2008-02-24 Thread Simon Forman
Hey all, 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. The return values should be R, G, B tuples (well, #xx color codes, but that's not the hard

Re: How to make rainbow RGB values?

2008-02-24 Thread Andrew McNamara
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. [...] I've tried a simple scheme of overlapping sines, but this resulted in too much red and blue, and no

Re: How to make rainbow RGB values?

2008-02-24 Thread Simon Forman
On Feb 24, 5:09 pm, Andrew McNamara [EMAIL PROTECTED] wrote: 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. [...] I've tried a simple scheme of