Search code examples
javascriptfunctionafter-effects

Wiggle the blue value of the color in loopable expression - After Effects


I have this loopable expression for After Effects:

seedRandom(1,true);
freq = 1.4;
amp = 1;
loopTime = 1;
t = time % loopTime;
wiggle1 = wiggle(freq, amp, 1, 0.5, t);
wiggle2 = wiggle(freq, amp, 1, 0.5, t - loopTime);
linear(t, 0,  loopTime, wiggle1, wiggle2)

This amp = 1 randomizes the color completely (all rgb values). I need to wiggle just the blue value of the color instead. How to do it within this expression?

I know that I could add levels - individual controls effect and wiggle the blue value there, but in my specific case I need the expression for the blue value instead.


Solution

  • seedRandom(1,true);
    freq = 1.4;
    amp = 1;
    loopTime = 10;
    t = time % loopTime;
    wiggle1 = wiggle(freq, amp, 1, 0.5, t);
    wiggle2 = wiggle(freq, amp, 1, 0.5, t - loopTime);
    w = linear(t, 0, loopTime, wiggle1, wiggle2);
    [value[0],value[1],w[2],value[3]];