views:

176

answers:

2

Hi there, I am working on a project, which I need a special body-background for. The background-color should cycle through the color spectrum like a mood light. So I found this:

http://buildinternet.com/2009/09/its-a-rainbow-color-changing-text-and-backgrounds/

"But" this snippet is working with the RGB colorspace which has some very light and dark colors in it. Getting just bright colors will only work with the HSV colorspace (e.g. having S and V static at 100 and letting H cycle). I don’t know how to convert and in fact how to pimp this snippet for my needs.

Does anyone has an idea??

Thanks in advance. Best, Floyd

A: 

Just use an ready made RGB to HSV conversion function, like this for example:

http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript

Then just input your color as HSV and you'll get RGB that you can use in your animations.

Tatu Ulmanen
Hi, thanks for the fast answer.But where do I put this converter? I can’t just throw it inside the color.js because the animator here is set to grab rgb. How do I output the converted HSV to the animator? You see, my problem isn’t the converter but how to integrate it.
Sgt. Floyd Pepper
Hi there, thanks to Tatu Ulmanen for the Info, but it didn‘t fixed my problem. I am still using the following JavaScript: http://buildinternet.com/2009/09/its-a-rainbow-color-changing-text-and-backgrounds/ . But I don‘t know how to convert the RGB into HSV using the algorithm. Is there anybody with some spare minutes for my case?? I would be so glad.
Sgt. Floyd Pepper
A: 

Hi,

ColorJizz should be what you need.

Mikee