PaletteOptimiser

Changeset

62:aa75aca1ebd7
2015-10-09 Paul Boddie raw files shortlog changelog graph Removed the nearest function.
optimiser.py (file)
     1.1 --- a/optimiser.py	Fri Oct 09 00:25:02 2015 +0200
     1.2 +++ b/optimiser.py	Fri Oct 09 00:34:32 2015 +0200
     1.3 @@ -48,11 +48,6 @@
     1.4      r2, g2, b2 = rgb2
     1.5      return math.sqrt(pow(r1 - r2, 2) + pow(g1 - g2, 2) + pow(b1 - b2, 2))
     1.6  
     1.7 -def nearest(rgb, values):
     1.8 -    l = [(distance(rgb, value), value) for value in values]
     1.9 -    l.sort()
    1.10 -    return l[0][1]
    1.11 -
    1.12  def restore(srgb):
    1.13      return tuple(map(lambda x: int(x * 255.0), srgb))
    1.14