We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Getting current stroke/fill color
Page Index Toggle Pages: 1
Getting current stroke/fill color (Read 789 times)
Getting current stroke/fill color
Jan 25th, 2009, 10:16pm
 
I've seen a couple of posts from years ago talking about how to get the current stroke/fill color, and thought that by downloading the beta I'd be able to use stroke() (no parameters) to retrieve the current stroke color.  But it doesn't seem to work.

What's the official word on this nowadays?
Re: Getting current stroke/fill color
Reply #1 - Jan 25th, 2009, 10:37pm
 
I think you can use the variables (read-only) fillColor and strokeColor for that.
Re: Getting current stroke/fill color
Reply #2 - Jan 25th, 2009, 11:17pm
 
Nope, they're not recognized.
Re: Getting current stroke/fill color
Reply #3 - Jan 25th, 2009, 11:59pm
 
Sorry, that's g.strokeColor and g.fillColor. Forgot I saw them in PGraphics.
Page Index Toggle Pages: 1