-
expression for color control – frame hold – slider number?
I’m using a great expression from created by Filip Vandueren
to create a random fill effect via color control expressions.Currently the colors change every frame, what I would like to have a is a slider that determines how many frames the colors hold. 1 would be like it currently is (updating every frame), 2 it would hold for 2 frames, etc…
Not exactly sure how to go about this,
Here is the expression I’m using for the random fill:
l=thisComp.layer(“Colors”);
i=1;
colors=[];
try {
while(l.effect(i)) {
if (l.effect(i)(1).name==”Color”) {
colors.push(l.effect(i)(1).value);
}
i++;
}
} catch (e) {}
if (colors.length) {
r=Math.floor(random(colors.length));
colors[r];
} else {
value;
}Thanks for the help