ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Use an existing slider control to change the colour of text

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
David Gabriel
Use an existing slider control to change the colour of text
on Feb 5, 2018 at 11:33:01 am

Hi guys, I am making a 9:16 (vertical) graphics template themed with the logo and colours of the 20 teams of the English Premier League. My expressions knowledge only goes so far as wiggle and a bit of pick whipping!

I am trying to make an essential graphics template so that the editors can use the slider to pick the team that they want to have as their on screen graphic in Premiere (rather than having to go into AE).

So far I have in my essential graphics tab the four lines of text, the slider, and a comment which tells the user which team is which number. The slider goes from 1 to 23 (20 teams plus three others).

Here is what that looks like:
https://www.dropbox.com/s/ll8ec723h09gxc9/Screen%20Shot%202018-02-05%20at%2...

I have so far been able to use the slider to change the logo (by making all other logos 0% opacity), to change the name of the team (by making all other team names 0% opacity) and to change the background colours of the boxes.
This is the expression I used to do all of this. It is in the opacity setting for each object:

slider = thisComp.layer("Team Slider").effect("Slider Control")("Slider");

if (slider == 6) 100 else 0;

My problem is that I also want to be able to change the colour of the text when the slider is changed. Does anybody have any idea of how I can do this?

Below is the project file:
12123_gfxstudioscreens.aep.zip

Thank you!

David.


Return to posts index

Scott McGee
Re: Use an existing slider control to change the colour of text
on Feb 5, 2018 at 2:58:10 pm

I'd use something like this, if you are just pre embedding the colours. The below allows you to go based on Hex value, just make sure to add 0x at the fron of each one.

I use something similar.

if (slider == 6){
a = 0x974040;
}
else if(slider == 7){
a = 0x498ABB;
}else{
a = 0x8D8D8D;
}

txt = a;
r = txt >> 16;
g = (txt & 0x00ff00) >> 8;
b = txt & 0xff;
[r,g,b,255]/255


Return to posts index

David Gabriel
Re: Use an existing slider control to change the colour of text
on Feb 5, 2018 at 8:19:32 pm

Hi Scott,

Thanks so much for replying. I am keen to give your script a go. I guess a big part where I am stuck is... where do I paste this expression? I can't see a colour parameter in text. Is there a way to add a colour control to the text, or do I add a color animator, or do I create a null and paste it in there? Once again, I am a real amateur with expressions.
Do I also change 'slider' in your expression to 'Team Slider' seeing as I have called it this?
btw I just tried these methods above so either I am doing it wrong or this isn't the way to do it.

Thanks again!
David.


Return to posts index


David Gabriel
Re: Use an existing slider control to change the colour of text
on Feb 5, 2018 at 9:10:52 pm

Okay, I just worked it out and yes it was incredibly simple. I just put a fill effect on the text layer and pasted the expression in the color parameter. Which I am sure you were going to tell me to do.

Thank you so much!!! Your expression worked perfectly. I know it was a simple one for you but it helped me immensely!!!

Cheers.

David.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]