Multiple gradients in a polygon


#1


I have a solid filled rectangle. Each vertex of the rectangle represents a point source, and i need radial gradient at each vertex, with different color for each vertex.
How can i achieve this using setgradientfill funciton? gradientfill allows to use only 2 colors in a shape. How can i achieve multiple color gradients in the rectangle. The radius of each of these gradients is controlled by the value of  the slider. If i cannot use the standard gradient functions, do i need to use the opengl library? Can i use the opengl compoenent in my juce component's paint routine?

I also need to divide a septagon into smaller triangles(each filled with different colors) and control the mixing of these colors between each triangle depending on another slider's value. How can i do this in juce?I am attaching an image of a circle with similar concept, but i need the gradient stops to be dependent on slider value, i.e higher the slider value, more the mixing and lower the value of slider the triangle colors gets more solid.

Any suggestions for these two implementations?