diff options
author | Barry Warsaw <barry@python.org> | 1998-01-31 00:32:07 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 1998-01-31 00:32:07 (GMT) |
commit | bfbe67f47ff161fc08d45af3213772162d2d0e26 (patch) | |
tree | 985143048e9150cd87e3bd8e010f8e615c811df6 /Tools | |
parent | 2406b1d40af0d61e63ab2664bce01f426c5beb5a (diff) | |
download | cpython-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.py | 3 |
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 |