if i add so many parenthesis maybe it'll learn

This commit is contained in:
jane 2021-05-26 12:18:38 -04:00
parent 343df4cba5
commit 2ce9ef22ae

View file

@ -10,12 +10,15 @@ var next_pattern = new Uint32Array(cfg.leds);
var pattern = {}
function rgb_to_int(r, g, b) {
return (((r << 8) + g) << 8) + b;
let rgb = r;
rgb = (rgb << 8) + g;
rgb = (rgb << 8) + b;
return rgb;
}
function int_to_rgb(int) {
var r = int >> 16 & 0xFF;
var g = int >> 8 & 0xFF;
var b = int & 0xFF;
var r = (int >> 16) & 0xFF;
var g = (int >> 8) & 0xFF;
var b = (int) & 0xFF;
return { r: r, g: g, b: b };
}