Changed interface for nearest() method to take individual red, green,
blue values instead of tuple
This commit is contained in:
parent
420201972e
commit
7a13418e12
|
@ -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():
|
||||
|
|
Loading…
Reference in New Issue