From d0ef6abdc6010e0cc99833126d696842eaa6380b Mon Sep 17 00:00:00 2001 From: Philippe Daouadi Date: Fri, 25 Apr 2014 21:39:58 +0200 Subject: [PATCH] bugfix: start scale at right color --- colout/colout.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/colout/colout.py b/colout/colout.py index 293ed2c..3d3ebc0 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