# Change button´s properties from script library

**URL:** <https://forum.inductiveautomation.com/t/change-button-s-properties-from-script-library/64618>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [September 28, 2022, 8:33pm UTC](https://forum.inductiveautomation.com/t/change-button-s-properties-from-script-library/64618 "2022-09-28T20:33:51Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 28, 2022, 9:05pm UTC](https://forum.inductiveautomation.com/t/change-button-s-properties-from-script-library/64618/2 "2022-09-28T21:05:43Z")

</div>

If you want to do something like "programmatically alter all buttons the same way", then I would suggest making a project library function that expects a particular component as the input. E.G:

### Project Library Script - `utils`

```python
def setColors(button):
    button.background = system.gui.color(251, 250, 249)

```

### Component Event Script

```python
utils.setColors(event.source.parent.getComponent('Button'))

```

The crucial part is that you pass _the component itself_ as a reference into your project script.

---

_[View the full topic](https://forum.inductiveautomation.com/t/change-button-s-properties-from-script-library/64618)._
