mirror of
https://github.com/python/cpython.git
synced 2025-11-12 07:02:33 +00:00
Changed interface for nearest() method to take individual red, green,
blue values instead of tuple
This commit is contained in:
parent
420201972e
commit
7a13418e12
1 changed files with 1 additions and 2 deletions
|
|
@ -85,11 +85,10 @@ class ColorDB:
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise BadColor(name)
|
raise BadColor(name)
|
||||||
|
|
||||||
def nearest(self, rgbtuple):
|
def nearest(self, red, green, blue):
|
||||||
# TBD: use Voronoi diagrams, Delaunay triangulation, or octree for
|
# TBD: use Voronoi diagrams, Delaunay triangulation, or octree for
|
||||||
# speeding up the locating of nearest point. Exhaustive search is
|
# speeding up the locating of nearest point. Exhaustive search is
|
||||||
# inefficient, but may be fast enough.
|
# inefficient, but may be fast enough.
|
||||||
red, green, blue = rgbtuple
|
|
||||||
nearest = -1
|
nearest = -1
|
||||||
nearest_name = ''
|
nearest_name = ''
|
||||||
for name, aliases in self.__byrgb.values():
|
for name, aliases in self.__byrgb.values():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue