-
Smooth Change Color linked to a slider
Hi everyone!
This is my little problem:I need to create some bars go up&down with different colors applied within this range:
0-30% red
30-70% yellow
70-100% greenAll of that must be linked to a slider. So, there aren’t any problems if the color change on the limit, in a pop way I mean,
because I wrote something like this on the stroke property:r= thisComp.layer(“100%”).effect(“Control Number”)(“Slider”);
if (r<=30){[255,0,0,1]};
if(r>30 && r<70){[255,234,0,1]};
if(r>70){[0,0,255,1]};But I really need to create smooth transition from one color to the other one.
I tried different ways…but nothing works!The last script I wrote is this one:
Col=thisComp.layer(“100%”).effect(“Control Number”)(“Slider”);
red=[255,0,0,1];
yellow=[255,234,0,1];
green=[0,255,0,1];if(Col<30){red};
if(Col>30 && Col<70){yellow};
if(Col>70){green};linear(Col,0,100,red,green)
And the color returns always yellow.
I found some other topic similar to this one but it was around hex numbers, so I had some problems to convert that model into the one I need…Hope to get back some useful tips!!!
Thank you so much!Massimo
