生成线性渐变
for i in range(500):
for j in range(500):
线性渐变计算
ratio = i / 500.0
color = (int(start_color[0] + (end_color[0] start_color[0]) * ratio),
int(start_color[1] + (end_color[1] start_color[1]) * ratio),
int(start_color[2] + (end_color[2] start_color[2]) * ratio))
img[i, j] = color