Changed interface for nearest() method to take individual red, green,

blue values instead of tuple
This commit is contained in:
Barry Warsaw 1998-09-29 20:03:15 +00:00
parent 420201972e
commit 7a13418e12
1 changed files with 1 additions and 2 deletions

View 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():