Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions if else statement

  • Posted by Peter Jacobson on August 14, 2011 at 8:03 pm

    I’m trying to switch between fill colors starting with an expression I found here. I added an if/else statement and wanted to include a logical or. What did I miswrite here?

    color1 = [255];
    color2 = [200,0,0];
    r = transform.rotation;
    if ((r < 100) || (r > 400)){
    r = color1;

    }else{
    r = color2

    Peter Jacobson replied 14 years, 8 months ago 3 Members · 4 Replies
  • 4 Replies
  • Ben G unguren

    August 14, 2011 at 9:41 pm

    The &lt; is supposed to be a less-than sign (“<“), see if that fixes things

  • Peter Jacobson

    August 14, 2011 at 10:01 pm

    sorry about that.. <. No, that doesn’t fix it

  • Dan Ebberts

    August 15, 2011 at 12:15 am

    Your RGBA color channels need to be between zero and one, so white would be [1,1,1,1] medium gray would be [.5,.5,.5,1], etc.

    Dan

  • Peter Jacobson

    August 15, 2011 at 1:28 am

    Dan. Thanks, works like a charm

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