What you are looking for is called interpolation. In this particular scenario you need to interpolate data between two key points.
Since interpolation is a really common scenario when programming, I wrote a generic solution for it, easily allowing you to interpolate between two or more key points, using either linear or even cardinal spline interpolation.
Using my library you could calculate intermediate colors as follows:
var keyPoints = new CumulativeKeyPointCollection<Color, double>(
new ColorInterpolationProvider() );
keyPoints.Add( Color.FromArgb(0, 250, 154) );
keyPoints.Add( Color.FromArgb(143, 188, 139) );
var linear = new LinearInterpolation<Color, double>( keyPoints );
// E.g. to get a color halfway the two other colors.
Color colorHalfway = linear.Interpolate( 0.5 );
You would have to implement ColorInterpolationProvider
by extending from AbstractInterpolationProvider<Color, double>
, but this is quite straightforward, and more information can be found in my blog post.
This example uses the Media.Color
class, but you could just as well support any other Color
class by passing along a different interpolation provider.