I'd like to make a percentage into a hexidecimal color. Kind of how HSV color degrees work...
I am using PHP.
IE:
0% : RED (#FF0000)
8% : ORANGE (#FF7F00)
17% : YELLOW (#FFFF00)
25% : LIMEGREEN (#7FFF00)
... : ...
83% : MAGENTA (#FF00FF)
92% : ROSE (#FF007F)
100% : RED (#FF0000)
Try converting the percentage to HSV (divide the percentage by 100 to get the hue and just set the saturation and value to an arbitrary constant like 1) and then using this question to convert that to RGB form: PHP HSV to RGB formula comprehension
This little snippet would appear to do what you're trying to achieve
http://bytes.com/topic/php/insights/890539-how-produce-first-pair-rgb-hex-color-value-percent-value
This is not my code and I don't remember where I found it. I've been using it for a couple of years and it works perfectly for me. It could be what your looking for (or part of it may be).