How to set color of ofPath's arc? Also: can it be left open?

The code below draws a 3/4 circle, filled, white, despite the ofSetColor statement.
I tried moving the ofSetColor down, but no joy.
How do I set the arc’s colour?

ofPath abc;
abc.arc( 0, 0, radius-50, radius-50, 0, 270);

Second question: the documentation shows a parameter to close the line, but it does not say how to leave it open. And, anyway, it seems the default is closed.
Can it be left open, and if so, how? (Just omitting “close()” does not do it.)
for( int i = 0; i < 5; i++) {
path.arc( i * 50 + 20, i * 50 + 20, i * 40 + 10, i * 40 + 10, 0, 360); // creates a new ofSubPath

(Mac OS X 10.9, of_v0.8.4_osx_release, Xcode 6.1.1)

Thanks in advance for your assistance

Hi there!

You can use setFillColor() and setStrokeColor() to set colors, and setFilled() to toggle fill. (Mind that the appearance of the stroke, depends on your GPU).

The close() function depends on setStrokeColor() and setPolyWindingMode(). You can enable stroke and then switch between the different winding modes to understand the behavior.

1 Like

Thanks for the reply.

Would you be kind enough to provide examples of setFillColor and setStrokeColor? The documentation isn’t very clear - and when I am sayin I am a beginner, I kid you not … (I did search, but found nothing useful.)

void ofPath::setFillColor(const ofColor &color)
This sets the fill color of the path. This has no affect if the path is drawn as wireframe.

void ofPath::setStrokeColor(const ofColor &color)
This sets the stroke color of the path. This has no affect if the path is drawn filled

Sure! I have this example, which I did a long time ago, also to show it to someone… Just create a new project with ofxGui and replace the files. :wink:

Thanks a lot! This little fun gadget will keep me busy for hours, trying to figure what/how it does… :wink:

I really appreciate it!