Colour gradient definition - bug fixing

Hi there,

Wanted to create my own gradient creation tool as I find the gradient component a bit clunky, and this is what I came up with.

Instead of the Gradient component interface, I manually input the colours that I want to use, and then assign it to a given surface.

  1. As you can see on the right, the gradient is repeated twice, which isn’t the end of the world but I’d like to know how to fix that. I presume it has something to do with the range, but I can’t figure out how to fix this. Tried changing the V input value, but this doesn’t solve the problem (>1 gives more divisions, and <1 doesn’t work)

  2. This definition is limited to creating gradients for input curves that are rectilinear, and with no more than 4 sides. How would one modify this definition to be able to accept more complex shapes (i.e. more than 4 sides, or organic)? One technique I tried was to create a bounding box around it, apply the gradient to that instead, but then I couldn’t figure out how to trim the gradient fill outside of the input shape area . Any ideas?

  3. Is there a way to be able to rotate the direction of the gradient?

To give you an idea of what I’m working towards, an artwork by Amber Vittoria. Seen here: different shapes each with different coloured gradients, and the direction of the gradients vary.

gradient query.gh (13.2 KB)

Hi @dancon88 ,

I’ve been using this version that Anders created, you can input your color swatches and it creates an interpolated gradient from the color inputs:

Perhaps it may help you?

2 Likes

Here’s an example using Pufferfish plugin…


gradient query_re.gh (21.6 KB)