ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

# wiggle color between two keyframes

FAQ   •   VIEW ALL
 wiggle color between two keyframes on Mar 7, 2018 at 6:10:29 pm

Hi all,

I'm trying to get a solid to wiggle between two color values and I'm using dan ebberts expression for frequency found on motionscript.com, not even knowing if this is the right approach. I'm getting a bad argument at line 16: argument 5 to wiggle must be scalar.

A) is this even the right approach

B) if not, how do I do it.

```freq = effect("Color Control")("Color"); amp = 10; n = freq.numKeys; if (n > 0 && freq.key(1).time &lt; time){ accum = freq.key(1).value*(freq.key(1).time - inPoint); for (i = 2; i &lt;= n; i++){ if (freq.key(i).time > time) break; k1 = freq.key(i-1); k2 = freq.key(i); accum += (k1.value + k2.value)*(k2.time - k1.time)/2; } accum += (freq.value + freq.key(i-1).value)*(time - freq.key(i-1).time)/2; }else{ accum = freq.value*(time - inPoint); } wiggle(1,amp,1,.5,accum) ```

 Re: wiggle color between two keyframeson Mar 7, 2018 at 6:34:52 pm

A) I don't think so.

B) What are you trying to do exactly?

Dan

 Re: wiggle color between two keyframeson Mar 7, 2018 at 6:38:27 pm

I have two different color values, and I'd like to start at one, wiggle between the two for x amount of frames, and then return smoothly to the original color.

 Re: wiggle color between two keyframeson Mar 7, 2018 at 7:06:30 pm

If your two colors are keyframed, play around with this:

color1 = key(1).value;
color2 = key(2).value;
rampTime = .25;
w = rotation.wiggle(3,1) - rotation;
c = linear(w,-1,1,color1,color2);
linear(time,key(2).time-rampTime,key(2).time,c,key(1).value);

Dan