diff --git a/README.md b/README.md index 69be0dd..0a28169 100644 --- a/README.md +++ b/README.md @@ -2728,7 +2728,7 @@ from PIL import Image ```python WIDTH, HEIGHT = 100, 100 size = WIDTH * HEIGHT -hues = [255 * i/size for i in range(size)] +hues = (255 * i/size for i in range(size)) img = Image.new('HSV', (WIDTH, HEIGHT)) img.putdata([(int(h), 255, 255) for h in hues]) img.convert('RGB').save('test.png') diff --git a/index.html b/index.html index cacd956..f801fae 100644 --- a/index.html +++ b/index.html @@ -2353,7 +2353,7 @@ right = [[0.1, 0.6'HSV' - 3x8-bit pixels, Hue, Saturation, Value color space.

Examples

Creates a PNG image of a rainbow gradient:

WIDTH, HEIGHT = 100, 100
 size = WIDTH * HEIGHT
-hues = [255 * i/size for i in range(size)]
+hues = (255 * i/size for i in range(size))
 img = Image.new('HSV', (WIDTH, HEIGHT))
 img.putdata([(int(h), 255, 255) for h in hues])
 img.convert('RGB').save('test.png')