ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression for color control (not random)

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Major Attila
Expression for color control (not random)
on Feb 10, 2017 at 7:43:48 pm

Hey everyone. I got an expression for color control which is working great, the only issue with it is that is random, I'd like the expression to choose the colors from the colors list but not randomly.

This is the expression I got:

colors = [[225, 255, 0,255]/255,
[0, 246, 255,255]/255,
[0, 17, 255,255]/255,
[255, 0, 152,255]/255,
[152, 0, 255,255]/255,
[0, 255, 85,255]/255,
[255, 195, 0,255]/255];
easeTime = .5;
segDur = 5;

curSeg = Math.floor(time/segDur);
t = time%segDur;
seedRandom(curSeg,true);
idx1 = Math.floor(random(colors.length));
seedRandom(curSeg-1,true);
idx0 = Math.floor(random(colors.length));
ease(t,0,easeTime,colors[idx0],colors[idx1])


Return to posts index

Dan Ebberts
Re: Expression for color control (not random)
on Feb 10, 2017 at 8:01:26 pm

So you want the expression to go through the colors sequentially? That would be like this:


colors = [[225, 255, 0,255]/255,
[0, 246, 255,255]/255,
[0, 17, 255,255]/255,
[255, 0, 152,255]/255,
[152, 0, 255,255]/255,
[0, 255, 85,255]/255,
[255, 195, 0,255]/255];
easeTime = .5;
segDur = 5;

curSeg = Math.floor(time/segDur);
t = time%segDur;
idx0 = curSeg%colors.length;
idx1 = (idx0+1)%colors.length;
ease(t,0,easeTime,colors[idx0],colors[idx1])



Dan



Return to posts index

Major Attila
Re: Expression for color control (not random)
on Feb 10, 2017 at 9:02:41 pm

Thank you very much, that is exactly what I wanted.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]