-
Color from text.sourceText expression
Hey Guys,
I’ve been tinkering around with no luck on this one.
input = thisComp.layer(“color”).text.sourceText;
if ((input == “red”) == 1 ) [1,0,0,1];
if ((input == “green”) == 1 ) [0,1,0,1];I want something that will work on these lines.
I have 9 colours, specific values, too which I want to use a text source to define which value it will select.
I am currently using 9 solid layers and using an expression that will turn on 1 and turn off 8 on the opacity, but my projects are getting bulkier and would like to condense this into one solid layer, with a fill effect that will change color based off the input…
I know that there must be a way because I’ve seen a forum on here that uses a parse float so it is above or below 0 it will assign one of two colors.
Any ideas?
input = thisComp.layer("color").text.sourceText;if ((input == "red") == 1 ) [1,0,0,1];
if ((input == "green") == 1 ) [0,1,0,1];