diff --git a/lights.js b/lights.js index d8f888e..5336025 100644 --- a/lights.js +++ b/lights.js @@ -35,10 +35,10 @@ function tick_pattern() { console.log("TICKING PATTERN") for (let i = 0; i < cfg.leds; i++) { - var r = Math.floor(Math.random() * 100) - var g = Math.floor(Math.random() * 100); - var b = Math.floor(Math.random() * 100); - next_pattern[i] = ((r << 8) + g) << 8 + b; + var r = Math.floor(Math.random() * 256) + var g = Math.floor(Math.random() * 256); + var b = Math.floor(Math.random() * 256); + next_pattern[i] = rgb_to_int(r, g, b); } }