Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Fill color expression linked to Offset value

  • Fill color expression linked to Offset value

    Posted by Mike Browning on May 22, 2007 at 3:00 pm

    Howdy… here’s the problem:

    I want to create an expression so that when a character is offset (a value currently controlled by another expression), that character changes hues.

    I’ve come so far as to have the RGB fill color property pickwhipped to the offset value, but that only produces different shades of black, no matter what the RGB value is set to (in my case, a light blue).

    How would I set this expression to specify the hue so that, for example, the character would turn a different shade of blue depending on character offset value? Follow me?

    Mike Browning
    U.S. Customs and Border Protection
    Field Ops Academy

    Mike Browning replied 18 years, 11 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    May 22, 2007 at 3:28 pm

    It’s hard to tell from your description, but the thing that trips most people up with color in expressions is that the values for each color channel need to be between zero and 1.0.

    It’s probably going to look something like this:

    offset = ??? // your offset value here
    maxOffset = ??? // offset where blue is maximum
    minBlue = 0.5;
    maxBlue = 1.0;

    blue = linear(offset,0,maxOffset,minBlue,maxBlue);
    red = value[0];
    green = value[1];
    [red,green,blue,1]

    Dan

  • Mike Browning

    May 22, 2007 at 5:14 pm

    Thanks, Dan.

    I now have my color values.

    Now, I’m a bit of an expressions idiot (I went ahead and said it so you don’t have to!)… how do I get this value to show up on the text? I originally had the fill color pickwhipped to the offset value, and simply enough that did the trick (except it was all a shade of black). Thanks in advance.

    Mike Browning

  • Dan Ebberts

    May 22, 2007 at 5:36 pm

    The exact expression depends on how you want it to respond, but here’s an example. You would add a slider control to the text layer and apply this expression to the fill color:

    offset = effect(“Slider Control”)(“Slider”); // your offset value here
    maxOffset = 100; // offset where blue is maximum
    minBlue = 0;
    maxBlue = 1.0;

    blue = linear(offset,0,maxOffset,minBlue,maxBlue);
    red = value[0];
    green = value[1];
    [red,green,blue,1]

    Adjusting the slider from 0 to 100 will cause the blue component of the fill color to go from 0 (no blue) to 1.0 (max blue).

    Dan

  • Mike Browning

    May 22, 2007 at 6:29 pm

    thanks again

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