# Script is not reading

**URL:** <https://forum.inductiveautomation.com/t/script-is-not-reading/112695>\
**Category:** General Discussion\
**Created:** [December 9, 2025, 9:28am UTC](https://forum.inductiveautomation.com/t/script-is-not-reading/112695 "2025-12-09T09:28:51Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [December 10, 2025, 9:31pm UTC](https://forum.inductiveautomation.com/t/script-is-not-reading/112695/13 "2025-12-10T21:31:05Z")

</div>

> [@Ryan\_Deardorff](#):
>
> ```python
> if(lower({this.props.text}) = 'alert', // red
> '#FF0000',
> if(lower({this.props.text}) = 'running', // green
> '#00A000',
> if(lower({this.props.text}) = 'not_entry',	// yellow
> '#FFD54F',
> if(lower({this.props.text}) = 'entry',	// light blue
> '#ADD8E6',
> '#BDBDBD' // default
> )
> )
> )
> )
> 
> ```

Also, if you _do_ need to use nested ifs, maybe it’s just preference, but I find it much easier to read when all the conditions and outputs align (and colours are in human-readable HSL):

```python
if(lower({this.props.text}) = 'alert', // red
	'hsl(7 95% 60%)',
if(lower({this.props.text}) = 'running',	// green
	'hsl(95 60% 60%)',
if(lower({this.props.text}) = 'not_entry',	// yellow
	'hsl(55 95% 60%)',
if(lower({this.props.text}) = 'entry', // light blue
	'hsl(185 95% 60%)',

	'hsl(0 0% 60%)' // default
))))

```

Of course, using magic colours like this is also a no-no and these should use css variables, and I much prefer to reference these inside p.styles and use the p style in the ui, as then they're selectable.

Also, I made an HSL cheat sheet to help remember the H values

> [@Useful CSS Stuff](https://forum.inductiveautomation.com/t/useful-css-stuff/95414/63):
>
> I've added this to a few posts now before realising it really belongs here… I made an HSL cheat sheet in Perspective to help remember the Hue values in the human-readable HSL colour format (as opposed to the mostly human-illegible RGB): View Exports: [HSL Cheat Sheet.zip](https://forum.inductiveautomation.com/uploads/short-url/t5zmywFce0rkswWMZScggxTYxpg.zip) (27.8 KB)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/3/b32566a422bd59407457dba4b5b3f3964d85442b.png)

---

_[View the full topic](https://forum.inductiveautomation.com/t/script-is-not-reading/112695)._
