• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Color Expression Problem

New Here ,
Apr 20, 2018 Apr 20, 2018

Copy link to clipboard

Copied

Hi everyone, I am new to expressions and am wondering what those color values inside the square brackets mean. I guess they mean [r,g,b,?]? Also, one weird problem is that (S==2) shows me a random color instead of what I have typed in but it works for other conditions. I have no idea what "+" actually means, I just get information here and there and I have no idea what I have done. Any help and corrections are greatly appreciated.

This is what I have been working on:

Help.PNG

Views

726

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
LEGEND ,
Apr 20, 2018 Apr 20, 2018

Copy link to clipboard

Copied

Variable S is just a slider index that picks out the 3 colors. Colors are stored as arrays with per channel values for RGB and Alpha. The reason it shows random colors is simply becuase the slider vcalue is not quantized/ rounded properly and thus the actual value could be anywhere in the range of 1.x to 2.x, meaning the color flip-flops around depending on the slider. Nothing a Math.round(S) can't cure (aside from the expression being quite rubbish otherwise).

Mylenium

Votes

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
New Here ,
Apr 21, 2018 Apr 21, 2018

Copy link to clipboard

Copied

Thanks for the reply. Do I put Math.round(S) under color or slider? Becuase if I put it under slider, it does the same thing which means the rounding issue still appears. If I put it under color, there is an expression error saying:

擷取.PNG

Votes

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
Valorous Hero ,
Apr 21, 2018 Apr 21, 2018

Copy link to clipboard

Copied

LATEST

Your color Expression is wrong/horrid/ridiculous/clownish — this is what Mylenium mentioned in his post — he just lacks a wee bit of eloquence, at times. 😉

Color in AE Expressions and Scripting is measured from 0-1. I suggest you place as many Expression Color Controls in your 'Control Layer' as you need. Then point the Expression you now have to each of the Color Controls; dependent on the slider value.

Motion Graphics Brand Guidelines & Motion Graphics Responsive Design Toolkits

Votes

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