Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects › Changing ‘Tint’ value based on Dropdown menu/Expressions

  • Changing ‘Tint’ value based on Dropdown menu/Expressions

    Posted by James Henry on August 11, 2020 at 11:25 am

    I have a project that is in a 2 colour style. I’m going to need to do versions where the primary colour changes from Pink to Blue against black. I’m just trying to work out a way to simplify this and only change the value on one layer.

    At present I have my solid background which is set to white.

    I have a tint effect (will come back to this shortly).

    I have a null object, renamed to ‘Control’ and on this layer I have a dropdown menu control renamed ‘Colour’ with the values ‘Pink’ and ‘Blue’

    On my tint effect, I’ve added an expression under the ‘Map White to’ stopwatch, with the following details:

    dropMenu = thisComp.layer("Control").effect("Colour")("Menu").value;
    ColOpt = ["FF2BFE", "4C9FF7"];

    ColOpt[dropMenu-1]

    However this isn’t working and I’m getting the error
    Error: invalid numeric response (divide by zero?)

    Can anyone offer any guidance as to where I might be going wrong here? Is there an alternative way to achieve the result I’m going for?

    James Henry replied 6 years, 1 month ago 2 Members · 2 Replies
  • 2 Replies
  • Filip Vandueren

    August 11, 2020 at 3:28 pm

    Hi there,

    the final line should be:

    hexToRgb(ColOpt[dropMenu-1]);

    Expressions expect colours like [0.29, 0.62, 0.98, 1], the hexToRgb() meethod does the conversion for us…

  • James Henry

    August 11, 2020 at 3:40 pm

    ah amazing, thanks!

    thought it would be a simple answer but was pulling my hair out a bit, thanks again!

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