Activity › Forums › Adobe After Effects Expressions › Control color value of Individual hold keyframes.
-
Control color value of Individual hold keyframes.
Posted by Chris Jung on December 6, 2017 at 7:32 pmHi,
I was wondering if there was a way to control the color value of individual keyframes.

I want to be able to control the first and last hold keyframes without changing the color value of the middle keyframe.Please let me know!
Thanks.Chris Jung replied 7 years ago 2 Members · 8 Replies -
8 Replies
-
Dan Ebberts
December 7, 2017 at 12:20 amSomething like this maybe:
c1 = effect("Color Control")("Color");
c3 = effect("Color Control 2")("Color");
if (time < key(2).time)
c1
else if (time < key(3).time)
value
else
c3
Dan
-
Chris Jung
July 26, 2019 at 6:08 pm -
Dan Ebberts
July 26, 2019 at 6:26 pmSomething like this:
c1 = effect(“Color Control”)(“Color”);
c2 = key(2).value;
t1 = key(1).time;
t2 = key(2).time;
linear(time,t1,t2,c1,c2) -
Chris Jung
July 26, 2019 at 6:27 pmThis seemed to work, but jumps back to the first color after it hits the 2nd keyframe, any solutions? or simplified code?
if (numKeys<1){
value;
}
else{
idx1 = nearestKey(time).index;
if (key(idx1).time>time) idx1--;
idx2 = idx1+1;
if (idx1<1) idx1=1 else if (numKeys<idx2) idx2=numKeys;
val1 = thisComp.layer("COLOR").effect("color")("Color");
val2 = thisComp.layer("COLOR").effect("color 2")("Color");linear(time, key(idx1).time, key(idx2).time, val1, val2);
}; -
Chris Jung
August 20, 2019 at 3:49 pmSorry Dan.
Your original response worked out for me. I think we simultaneously posted responses and it overlapped.
Really appreciate your quick responses.
Best,
Chris
Reply to this Discussion! Login or Sign Up
