Algorithm: How do I fade from Red to Green via Yellow using RGB values?
See the question and my original answer on StackOverflowYou need to use the HSB or HSV color representation instead, and play with the H ("Hue") value. See this other SO question for transformation betweeen RGB and HSB/HSV: How to change RGB color to HSV?