I’m trying something similar to this, but I want the color to be driven by the value of a text layer. I’m going for a conditional statement, but even when I simplify it I am not getting the desired results. It seems to just return the value of the first if statement no matter what.
color1 = [255,255,255,255];
color2 = [0,255,0,255]; // Green
color3 = [255,0,0,255]; // Red
c = thisComp.layer("Text1").text.sourceText;
if (c = "Green")
color2/255;
else if (c = "Red")
color3/255;
else
color1/255;