FORUMS: list search recent posts

How to change solid color using slider control ?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mike Jones
How to change solid color using slider control ?
on Jul 22, 2014 at 1:53:13 pm

Hello,

I have a solid layer and I want to change its color using a slider control.

example: (if value = 0, color = yellow //// if value = 1, color = red)

I tried using the below expression that I found in this thread:
slider = Math.floor(effect("Slider Control")("Slider").value);
if (slider == 0)
[.5,.5,.5,1] // medium grey
else if (slider == 1)
[0,1,0,1] // green
else [1,0,0,1] // red

but I am getting an error that the expression result must be of dimension 1, not 4.

So how can I do this ?


Return to posts index

Dan Ebberts
Re: How to change solid color using slider control ?
on Jul 22, 2014 at 4:14:36 pm

You need to apply the expression to a color parameter, like that in the Fill effect.

Dan



Return to posts index

Tom Holmes
Re: How to change solid color using slider control ?
on Jul 24, 2014 at 4:29:02 pm

Hey,

Id add two colour controllers to the layer. set one colour to the yellow and the other to red and then write your if else statement but don't write the 4 value array just pickwhip to the colour controllers.

if(effect("Slider Control")("Slider")==0)effect("Color Control" ("Color")else if(effect("Slider Control")("Slider")==1)effect("Color Control 2")("Color")}

hope this helps!

Tom


Return to posts index

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