bugfix: use the full scale range

Was using scale[1:] colors instead of scale[:]
This commit is contained in:
Johann Dreo 2014-04-25 14:37:12 +02:00
commit 39674665d8

View file

@ -391,7 +391,7 @@ def color_scale( name, text ):
# normalize and scale over the nb of colors in cmap
colormap = context["colormaps"][name]
i = int( math.ceil( (f - context["scale"][0]) / (context["scale"][1]-context["scale"][0]) * (len(colormap)-1) ) )
i = int( math.ceil( (f - context["scale"][0]) / (context["scale"][1]-context["scale"][0]) * len(colormap) ) ) - 1
color = colormap[i]
# infer mode from the color in the colormap