Interpolating a Continuous Colorscale

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.

There is a utility for this in plotly.colors, can’t remember the name exactly.
Edit: I think this one sample_colorscale

1 Like

Thank you so much @RenaudLN this is exactly what I was looking for! Much better than implementing my own interpolation routine unnecessarily.