mirror of
https://github.com/brmlab/ledbar.git
synced 2025-06-09 13:24:01 +02:00
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:
parent
e766987e35
commit
d442d0855b
1 changed files with 4 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue