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:
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
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:
Copy link to clipboard
Copied
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.