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

**URL:** <https://forum.inductiveautomation.com/t/solved-updating-all-background-components-colors-at-once-through-scripting/36059>\
**Category:** Ignition\
**Created:** [June 25, 2020, 8:41pm UTC](https://forum.inductiveautomation.com/t/solved-updating-all-background-components-colors-at-once-through-scripting/36059 "2020-06-25T20:41:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmeyers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmeyers/32/37453_2.png) [@bmeyers](https://forum.inductiveautomation.com/u/bmeyers)\
**Post date:** [June 25, 2020, 8:41pm UTC](https://forum.inductiveautomation.com/t/solved-updating-all-background-components-colors-at-once-through-scripting/36059/1 "2020-06-25T20:41:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [June 25, 2020, 9:56pm UTC](https://forum.inductiveautomation.com/t/solved-updating-all-background-components-colors-at-once-through-scripting/36059/2 "2020-06-25T21:56:55Z")

</div>

Is this a Vision question, or a Perspective question?

---

<div class="post-metadata">

**Author:** ![bmeyers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmeyers/32/37453_2.png) [@bmeyers](https://forum.inductiveautomation.com/u/bmeyers)\
**Post date:** [June 26, 2020, 2:30pm UTC](https://forum.inductiveautomation.com/t/solved-updating-all-background-components-colors-at-once-through-scripting/36059/3 "2020-06-26T14:30:18Z")

</div>

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](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()")
```
