Controlling color based on a random, cycling value
Posted: August 18th, 2007, 6:18 pm
Ok, here's the effect I'm trying to achieve:
A set of numbers that fluctuates randomly, changing color depending on the number going up or down (green and red, respectively).
I started by creating a text layer with the source text pik-whipped to the X value of a null. I put a wiggle on the null with a low frequency to give the number a 'soft' fluctuation. It rises and falls just fine.
What I want to do now is change to color of the text layer green when the number is rising and red when it's falling (no grad between. It can be a binary switch).
I thought maybe I could get an expression to read the value of X (on the normal) on the last frame and compare it to the current frame, then color based on an If-then statement. But I can't figure out how to do that.
valueAtTime(time-1) didnt work. I know I'm not doing it right.
Any help would be greatly appreciated. Thanks!
-Daniel
A set of numbers that fluctuates randomly, changing color depending on the number going up or down (green and red, respectively).
I started by creating a text layer with the source text pik-whipped to the X value of a null. I put a wiggle on the null with a low frequency to give the number a 'soft' fluctuation. It rises and falls just fine.
What I want to do now is change to color of the text layer green when the number is rising and red when it's falling (no grad between. It can be a binary switch).
I thought maybe I could get an expression to read the value of X (on the normal) on the last frame and compare it to the current frame, then color based on an If-then statement. But I can't figure out how to do that.
valueAtTime(time-1) didnt work. I know I'm not doing it right.
Any help would be greatly appreciated. Thanks!
-Daniel