Color of a line

Hi!
I have a set of lines whose color should be based upon their length. Basically I’m trying to visualize the stress in rods using length goals. So whenever the rod is compressed, the length reduces and they need to look blue. The more compression it undergoes, the more blue it need to look. While the more it expands the more red it should look. I understand how to set mesh colors, but when I have multiple lines, I’m not sure how to fix colors of each line individually.

Thanks in advance!

If you can assign a color based on the length, you can use a custom preview with that color. In the attached example, the color is generated using the HSV color space, by changing the Hue-value only.

colored_line.gh (7.4 KB)

1 Like