Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Background Opposite color of Text Expression?

  • Background Opposite color of Text Expression?

    Posted by David Goodliffe on June 24, 2020 at 8:51 pm

    I’m certain there’s a way to do this, I’m just not too great with expressions yet–could someone help me with typing up an expression that would allow a Solid Layer’s color always be the complimentary color of another layer (with a “fill” effect on it). I have tons of text layers that I’m precompositing, adding a fill effect to, and changing the color of by keyframing the fill effect over the course of the project. It would save me tons of time if I was able to link another fill effect on a solid layer, or just the solid layer’s base color to always be the complimentary of the Precomposed Text layer’s fill color. Hope this makes sense and thanks.

    Chaz Chester replied 5 years, 10 months ago 3 Members · 2 Replies
  • 2 Replies
  • Richard Garabedain

    June 24, 2020 at 10:14 pm

    well…all you would have to do is make sure the text and the background are the same color..then add an invert effect to either one

  • Chaz Chester

    June 25, 2020 at 1:40 am

    Adding the expression to Color property of your fill effect should do the trick:

    target = thisComp.layer(“Target”); //The layer you want to check (probably use a precomp for this)
    colorpicker = thisComp.layer(“Text”); //The anchor point of this layer determines where it checks
    [1,1,1,1]-(target.sampleImage(target.fromWorld(colorpicker.position), [0.5,0.5], true, time)) //[1,1,1,1] is the RGBA value for white; by subtracting the result, we get the inverse.

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