We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi, I am trying to create an annulus sector and be able to control the interior fill color. I created the shape as Pshape using arcs and lines, and then try to fill the color in the draw() routine. The annulus sector displays, but the setFill() did not change the color.
Is there a way to make this work ?
Thanks.
(Formatted code below)
Answers
did you try using setfill on arc1 after line 20 ?
@Chrisir ... I did not try that ... I can give that a try but am not optimistic that they will do the trick, because I think that will fill in the area within the arc but not within the annulus sector.
In the meantime, I was reading more of the documentation. I think the problem above is that I created the Pshape with arc() and not within vertex() function.
So, I re-did the code using vertex() to construct the Pshape, and it works as intended now !!
See below code for updates.
I do not know if this is an efficient way to create annulus sectors; I am open to suggestion if anyone has a better way.
Thanks.
you can set colors in setup() as I first suggested
but noFill(); is NOT allowed before doing so (dunno why)