symmetric colormap always with pure white in the middle

This commit is contained in:
Christoph Kords 2012-12-11 16:50:34 +00:00
parent f744fc1d47
commit 93d822aaa1
1 changed files with 3 additions and 3 deletions

View File

@ -81,12 +81,12 @@ def interpolate(val0, val1, x):
# -----------------------------
def syminterpolate(comp, val0, val1, x):
if comp == "hue":
return interpolate(val0, val1, x)
return {True:val0,False:val1}[x<0.5]
if comp == "lightness":
val_middle = max(0.9, val0, val1)
val_middle = 1
elif comp == "saturation":
val_middle = min(0.1, val0, val1)
val_middle = 0
if x < 0.5:
return interpolate(val0, val_middle, 2*x)
else: