Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Transitional colors

  • Transitional colors

    Posted by rica maru on June 28, 2021 at 12:31 pm

    I’m setting a way to animate some colors changes, like I have my main colors on my main layer so I can define them and then I set a linear expression so I can make color 1 change to color 2 in a gradient fashion.

    Color1 = comp(“main”).layer(“Color_crtl”).effect(“Color Control_06”)(“Color”)

    Color2 = comp(“main”).layer(“Color_crtl”).effect(“Color Control_02”)(“Color”)

    linear(effect(“Slider Control”)(“Slider”),0,100,Color1,Color2)

    But would be possible to be able to change for multiple colors? Like is there a way to setup the slider so the value 01 goes to color 01, value 10 goes to color 05, value 20 goes to color 03…

    I saw some stuff from @andrei popa, but in his resolution the colors just swap, I’d like them to be animated.

    rica maru replied 5 years, 2 months ago 2 Members · 4 Replies
  • 4 Replies
  • Andrei Popa

    June 28, 2021 at 1:56 pm

    Try this:

    c1=thisComp.layer("Color Control").effect("Color Control")("Color");

    c2=thisComp.layer("Color Control").effect("Color Control 2")("Color");

    c3=thisComp.layer("Color Control").effect("Color Control 3")("Color");

    c4=thisComp.layer("Color Control").effect("Color Control 4")("Color");

    slider = thisComp.layer("Color Control").effect("Slider Control")("Slider").value;

    myColors = [c1,c2,c3,c4];

    vals = [0,10,20,30];

    i = 0;

    while(i<vals.length-1 && vals[i]<= slider){

    i++}

    linear(slider,vals[i-1],vals[i],myColors[i-1],myColors[i])

  • rica maru

    June 28, 2021 at 2:10 pm

    Now that’s something special. Thank you very much!

    I want to get better at expressions, is there a course/tutorial series that you could point me at?

  • Andrei Popa

    June 28, 2021 at 3:01 pm

    Sergei Prokhnevskiy from Ukramedia has some really nice tutorials on Youtube. If you like those, you may consider buying his course on expressions.

  • rica maru

    June 28, 2021 at 5:05 pm

    Cool tks, I’ll take a look at that.

    Cheers

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy