Juce c++ using gradients

846 Views Asked by At

I have a septagon divided into smaller triangles and i need to be able to shade each of these with different color gradients, and be able to move the co-ordinate of these gradient points. I could find the Colourgradient class in juce which does this, but it is limited to only 2 co-ordinate points, how can i extend this to fill up triangles in a polygon(each triangle constitutes a separate "path" in juce). so initially, i should have all the triangles shaded with different colours, and i can use the slider values to control the fading of the gradients between these triangles(which will move the gradient co ordinate points).Any suggestions how i can implement these?

1

There are 1 best solutions below

0
On

you can use Path class and use

void fillPath (const Path &path, const AffineTransform &transform= AffineTransform::identity)    

or any other similar method. you have a lead now you can research on this.