Hi @bastien,
Welcome to Plotly forum!
plotly.py doesn’t provide a function that maps a value to a color in a colorscale. All these mappings are performed by plotly.js. Recently a similar question was addressed , and these are the proposed solutions: Hover background color on scatter 3d.