ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Conditional color fill effect value depending of slider value

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Fabian Aguirre
Conditional color fill effect value depending of slider value
on Jan 15, 2018 at 2:37:47 pm
Last Edited By Fabian Aguirre on Jan 15, 2018 at 4:09:38 pm

Hi, I need to change fill effect value depending of values of a range from slider control .

(applied to fill effect)

n = Math.floor(thisComp.layer("01").effect("COLOR")("Slider").value);
if (n <= 10) {
[255,255,255,1]/255 // Color 1
} else if (n >= 0 && n > 20) {
[162,0,0,1]/255 // Color 2
} else if (n >= 21 && n <= 30) {
[238,199,25,1]/255 // Color 3
} else (n >= 31) {
[0,0,163,1]/255; // Color 4
}

I can't get working this ☹

The color 4 is the only working.

Could you help me please?

Thanks in advance!


Return to posts index

Dan Ebberts
Re: Conditional color fill effect value depending of slider value
on Jan 15, 2018 at 5:20:30 pm

More like this, probably:


n = Math.floor(thisComp.layer("01").effect("COLOR")("Slider").value);
if (n <= 10) {
[255,255,255,255]/255 // Color 1
} else if (n <= 20) {
[162,0,0,255]/255 // Color 2
} else if (n <= 30) {
[238,199,25,255]/255 // Color 3
} else {
[0,0,163,255]/255; // Color 4
}



Dan



Return to posts index

Fabian Aguirre
Re: Conditional color fill effect value depending of slider value
on Jan 15, 2018 at 5:26:49 pm

Working!

Thank you dan!.

I hope you have a nice day!


Return to posts index

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