mirror of
https://github.com/oddluck/limnoria-plugins.git
synced 2025-05-01 07:51:10 -05:00
simplify getAverageC function
This commit is contained in:
parent
48dc547a29
commit
dfc069478f
@ -386,11 +386,6 @@ class ASCII(callbacks.Plugin):
|
|||||||
pixel = tuple(pixel)
|
pixel = tuple(pixel)
|
||||||
if self.colors == 16:
|
if self.colors == 16:
|
||||||
colors = list(self.ircColors.keys())[:16]
|
colors = list(self.ircColors.keys())[:16]
|
||||||
if pixel not in self.matches:
|
|
||||||
closest_colors = sorted(colors, key=lambda color: self.distance(color, self.rgb2lab(pixel), speed))
|
|
||||||
closest_color = closest_colors[0]
|
|
||||||
self.matches[pixel] = self.ircColors[closest_color]
|
|
||||||
return self.matches[pixel]
|
|
||||||
else:
|
else:
|
||||||
colors = list(self.ircColors.keys())
|
colors = list(self.ircColors.keys())
|
||||||
if pixel not in self.matches:
|
if pixel not in self.matches:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user