Math::Gradient is used to calculate smooth transitions between numerical
values (also known as a "Gradient"). I wrote this module mainly to mix
colours, but it probably has several other applications. Methods are
supported to handle both basic and multiple-point gradients, both with
scalars and arrays.

WWW: http://search.cpan.org/dist/Math-Gradient/
