see also here for another approach
see How do I lerp colors on a curve? (not linear interpolation) - #3 by Chrisir