Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › How can I apply this expression to an image?

  • How can I apply this expression to an image?

    Posted by Joshua Bowman on December 28, 2018 at 3:16 am

    So I want to use this expression and add it to an image like shown in this video.https://www.youtube.com/watch?v=5N7ylsi1v8M How would I go by doing that, or does this not need an expression but something else? If it is an Expression, what do I apply it too?

    hues = [0,30,60,120,180,240,300];
    freq = .5; //changes per second
    tran = .25; //seconds
    idx1 = Math.floor(time*freq)%hues.length; //current hue index
    idx2 = (idx1+1)%hues.length; //next hue index
    state = linear(time%(1/freq),0,tran,0,100); //transition state (0-100)
    hue = (hues[idx2]*state+hues[idx1]*(100-state))/100; // resulting hue
    hslToRgb([hue/360,.85,.4,1])

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

    Joshua Bowman replied 7 years, 8 months ago 2 Members · 4 Replies
  • 4 Replies
  • Kalleheikki Kannisto

    December 28, 2018 at 7:05 am

    You need to apply it to something that has a color value in it, such as the tint effect color.

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Joshua Bowman

    December 29, 2018 at 3:15 am

    Im new to AE, how would I go by doing that?

    Noob out!

  • Kalleheikki Kannisto

    December 29, 2018 at 8:52 am

    To apply an expression, you alt-click the stop watch of the property, in this case it would be the color swatch in some effect that has it. Taking the example of the Tint effect, apply the tint effect to your layer, expand the controls so that you can see the color swatch and apply the expression to it.
    The Tint effect isn’t really going to do what you want. The Change To Color effect is closer to what you want, applying the expression to the To color swatch. You’ll need to make the From color match the original color of your layer.

    NB. If the layer is multicolored, this won’t work too well. In that case you’re back to the Tint, but you will need to apply it to a copy of the layer on top of the original layer and set the blending mode of the top layer to Hue.

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Joshua Bowman

    December 29, 2018 at 2:35 pm

    cool thanks

    Noob out!

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