equalizer.py: In non-slow mode, spread values more in the [0,1] interval to account for low dynamic range of ledbar pixels

This commit is contained in:
Petr Baudis 2012-08-19 23:49:33 +02:00
parent e766987e35
commit d442d0855b

View file

@ -74,7 +74,10 @@ stream = p.open(format = FORMAT,
def get_color(volume):
p = 1-15/(volume)
if p <= 0: return (0, 0, 0)
p *= p
if SLOW == 1:
p *= p
else:
p *= p * p
if p <= 0.4: return (0, 0, p*2.5)
elif p <= 0.7: return (0, (p-0.4)*3.33, 1.0-(p-0.4)*3.33)
elif p <= 0.9: return ((p-0.7)*5.0, 1.0-(p-0.7)*5.0, 0.0)