<br>Not that I have a solution for you, but figured that I would share some of my experiences with something similar...
<div><br></div><div>The suggestion of using HSL rather than RGB is a good one, as calculating this in RGB would be rather hit or miss most likely...  However, I think perhaps you might want to try calculating the raw chromaticity as CIE xy coordinates, rather than HSL, and then doing your color conversions from there.  From the papers that were linked to earlier regarding the topic, it seemed that the preferred color-space for calculations was LAB, which would coincide rather nicely to the xyY coordinates.  Many things are calculated along these lines, perhaps the most common being light/color temperature using the Planckian Locus: <a href="http://en.wikipedia.org/wiki/Planckian_locus">http://en.wikipedia.org/wiki/Planckian_locus</a>.  Unfortunately as you can see, the algorithms used are rarely &#39;simple&#39; (at least to calculate initially), and approximations are often used.   Basically, if you can find a &#39;curve&#39; on on the color-chart that matches the color-ranges that you are after, than it just becomes a matter of figuring out the function(s) that best approximates it.</div>
<div><br></div><div>I have a python/tkinter app that I created that you could take a look at for an implementation of the above color-temperature scale if it would help you out.  I won&#39;t post all the code here, but you can download it at the links below.  You&#39;ll have to excuse the code however, I make my living as a vfx artist, and I&#39;m rather a hack when it really comes to coding...  Anyways, you can find it here:  <a href="http://wiki.brianmeanley.com/wiki/LightTools.py">http://wiki.brianmeanley.com/wiki/LightTools.py</a> .  For the main code involving the color calculations, look in the &#39;bhm_color.py&#39; module.  A non-gui version can be found here: <a href="http://www.brianmeanley.com/blog/?page_id=349">http://www.brianmeanley.com/blog/?page_id=349</a></div>
<div><br></div><div>Color-science is a pretty hefty subject in its&#39; own right, but it can be an extremely interesting and &#39;fun&#39; one too if you take an interest in it.  I would think that doing a bit of digging into the color temperature examples/links above might give you some insight into what it is that you are hoping to accomplish, as well as the other examples that you mentioned.  I would also highly suggest checking out <a href="http://brucelindbloom.com/">http://brucelindbloom.com/</a> for some good info regarding the math behind most color conversions and more.</div>
<div><br></div><div>Good luck! </div><div><br></div><div>-Brian</div><div><br></div><div>(PS, sorry if I messed this mailing list thing up, I have never actually posted to this list before...)</div>