Changing fill paint from properties in a template

Hi,

I’m new to this forum and IA.

Been designing a template and the template works correctly except for one animation I can’t get right.

I have 3 rectangles, No 1 and 2 are connected to UDT and change color (RED or GREEN) depending on the value in the PLC correctly. I need the 3rd rectangle to be RED unless either of the other 2 rectangles are GREEN.

All my attempts at the script in the 3rd rectangles’ fill paint property does not work.

if({Breaker Vert Large.rect_top.fillPaint}||{Breaker Vert Large.rect_bottom.fillPaint}=(“00FF00”),
toColor("#FF0000"),
toColor("#00FF00"))

There might be another way of achieving my goal. Any help much appreciated.

Harry

if(toColor({Root Container.Rectangle.fillPaint})=toColor("00FF00")||toColor({Root Container.Rectangle 1.fillPaint})=toColor("00FF00"),toColor("00FF00"),toColor("FF0000"))