def _create_gradient_image(size, color_from, color_to, rotation):
 rgb_arrays = [np.linspace(color_from[x], color_to[x], size).astype('uint8') for x in range(3)]
 gradient = np.concatenate(rgb_arrays)
 picture = np.repeat(gradient, size)
 picture.shape = (3, size, size)
 image = PIL.Image.fromarray(picture.T)
 image = image.rotate(rotation)
 return image

def _create_gradient_image ( size , color_from , color_to , rotation ) : rgb_arrays = [ np . linspace ( color_from [ x ] , color_to [ x ] , size ) . astype ( 'uint8' ) for x in range ( 3 ) ] gradient = np . concatenate ( rgb_arrays ) picture = np . repeat ( gradient , size ) picture . shape = ( 3 , size , size ) image = PIL . Image . fromarray ( picture . T ) image = image . rotate ( rotation ) return image
make an image with a color gradient with a specific rotation .