I'm sure this has been figured out. Simple concept...
I want to fill a bar with a "gradient" of sorts. To represent cold to hot... to slowly fill from Purple (cold) to Red (hot). Maybe following the natural light spectrum.
So based on a % FULL from 0 to 100%, I want RBG values that go from Purple to Red. Then I can fill the bar at each % with the appropriate slice of color.
Anyone have a function that generates the [R,G,B] = f(percentage)? I'm thinking there might be a cool set of formulas rather than a lookup table.
I could break this into maybe 5-6 segments rather than 100 to save computational demand.... but if there are formulas that work on a continuous basis that would be cool.