Commit f9b1200f authored by Barry Warsaw's avatar Barry Warsaw

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

blue values instead of tuple
parent e7a3131d
......@@ -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():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment