From 39674665d83b8d183b2038692643f58526e67b57 Mon Sep 17 00:00:00 2001 From: nojhan Date: Fri, 25 Apr 2014 14:37:12 +0200 Subject: [PATCH] bugfix: use the full `scale` range Was using scale[1:] colors instead of scale[:] --- colout/colout.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/colout/colout.py b/colout/colout.py index 3d3ebc0..293ed2c 100755 --- a/colout/colout.py +++ b/colout/colout.py @@ -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