for i in range(100):
    p = i * 0.01
canvas.setFillColorRGB(*[(start_color[i] * (1.0 - p) + end_color[i] * p) for
    i in range(3)])
canvas.rect(i, 0, 2, 100)
Creating a gradient fill in a PDF file using reportlab