# Bug? script changes colours correctly in designer preview but not on web page

**URL:** <https://forum.inductiveautomation.com/t/bug-script-changes-colours-correctly-in-designer-preview-but-not-on-web-page/61344>\
**Category:** Ignition\
**Tags:** perspective, ignition80\
**Created:** [June 29, 2022, 11:24am UTC](https://forum.inductiveautomation.com/t/bug-script-changes-colours-correctly-in-designer-preview-but-not-on-web-page/61344 "2022-06-29T11:24:39Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [June 29, 2022, 12:05pm UTC](https://forum.inductiveautomation.com/t/bug-script-changes-colours-correctly-in-designer-preview-but-not-on-web-page/61344/3 "2022-06-29T12:05:48Z")

</div>

Your green color includes the `#`, the grey color does not. Generally when a color is not recognized it will default to black.

These lines should be

```python
	self.parent.parent.getChild("FPS03").getChild("Icon").props.color = "#A5A5A5"

```

I would also strongly suggest using theme variables for your colors, as opposed to hard coding them. So if you ever decide to change them you will only need to change it in one place.

Some more on that here:

> [@Ignition Perspective symbol factory animation](https://forum.inductiveautomation.com/t/ignition-perspective-symbol-factory-animation/36119/15):
>
> You really should look into using a custom theme and css variables for all of your standard colours, as it provides far better standardisation than any other method (or than simply using magic colours). You can reference css variables and use them as component property values using: var(--VARIABLE\_NAME) This is an example of my custom style variable.css below. Mostly I reference these within Perspective Styles, however I also do reference some of the directly in component property values when…

---

_[View the full topic](https://forum.inductiveautomation.com/t/bug-script-changes-colours-correctly-in-designer-preview-but-not-on-web-page/61344)._
