summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1998-01-31 00:32:07 (GMT)
committerBarry Warsaw <barry@python.org>1998-01-31 00:32:07 (GMT)
commitbfbe67f47ff161fc08d45af3213772162d2d0e26 (patch)
tree985143048e9150cd87e3bd8e010f8e615c811df6 /Tools
parent2406b1d40af0d61e63ab2664bce01f426c5beb5a (diff)
downloadcpython-bfbe67f47ff161fc08d45af3213772162d2d0e26.zip
cpython-bfbe67f47ff161fc08d45af3213772162d2d0e26.tar.gz
cpython-bfbe67f47ff161fc08d45af3213772162d2d0e26.tar.bz2
Better implementation of nearest(). Not faster, but better
Diffstat (limited to 'Tools')
-rw-r--r--Tools/pynche/ColorDB.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Tools/pynche/ColorDB.py b/Tools/pynche/ColorDB.py
index 359e2d8..6fa5577 100644
--- a/Tools/pynche/ColorDB.py
+++ b/Tools/pynche/ColorDB.py
@@ -78,7 +78,8 @@ class ColorDB:
# inefficient!
nearest = -1
nearest_name = ''
- for name, (r, g, b, rrggbb) in self.__byname.items():
+ for name, aliases in self.__byrrggbb.values():
+ r, g, b, rrggbb = self.__byname[name]
rdelta = red - r
gdelta = green - g
bdelta = blue - b