py3: return gradients properly
@@ -1068,9 +1068,10 @@ class Py3:
self._threshold_gradients[name_used] = (colors, minimum, maximum)
if value < minimum:
- return colors[0]
- if value > maximum:
- return colors[-1]
+ color = colors[0]
+ elif value > maximum:
+ color = colors[-1]
+ else:
value -= minimum
col_index = int(((len(colors) - 1) / (maximum - minimum)) * value)
color = colors[col_index]
