Color Gradient On Curve


I am trying to achieve a smooth color gradient along a curve between two points. The panel that I connected to the gradient slider shows that I did indeed achieve a gradient between white and black, but the custom preview is only showing the last parameter, which is black. I used the list item to ensure that the gradient was in fact working, and it is, but it seems like even though I am dividing the curve, when attached to the gradient component, each parameter reads as the entire curve length.

I tried using the Shatter Curve component as well to break the curve, which I saw in a previous post, but this did not work for me in the way I used it.

Any help with this seemingly simple problem would be awesome! :slight_smile:


Line Color (6.8 KB)

You can use ghgl like this: (3.9 KB)


Rhino.Display.DisplayPipeline.DrawGradientLines is available in Rhino 7

Here is a new version of the definition that uses the DrawGradientLines function to draw gradients.
Line Color (20.0 KB)


Wow, I need to learn C#. So easy now.

Thank You!!! :slight_smile:

Be warned, that trick currently only works with lines. We don’t have an implementation that works with curves at this point in time.

Ah, ok. I also just tried baking the gradient in that line using the Human plugin and it didn’t show up… I think probably doing what I want with it might be easiest in Illustrator then.

Thanks again!

really nice @stevebaer! please the parameter stroke width could be as an input.
All fine on Windows but on MAC it doesn’t show width and this happens in GHGL as well, please consider to be fixed.

Line Color (29.3 KB)


Would it be possible to insert different colors at different parameters of the curves? What do you think?

Absolutely that is possible. Here’s another sample (25.8 KB)


That one is great but I think I could not explain myself clearly.

I would like to do something like the picture below.

I want to show these 1 and 2 parameters red and the gradient according to these. I have these dots for all the colors but I don’t know how to arrange the graident for that.

Thanks for the example again! Hope you have a solution for that too!


Hi @stevebaer
How to use list of colors to make gradient from list of lines in this case?
I have 0 knowledge in c# and python code will be helpful.

Line Color (11.3 KB)

Here’s an updated version of your definition
Line Color (30.7 KB)

1 Like

Thank you very much

Line Color Gradient___ (2).gh (18.1 KB)


Another way

curve (10.7 KB)

1 Like

Hi, @stevebaer please, could you fix it to work with trees? That would be really helpful, :pray:t2:!

Line Color (24.7 KB)

Try this with Python

Curve Color (10.7 KB)


Curve Color (15.0 KB)

1 Like