Convert double values to color values

Hi guys, I´m trying to color a surface. I have seven points that represent sensors. For these points I set the color depending on their values. Now I want to color the space between the sensors by using the inverse distance weighting method an uv´s. For that I extracted the double values of the colors of the sensor via the “Color.Hue”-node. Afterwards I processed the data, as double-values, in an python script. But now I´m trying to get the double values back into an color-value that I can assign to the points. Is there a way to also do this with a node, or do I have to process the Color values as R,G,B, to transform it back into an color-value?
I hope the description is precise enough, please let me know if you need more information.
Thanks for helping me!

I don’t quite get what you’re after, so a sketch and an image of your graph would help.

However I have two thoughts.

  1. Why not build the color range directly from the surface, UV and sensor data? Should be about 20 nodes in total, no Python required.
  2. There isn’t a node to convert Hue to RGB as you need saturation and value to get an RGB. If you wanted to take an ‘average’ color from the Hue you could set the saturation and value to the a constant that you like, but typically you need the full matrix across the dataset. Even with that, I am not certain there is a node for the conversion - you’d likely have to build something. The formula on this page looks promising: HSV to RGB conversion | color conversion
1 Like

Python has the standard colorsys module which has the hsv_to_rgb method. Note all values are between 0 and 1 so will require multiplication by 255

1 Like

Thank you so much! This is the exact thing I wanted to do! But in a way to complicated way.
I tried to build it into my model, but the result is a bit far off from the expected result. In the pictures attached are the nodes and the result that i get.
I suspect there is a problem with the lacing, but I don´t quite where it is. Could you help me with this aswell?


It is a lacing issue - WAAAAAAAY back at node #3. You select all elements of family type, which is a list. Then you wired that into a List.Create with nothing else as an input. Bypass that List.Create and I think you’re good.

Wow! I would have never found that problem! Thank you so much! I changed the lacing of the GeometryColor.BySurfaceColors back to “Auto” and it worked!
Thank you so much for your help!

1 Like