Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#5856 - Demystify Color

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

Details

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, 02:32 GMT+2
Reason for closing:  Accepted
Additional comments about closing:  Adapted and committed to CVS.
Comment by Mikael Magnusson (mikaelh) - Sunday, 20 August 2006, 11:19 GMT+2
instead of
LCD_RGBPACK(rb->rand()%255,rb->rand()%255,rb->rand()%255)
you can use
rb->rand()%LCD_RGBPACK(255,255,255)
Comment by Travis Hyyppa (Travis) - Sunday, 20 August 2006, 12:21 GMT+2
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, 02:17 GMT+2
It works quite nicely :)
Here is a patch file.
Comment by Nicolas Pennequin (nicolas_p) - Tuesday, 29 August 2006, 02:35 GMT+2
sorry... cleaned it up a bit.
(application/octet-stream)    demistify_color.patch (2 KiB)
 apps/plugins/demystify.c |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

Comment by Travis Hyyppa (Travis) - Tuesday, 29 August 2006, 03:13 GMT+2
Thanks! No need to be sorry, if theres a better way to do it go for it. :)

Loading...