FS#5856 - Demystify Color

Attached to Project: Rockbox
Opened by Travis Hyyppa (Travis) - Saturday, 19 August 2006, 10:22 GMT
Last edited by Nicolas Pennequin (nicolas_p) - Wednesday, 04 October 2006, 11:42 GMT
Task Type Patches
Category Plugins
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Demystify with random fading colors.

(File wont patch for some reason so here is the source)
This task depends upon

Closed by  Jens Arnold (amiconn)
Monday, 30 October 2006, 01:32 GMT
Reason for closing:  Accepted
Additional comments about closing:  Adapted and committed to CVS.
Comment by Mikael Magnusson (mikaelh) - Sunday, 20 August 2006, 09:19 GMT
instead of
you can use
Comment by Travis Hyyppa (Travis) - Sunday, 20 August 2006, 10:21 GMT
Yes, but that would give the effect of random "flashing" colors, wouldn't it?

I set three "target color" variables (for red, green, and blue), and three "current color" variables. The current color in/decreases by one for each variable until the target color is reached for red, green, and blue. Once the target color is reached a new target color is generated with rb->rand()%255 for each variable and the process starts over. This gives the effect of "fading" colors.

Unless i'm not understanding you fully.. I'm fairly new with C :)
Comment by Nicolas Pennequin (nicolas_p) - Tuesday, 29 August 2006, 00:17 GMT
It works quite nicely :)
Here is a patch file.
Comment by Nicolas Pennequin (nicolas_p) - Tuesday, 29 August 2006, 00:35 GMT
sorry... cleaned it up a bit.
Comment by Travis Hyyppa (Travis) - Tuesday, 29 August 2006, 01:13 GMT
Thanks! No need to be sorry, if theres a better way to do it go for it. :)