Update ImagePalette.py

According to __init__, using `len(self.mode)` might be better. Tested on my machine.
This commit is contained in:
brightpisces 2014-06-24 16:27:35 +08:00
parent e9821edd94
commit 8755bda4e3

View File

@ -101,7 +101,7 @@ class ImagePalette:
fp.write("# Mode: %s\n" % self.mode)
for i in range(256):
fp.write("%d" % i)
for j in range(i*3, i*3+3):
for j in range(i*len(self.mode), (i+1)*len(self.mode)):
try:
fp.write(" %d" % self.palette[j])
except IndexError: