get rgb from parse
This commit is contained in:
parent
9c981b200c
commit
b4b14c6c08
1 changed files with 4 additions and 0 deletions
|
@ -41,6 +41,8 @@ let functions = {
|
||||||
random: (index, args, prev) => { return Math.floor(Math.random() * 256) },
|
random: (index, args, prev) => { return Math.floor(Math.random() * 256) },
|
||||||
constant: (index, args, prev) => { return args; },
|
constant: (index, args, prev) => { return args; },
|
||||||
modulo: (index, args, prev) => { return prev % 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() {
|
function tick_pattern() {
|
||||||
|
@ -58,12 +60,14 @@ function tick_pattern() {
|
||||||
if (!targets[channel]) {
|
if (!targets[channel]) {
|
||||||
targets[channel] = 0;
|
targets[channel] = 0;
|
||||||
}
|
}
|
||||||
|
log.debug("targets " + channel + " " + target.arg);
|
||||||
targets[channel] =
|
targets[channel] =
|
||||||
functions[instruction.name.toLowerCase()](i, 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 {
|
else {
|
||||||
|
|
Loading…
Reference in a new issue