As mentioned previously, one way to generate a rainbow progression of colors is described here:
What I wanted to do was to write a function so that "big" numbers would yield a red color, which would then progress through yellow, then green, to light blue, to dark blue. In other words, 4 of the 6 segments in the above progression.
The following function "heatMap()" takes 3 input variables: map, min, and max. "Map" is the number you want to heat map. If it's greater than or equal to "max", the color is returned as red. From "max" to "min", the colors progress through yellow, green, light blue, and dark blue. It's a linear function, and a "map" value exactly in the middle of "min" and "max" maps to pure green. "Map" values lower than min return pure blue. It returns a vector that can be used in color-setting functions in LSL.
I used the heatMap() function for color-coding in my avatar radar HUD, so that avatar target radar blips above you were red, those at the same altitude were green, and those below you were blue, all along a spectrum of colors. I found that the color was enough information, and less cluttered than numbers.
Hope you find the function helpful :)