PaletteOptimiser

Changeset

57:1af9f6724ea2
2015-10-08 Paul Boddie raw files shortlog changelog graph Made the experimental square function application slightly cleaner.
optimiser.py (file)
     1.1 --- a/optimiser.py	Wed Oct 07 15:55:52 2015 +0200
     1.2 +++ b/optimiser.py	Thu Oct 08 10:42:30 2015 +0200
     1.3 @@ -75,7 +75,7 @@
     1.4          # Get the colour with components scaled from 0 to 1, plus the inverted
     1.5          # component values.
     1.6  
     1.7 -        rgb = square(scale(rgb))
     1.8 +        rgb = extra(scale(rgb))
     1.9          rgbi = invert(rgb)
    1.10          pairs = zip(rgbi, rgb)
    1.11  
    1.12 @@ -329,7 +329,11 @@
    1.13  
    1.14      # Experimental colour distribution modification.
    1.15  
    1.16 -    square = "-2" in options and square or (lambda x: x)
    1.17 +    use_square = "-2" in options
    1.18 +    if use_square:
    1.19 +        extra = square
    1.20 +    else:
    1.21 +        extra = (lambda x: x)
    1.22  
    1.23      # General output options.
    1.24