Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions fill color depends on slider control

  • fill color depends on slider control

    Posted by Aqeel Arruhaili on August 15, 2012 at 2:39 pm

    Is there a way i can link a slider control values of 0,1 or 2 to a specific fill color effect of a solid layer.if the value equals 0 the color will be grey ,if it is 1 the color is green and anything else is red..How can i do that ?

    Aqeel Arruhaili replied 13 years, 11 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    August 15, 2012 at 5:38 pm

    This should work:


    slider = Math.floor(effect("Slider Control")("Slider").value);
    if (slider == 0)
    [.5,.5,.5,1] // medium grey
    else if (slider == 1)
    [0,1,0,1] // green
    else
    [1,0,0,1] // red

    The RGBA values are represented by an array of four values between 0 and 1.

    Dan

  • Aqeel Arruhaili

    August 15, 2012 at 8:39 pm

    Thank you so much.

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