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 › Smooth colour changes
Page Index Toggle Pages: 1
Smooth colour changes (Read 510 times)
Smooth colour changes
Oct 24th, 2008, 3:10am
 
Hi!

I have about 20 rectangles, ish, and are all coloured using the fill(r,g,b) command.

I need my rectangles to change colour by smoothly, not an abrupt change.

Can somebody offer any hints or anything to help me out with this?

At a simple level I guess its just +1 to each specific value on each draw() loop but thought there may be a nicer way!

Thanks

Andy
Re: Smooth colour changes
Reply #1 - Oct 24th, 2008, 9:56am
 
There's a function, http://processing.org/reference/lerpColor_.html which will help you get the effect you're looking for. You just need to vary the "amount" value each frame.
Page Index Toggle Pages: 1