change color according to value
Hey.
I want to make an expression for a randomly changing number, (so far so good), but each time it will change a value, I want it to change color relatively to the previous value it had. MEANING... if it will goes up, then it will change to blue and if down then to orange (for example).
one more thing. I want it to change value every few seconds and do it with a "hold interpolation" so it will jump to the next value instead of working it's way toward it...
now.. so far I got this: (for the first part anyway)
-----------------------------------------------------------------------------------------------------------------------------
upColor = thisComp.layer("Ctrl").effect("Up Color")("Color");
downColor = thisComp.layer("Ctrl").effect("Down Color")("Color");
value = thisComp.layer("Ctrl").effect("Slider Control")("Slider");
prevframe = thisComp.layer("Ctrl").effect("Slider Control")("Slider").valueAtTime(time - thisComp.frameDuration);
if(prevframe.valueAtTime < ((time * 25) % 2 == 0).valueAtTime))downColor else upColor;
value;
-----------------------------------------------------------------------------------------------------------------------------
any ideas?
thanks!
Ido.
