From: Chris Colbert on
On Thu, Apr 8, 2010 at 2:34 PM, Tobiah <toby(a)rcsreg.com> wrote:
>> How does that answer your original question?
>
> I was able to do this:
>
> import colorsys
>
> sat = 1
> value = 1
> length = 1000
> for x in range(0, length + 1):
>        hue = x / float(length)
>        color = list(colorsys.hsv_to_rgb(hue, sat, value))
>        for x in range(3):
>                color[x] = int(color[x] * 255)
>        hexval = ("#%02x%02x%02x" % tuple(color)).upper()
>        print "<div style='height: 1; width: 500; background-color: %s'>"
> % hexval
>
>
> http://tobiah.org/rainbow.html
> --
> http://mail.python.org/mailman/listinfo/python-list
>

I see. It appears I misunderstood the question.

The link doesn't work in Chrome btw.
From: Tobiah on

>> You should use different variables for the two loops.
>
> Actually it is closing the divs that makes it work in FireFox:
>

Hah. I new that the rainbow wasn't complete and that it
didn't work in Opera. I just fizzled on the closing of the
divs.

I also don't get why it worked at all when I was stomping
on my x variable in the inside loop.

It's better now.

http://tobiah.org/rainbow.html
From: Peter Parker on
Tobiah wrote:
>>> You should use different variables for the two loops.
>> Actually it is closing the divs that makes it work in FireFox:
>>
>
> Hah. I new that the rainbow wasn't complete and that it
> didn't work in Opera. I just fizzled on the closing of the
> divs.
>
> I also don't get why it worked at all when I was stomping
> on my x variable in the inside loop.
>
> It's better now.
>
> http://tobiah.org/rainbow.html

Better than before ... Oy G. Bivr
From: Robert Kern on
On 2010-04-11 12:54 , Peter Parker wrote:
> Tobiah wrote:
>>>> You should use different variables for the two loops.
>>> Actually it is closing the divs that makes it work in FireFox:
>>>
>>
>> Hah. I new that the rainbow wasn't complete and that it
>> didn't work in Opera. I just fizzled on the closing of the
>> divs.
>> I also don't get why it worked at all when I was stomping
>> on my x variable in the inside loop.
>>
>> It's better now.
>>
>> http://tobiah.org/rainbow.html
>
> Better than before ... Oy G. Bivr

Uh, the first color is #FF0000, pure red, not orange.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

From: Peter Parker on
Robert Kern wrote:
> On 2010-04-11 12:54 , Peter Parker wrote:
>> Tobiah wrote:
>>>>> You should use different variables for the two loops.
>>>> Actually it is closing the divs that makes it work in FireFox:
>>>>
>>>
>>> Hah. I new that the rainbow wasn't complete and that it
>>> didn't work in Opera. I just fizzled on the closing of the
>>> divs.
>>> I also don't get why it worked at all when I was stomping
>>> on my x variable in the inside loop.
>>>
>>> It's better now.
>>>
>>> http://tobiah.org/rainbow.html
>>
>> Better than before ... Oy G. Bivr
>
> Uh, the first color is #FF0000, pure red, not orange.
>

Ah, you're right, but it's only 1 pixel high so it's hard to
see. The last one is also #FF0000, pure red ... Roy G. Bivr