Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › change color to a specific value as a function of a noise layer

  • change color to a specific value as a function of a noise layer

    Posted by Fabi Reck on January 23, 2020 at 2:17 pm

    Hello,

    i have several layers whose opacity is controlled by a composition with a noise effect.
    I would like to change the color of the layers to three fixed values (EB3838, E8E348, 0EA4E3), also depending on a composition with a noise effect in it. For example, if the noise effect has a lightness value of 0-84 this corresponds to the color EB3838, 85-170 corresponds to E8E348 and 171-255 corresponds to 0EA4E3.

    Thanks for your help.

    Fabi Reck replied 6 years, 8 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    January 24, 2020 at 1:28 am

    What does the expression that’s controlling the opacity look like?

    Dan

  • Fabi Reck

    January 24, 2020 at 9:13 am

    Hallo Dan,

    here is the expression for the opacity of the layers.

    sampleSize = [10,10];
    target = thisComp.layer("noise Comp");
    samplePos = transform.position;
    rgb = target.sampleImage(samplePos, sampleSize, true, time);
    hsl = rgbToHsl(rgb);
    hsl[2]*100

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