Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Color Transition between two Colors by Slider Control

  • Color Transition between two Colors by Slider Control

  • Sebastian Martinez

    May 12, 2020 at 6:30 pm

    Dear Expression heroes,

    my fourth question within a few day – expression rocks:

    I want to change the fill of a Shape Layer by a Slider value from 0 to 100.

    The Slider Effect is on a Null objekt. But also two Color Control effects, one for the Sliders value at 0, the other for the value at 100.

    When animating the Slider between 0 and 100 the color change is supposed to be smooth.

    I gave it a try but there was error only:

    Col=thisComp.layer("Null 42").effect("Slider Control")("Slider");
    color1=[thisComp.layer("Null 42").effect("Color 1")("Color")];
    color2=[thisComp.layer("Null 42").effect("Color 2")("Color")];
    linear (Col,0,100,color1,color2)

    Whats wrong?

    Thank you so much in advance,
    Sebastian

    Sebastian Martinez
    CGI-Designer
    Cologne, Germany
    AE, AI, PS, 3ds max, C4d

  • Andrei Popa

    May 12, 2020 at 6:55 pm

    I guess your only mistakes are the square brackets. You don’t need those, since the link to the color returns an array.

    Col=thisComp.layer("Null 42").effect("Slider Control")("Slider");
    color1=thisComp.layer("Null 42").effect("Color 1")("Color");
    color2=thisComp.layer("Null 42").effect("Color 2")("Color");
    linear (Col,0,100,color1,color2)

    Andrei
    My Envato portfolio.

  • Sebastian Martinez

    May 12, 2020 at 6:59 pm

    Stupid me. Too much braketts. This works now:

    Col=thisComp.layer("Null 42").effect("Slider Control")("Slider");
    color1=thisComp.layer("Null 42").effect("Color Control")("Color");
    color2=thisComp.layer("Null 42").effect("Color Control 2")("Color");

    linear (Col,0,100,color1,color2)

    Anyhow, Thanks to all of you for helping out in this forum, especially Dan!

    Take care
    sebastian

    Sebastian Martinez
    CGI-Designer
    Cologne, Germany
    AE, AI, PS, 3ds max, C4d

  • Sebastian Martinez

    May 12, 2020 at 7:01 pm

    Andrei,

    yes, the square braketts where too much. I just found it out by myself.

    But thank you so much for replying!

    Respects
    Sebastian

    Sebastian Martinez
    CGI-Designer
    Cologne, Germany
    AE, AI, PS, 3ds max, C4d

Viewing 1 - 4 of 4 posts

Log in to reply.

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