Hi, I’m having trouble with my scripting to change the background color of some components.
I am a beginner at python so any advice would be greatly appreciated!
My goal is to turn the background color of each of the Red/Yel/Grn components 1 of 2 colors.
If the custom property “Light_On” is true,then turn the background color to “Light_Color_On” (#0000FF)
If the custom property “Light_On” is false,then turn the background color to “Light_Color_Off” (#0000FF80)
Currently, I have tried the following script after a Property binding, but I keep getting an error:
Error_Configuration("Parse Error in script transformation")
def transform(self, value, quality, timestamp): newcolor = self.custom.Light_Color_On # "#FFFF00" oldcolor = self.custom.Light_Color_Off # "#FFFF0080" if value: returncolor = newcolor else returncolor = oldcolor return returncolor
Not sure what my error is or how to fix it.
Please and thank you!