Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Need to automatically assign specific colour to text depending on a certain coloured background

  • Need to automatically assign specific colour to text depending on a certain coloured background

    Posted by Chris Huggett on March 26, 2007 at 9:51 am

    Hi Guys

    I am building a promo end page that displays a programs time and date it will be shown accross a number of different timezones. The client wants me to provide a few different coloured backgrounds that refelct the footage that is being shown. For example, a Drama program, will have a specific green BG, a sport will have Blue BG and many others. These BGs have been built and rendered.

    Also on the promo end page, I need to display Text/Info of when the show is on. This needs to be displayed on a white solid square with a right to left gradient /ramp applied to it. The colour of this ramp needs to be a certain colour (the other colour/end point of the gradient will be white) which complements the chosen BG. Furthermore, the Heading of the EndPage (TONIGHT/TOMORROW/MONDAY/TUESDAY etc) needs to be the same colour as the gradient chosen.

    Is there an expression that can say, that if BG1 is chosen/on/visible, then the colour of the text and gradient will be this specific colour, if BG2 is chosen then it will be another colour.

    Thanks guys for any help

    Chris

    Chris Huggett replied 19 years, 1 month ago 3 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    March 26, 2007 at 1:31 pm

    You could apply a Fill Color animator to your text and then apply an expression like this to the Fill Color property:

    color1 = [0, 0, 0.7, 1];
    color2 = [.8, 0, 0, 1];

    if (thisComp.layer(“BG1”).enabled){
    color1;
    }else if (thisComp.layer(“BG2”).enabled){
    color2;
    }else{
    value;
    }

    Add enough colors and “else if” clauses to handle all your background layers. Note that rgba color values range from 0 to 1 so white is [1, 1, 1, 1} and black is [0, 0, 0, 1], etc.

    Dan

  • Filip Vandueren

    March 26, 2007 at 2:26 pm

    Because all those layers/gradients etc. need the same colors, I would create a color-expression control on a Null, Add Dan’s script to that color-control,
    then pick-whip to that color wherever it’s needed.

    That way if your colourscheme changes, there’s only one expression to change.

    You could also make several colourcontrols and then use an expression to choose between them, that way you’ll have a visual representation of the possible colours in your interface, and you can edit the colour with a colourpicker instead of the 0-1 arrays.

    BTW: no need to add a Fill-effect to a text to change it’s colour.
    Twirl open your text layer and choose animate->Fill Color->RGB.
    You can delete the automatically created Range for this animator, since it will be applied to all characters.
    Add your expressions to the colourproperty in that animator.

  • Chris Huggett

    March 26, 2007 at 4:39 pm

    Thanks guys for this…am giving it a go right now and will report back.

    you guys rock
    c.

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