Mapping `int` value to color in a color palette

84 views Asked by At

I've made a Python-based simulation that feeds into a 3D modeling program, Rhino for further calculations and to display the results. I'm wanting to color the objects based on a value generated by the simulation, preferably using a color pallet such as Viridis, brewer, etc.

I'm having difficulty finding a module where I can

  • enter a min/max value for the scale
  • choose a color palette
  • give a float value;

and in return, the module would give a specific color relative to that value. I will then break down the color into RGB values to feed into my modeling program.

Does anyone have any suggestions for how to do this? All the color modules I have found so far feed into matplotlib or another graphing library rather than just allowing me to directly give a value and then return a color.

Thanks!

0

There are 0 answers