We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello!
I'm trying to fill arcs drawn using the arc() function with a gradient fill. This seems a little tricky, is there a simple way to do this?
Thanks, Govind.
No.
size(400,400); noStroke(); background(0); for(int i=0;i<90;i++){ fill(map(i,0,90,128,255),255-map(i,0,90,128,255),0); arc(20,20,width,height,i*HALF_PI/90,HALF_PI); }
Great! Thanks for the sample code!
Another way is to draw the gradient on a rectangular shape, then to use arc as a mask shape.
Similar technique shown in http://bazaar.launchpad.net/~philho/+junk/Processing/view/head:/_QuickExperiments/TexturePaint2/TexturePaint2.pde
Answers
No.
Great! Thanks for the sample code!
Another way is to draw the gradient on a rectangular shape, then to use arc as a mask shape.
Similar technique shown in http://bazaar.launchpad.net/~philho/+junk/Processing/view/head:/_QuickExperiments/TexturePaint2/TexturePaint2.pde