changeset 1667:6fefdc0c2c69

more rgb_to_hex fixes Ignore-this: fe3710525964a1a74a8b38267e8ed668
author drewp@bigasterisk.com
date Sun, 11 Jun 2017 02:56:34 +0000
parents c2af36d6fa6b
children add38c04f815
files light9/effect/effecteval.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/light9/effect/effecteval.py	Sun Jun 11 02:53:47 2017 +0000
+++ b/light9/effect/effecteval.py	Sun Jun 11 02:56:34 2017 +0000
@@ -15,7 +15,7 @@
 log = logging.getLogger('effecteval')
 
 def literalColor(rnorm, gnorm, bnorm):
-    return Literal(rgb_to_hex([rnorm * 255, gnorm * 255, bnorm * 255]))
+    return Literal(rgb_to_hex([int(rnorm * 255), int(gnorm * 255), int(bnorm * 255)]))
 
 def literalColorHsv(h, s, v):
     return literalColor(*hsv_to_rgb(h, s, v))
@@ -296,7 +296,7 @@
     offset = 0
     f = (((songTime + offset) * rate) % 1.0)
     c = (f < duty) * strength
-    col = rgb_to_hex([c * 255, c * 255, c * 255])
+    col = rgb_to_hex([int(c * 255), int(c * 255), int(c * 255)])
     return {(L9['device/colorStrip'], L9['color']): Literal(col)}
 
 def effect_lightning(effectSettings, strength, songTime, noteTime):
@@ -310,7 +310,7 @@
             L9['device/hexLow5'], L9['device/lip1 5'],
             L9['device/postL1'], L9['device/postR1']]
     out = {}
-    col = rgb_to_hex([255 * strength] * 3)
+    col = rgb_to_hex([int(255 * strength)] * 3)
     for i, dev in enumerate(devs):
         n = noise(songTime * 8 + i * 6.543)
         if n > .4: