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 & HelpPrograms › Needing a little help
Page Index Toggle Pages: 1
Needing a little help (Read 684 times)
Needing a little help
Oct 3rd, 2006, 7:32pm
 
Im trying to make a simple circle fade from black to white and the background from white to black, in a 4 secound waiting period. im new and cant find figure out how i would do that?
Re: Needing a little help
Reply #1 - Oct 4th, 2006, 11:00pm
 
You need a variable that changes the colours. Something like that:

(in void draw)
fill(i);
rect(...);//a rectangle behind the ellipse, as the background itself is static
fill(255-i);
ellipse(...);
i++;

4 seconds:
frameRate() controls the number of frames per second. As you need 255 steps, frameRate should be 255/4 = 64.
Page Index Toggle Pages: 1