# HG changeset patch # User Paul Boddie # Date 1441802298 -7200 # Node ID f491a6576ec3722a111fa4ef532ce075d391ebee # Parent 579461e260e67b085a83e308fd7040a5d52a85af Changed the colourmap and added fallback matching for light and dark tones. diff -r 579461e260e6 -r f491a6576ec3 optimiser.py --- a/optimiser.py Wed Sep 09 01:52:06 2015 +0200 +++ b/optimiser.py Wed Sep 09 14:38:18 2015 +0200 @@ -45,10 +45,10 @@ "_GY", "GGC", "*CC", "CCW", # 12x "GGY", "GGG", "GCC", "CCW", # 13x "RRR", "RRM", "RMM", "MMM", # 20x - "RYY", "RRW", "RMW", "MMW", # 21x + "RYY", "RR*", "*MW", "MMW", # 21x "YYY", "YYW", "**W", "WWW", # 22x "YYY", "YYW", "YWW", "WWW", # 23x - "RRR", "RMM", "RMM", "MMW", # 30x + "RRR", "RRM", "RMM", "MMM", # 30x "RRY", "RRY", "RMW", "MMW", # 31x "YYY", "YYW", "YYW", "WWW", # 32x "YYY", "YYW", "YYW", "WWW", # 33x @@ -114,7 +114,7 @@ tone_map[tone] = base count += freq else: - base = match(light and tone[2] or tone[0], bases) + base = light and match(tone[2], bases) or match(tone[0], bases) or match(tone[2], bases) if base: tone_map[tone] = base count += freq / 2