This is a small function to calculate a color (RGB) at a specific gradient location.
function gradientColor(percentage, stops)
percentage
is the desired position. It is a number between (including) 0 and 1. Values less then 0 will be set to 0, values greater than 1 will be set to 1.stops
is an array of the gradient stops (see example).