Copy link to clipboard
Copied
Hello! I'm trying to create color styles that I can change with a slider in a Motion Graphics Template.
My idea was:
1) Create a color control layer with a slider and 3 color controllers (the slider also clamps the values from 1 to 3 and rounds them).
2) Link the color controllers to the slider, using the following expression:
corA = [0,198,94,1];
corB = [0,95,97,1];
corC = [255,255,255,1];
if(effect("Controle de cor")("Controle deslizante")==1) {
corA}
else{if(effect("Controle de cor")("Controle deslizante")==2)
{corB}
else {corC}}
3) Link the color properties from the other layers to the color controllers. (one is for text, one for bg and another for an illustration).
However, when I set the RGBa of the color on the expression, the result is another color, like in the picture below.
Is my logic wrong here? And why is this problem with the colors happening?
Thanks!
The answer was very simple, i just needed to divide my arrays by 255, because, as pointed by Mylenium, colors are float values between 0 and 1 in after effects.
Copy link to clipboard
Copied
I don't recall the exact process, but I believe you have to convert to HLS from RBG (or the other way 'round). That's the place I'd start looking anyway.
Copy link to clipboard
Copied
Colors are internally treated as float values, not as 8 bit integers. It's 1, not 255 and so on.
Mylenium
Copy link to clipboard
Copied
The answer was very simple, i just needed to divide my arrays by 255, because, as pointed by Mylenium, colors are float values between 0 and 1 in after effects.