Creating gradient contours

contour
layermanager
grasshopper
color
layers

(Michaelrdicarlo) #1

Hello All,

I’m drawing a huge blank on something I’ve done before, hoping someone can help me with what I feel is actually pretty simple.

What I’m trying to streamline is a process that will contour an object but perform a gradient across the contour lines… so for example the lowest lines might be white then fade to black at the highest contour. or white through shades of blue to black, or some other variation of gradients across the color spectrum.

Simultaneously I’d like to create a new layer with the corresponding color that would be populated with each contour level…

What I’ve just done is built a def that creates as many layers as contours, what I’d like to do is find a way to easily dispatch each contour level to the desired layer and to control the layer’s colors in a gradient fashion. And at the same time do custom color preview that draws what the colors/ contours will look like after baking.

I hope this is clear,
thanks for any direction/ help you can give me.


(Laurent Delrieu) #2

Hello, one little hint, as RGB color is a coordinate you can draw curves between {0 to 1} or {0 to 255} and interpolate these values to get color.


color.gh (11.8 KB)


(Tim Stark) #3

Have a look at this. You don’t need to name the layer like the color. C#'s aren’t by me.

Colorgradient createlayer bake.gh (12.1 KB)


(Michaelrdicarlo) #4

Thanks!!


(Michaelrdicarlo) #5

Oh My!
YASSS.

At a glance this looks pretty spot on.
Thanks so much.