]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Changed interface for nearest() method to take individual red, green,
authorBarry Warsaw <barry@python.org>
Tue, 29 Sep 1998 20:03:15 +0000 (20:03 +0000)
committerBarry Warsaw <barry@python.org>
Tue, 29 Sep 1998 20:03:15 +0000 (20:03 +0000)
blue values instead of tuple

Tools/pynche/ColorDB.py

index a4c834227a01d7fa14b8f2323c4530a6cac7d9e3..5191d2b1d088f0de5f573484dc685647505707eb 100644 (file)
@@ -85,11 +85,10 @@ class ColorDB:
        except KeyError:
            raise BadColor(name)
 
-    def nearest(self, rgbtuple):
+    def nearest(self, red, green, blue):
        # TBD: use Voronoi diagrams, Delaunay triangulation, or octree for
        # speeding up the locating of nearest point.  Exhaustive search is
        # inefficient, but may be fast enough.
-       red, green, blue = rgbtuple
        nearest = -1
        nearest_name = ''
        for name, aliases in self.__byrgb.values():