Question
text setFillColor to a variable instead of a in situ string
- May 13, 2024
- 2 replies
- 329 views
Hi All,
Grateful for any help on the bellow please.
I can't get my text to change color using a variable reference. I have tried to convert a variable which comes from another comp and text frame into something that setFillColor on a text source will accept. It keeps saying 'bad argument'. I have tried with hex values and rgb values in various formats. It just won't seem to have a variable between the brackets in setFillColor.
Thanks,
Nick
var textcolor1 = toString(comp('vars').layer('text_color_1').text.sourceText); thisLayer.text.sourceText.style.setText(text1source).setFontSize(textfontSize1).setLeading(textlineHeight1).setFillColor(hexToRgb(textcolor1))
