get rgb from parse

This commit is contained in:
jane 2021-05-26 19:52:23 -04:00
parent 9c981b200c
commit b4b14c6c08

View file

@ -41,6 +41,8 @@ let functions = {
random: (index, args, prev) => { return Math.floor(Math.random() * 256) },
constant: (index, args, prev) => { return args; },
modulo: (index, args, prev) => { return prev % args; }
move: (index, args, prev) => { targets[args] = prev; return prev; }
swap: (index, args, prev) => { let temp = targets[args]; targets[args] = prev; return temp; }
}
function tick_pattern() {
@ -58,12 +60,14 @@ function tick_pattern() {
if (!targets[channel]) {
targets[channel] = 0;
}
log.debug("targets " + channel + " " + target.arg);
targets[channel] =
functions[instruction.name.toLowerCase()](i, target.arg, targets[channel]);
}
}
}
}
next_pattern[i] = rgb_to_int(targets.r || 0, targets.g || 0, targets.b || 0);
}
}
else {