I have the following colormap in Python which maps each value to a color. But my question: How can I quantize the values for getting a same color for a specified range? For example: from 0 until 10 (Green) , from 10 until 50 (yellow), from 50 until 55 (red) , ...
import matplotlib as mpl
import matplotlib
from matplotlib import cm
.
.
.
norm = matplotlib.colors.Normalize(vmin = min,vmax = max, clip = True)
.
.
for i in range(numberMaterials):
step = (max-min)/numberMaterials
value = min + step*i
mat = bpy.data.materials.new("mat" +str(i))
color = cm.jet(norm(value),bytes=True)