Gradient color line from length

Hello,

I looking to get a line which color change. For exemple, On the same line. The total length is 400 m. I would like to have 0>100 meters in green, then 100>300 meters in blue, then 300>400 meters in Red
The colors are define using the gradient tools and the length levels using number slider

Does someone could help me ?

I didn’t read it carefully and made it more complicated than needed.
at least you can use it for other cases as well :joy:
colours.gh (15.7 KB)

Colour_Line.gh (11.4 KB)

Im no GH-expert and i am sure there are more elegant ways but this should help you.

just throwing this in here :wink: probably the simplest one.

line_color.gh (9.3 KB)

1 Like