Forums › Adobe After Effects Expressions › Color Transition between two Colors by Slider Control
Color Transition between two Colors by Slider Control
Sebastian Martinez updated 9 months, 3 weeks ago 2 Members · 4 Posts
Sebastian Martinez
May 12, 2020 at 6:30 pmDear 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,
SebastianSebastian Martinez
CGI-Designer
Cologne, Germany
AE, AI, PS, 3ds max, C4dAndrei Popa
May 12, 2020 at 6:55 pmI 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 pmStupid 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
sebastianSebastian Martinez
CGI-Designer
Cologne, Germany
AE, AI, PS, 3ds max, C4dSebastian Martinez
May 12, 2020 at 7:01 pmAndrei,
yes, the square braketts where too much. I just found it out by myself.
But thank you so much for replying!
Respects
SebastianSebastian Martinez
CGI-Designer
Cologne, Germany
AE, AI, PS, 3ds max, C4d
Log in to reply.