[SOLVED] Updating all background components colors at once through scripting

Has anyone been able to put their colors into a project script and directly tie components colors to the script?

I know you can make a string tag for example called “RED” and set the value to “255, 0, 0” but I want to do something similar in a script that I can then make global and import/export easily.

Thanks for any thoughts on the subject.

An example might be having the line in a script named themes.

red = '255, 0, 0'

And then in an expression for the backgorund color I would say:

project.themes.red

But that syntax isn’t correct as far as I can tell.

Is this a Vision question, or a Perspective question?

This would be a vision question. I talked to a friend this morning about the problem and he showed me this link…

https://docs.inductiveautomation.com/display/DOC80/runScript

Put this function in a script.

def red():
    return '255, 0, 0'

Put this line in an expression on the background color of a component.

runScript("themes.red()")