Is there a built-in or otherwise convenient function to perform a linear interpolation of a continuous colorscale? I could roll my own, but would prefer to use already available logic if it exists.
I have defined a continuous colorscale:
colorscale=[[0, 'rgba(214,39,40,1)'], [0.65, 'rgba(255,255,255,1)'], [1, 'rgba(6,54,21,1)']]
Given a data value normalized to (0,1), e.g. 0.2
, I would like to arrive at the interpolated RGBA color code using my defined colorscale.