fix flash algorithm to smoothly transition from bgcolor

This commit is contained in:
Josh Holtrop 2011-07-07 16:29:41 -04:00
parent d00614d2cd
commit 812c342bcb

View File

@ -120,7 +120,7 @@ class Window(object):
delta = datetime.now() - self.flash_start_dt
delta_msec = delta.seconds * 1000 + delta.microseconds / 1000
period = delta_msec / float(self.conf['flash_rate'])
mix = (math.sin(math.pi * 2 * period) + 1.0) / 2.0
mix = (1.0 - math.cos(math.pi * 2 * period)) / 2.0
else:
mix = 0
linear_combination = lambda (x, y): x + (y - x) * mix