I want to display a color based on a value from 0 to 100. At one end (100), it's pure Red, the other end (0), pure Green. In the middle (50), I want it to be yellow.
And I want the colors to fade gradually from one to another, such that at 75, the color is half red and half yellow, etc.
How do I program the RGB values to reflect this fading? Thanks.
The RGB values for the colors:
Between Red and Yellow, equally space your additions to the green channel until it reaches 255. Between Yellow and Green, equally space your subtractions from the red channel.