Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Color styles ia a MOGRT

Explorer ,
Jun 29, 2021 Jun 29, 2021

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.

PedroSIlveira1394_0-1624996317077.png

Is my logic wrong here? And why is this problem with the colors happening?

Thanks!

TOPICS
Expressions, How to

Views

44

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Jun 30, 2021 Jun 30, 2021
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.

Likes

Translate

Translate
Adobe Community Professional ,
Jun 29, 2021 Jun 29, 2021

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jun 29, 2021 Jun 29, 2021

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 30, 2021 Jun 30, 2021

Copy link to clipboard

Copied

LATEST

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines