From bfbe67f47ff161fc08d45af3213772162d2d0e26 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Sat, 31 Jan 1998 00:32:07 +0000 Subject: Better implementation of nearest(). Not faster, but better --- Tools/pynche/ColorDB.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- cgit v0.12