(self, width, height)
return image
Draw a gradient to test the colours.
Draw a gradient to test the colours.
Draw a gradient to test the colours .
def _preview_gradient(self, width, height):
        """Draw a gradient to test the colours."""
        from PIL import Image
        
        colours = ColourRange(0, width, self.colours)
        
        image = Image.new('RGB', (width, height))
        pixels = image.load()
        
        height_range = range(height)
        for x in range(width):
            colour = colours[x]
            for y in height_range:
                pixels[x, y] = colour
                
        return image
def _preview_gradient ( self , width , height ) : from PIL import Image colours = ColourRange ( 0 , width , self . colours ) image = Image . new ( 'RGB' , ( width , height ) ) pixels = image . load ( ) height_range = range ( height ) for x in range ( width ) : colour = colours [ x ] for y in height_range : pixels [ x , y ] = colour return image