def linear_gradient(start, end, nbins, eps=1e-10):
 start = array(start)
 end = array(end)
 result = []
 n_minus_1 = max(float((nbins - 1)), eps)
 for i in range(nbins):
  result.append(list((((start * (n_minus_1 - i)) / n_minus_1) + (end * (i / n_minus_1)))))
 return result

def linear_gradient ( start , end , nbins , eps = 1e-10 ) : start = array ( start ) end = array ( end ) result = [ ] n_minus_1 = max ( float ( ( nbins - 1 ) ) , eps ) for i in range ( nbins ) : result . append ( list ( ( ( ( start * ( n_minus_1 - i ) ) / n_minus_1 ) + ( end * ( i / n_minus_1 ) ) ) ) ) return result
makes linear color gradient from start to end .