# Perspecrive CUSTOOM - Color Script Question

**URL:** <https://forum.inductiveautomation.com/t/perspecrive-custoom-color-script-question/72067>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [April 5, 2023, 4:49am UTC](https://forum.inductiveautomation.com/t/perspecrive-custoom-color-script-question/72067 "2023-04-05T04:49:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiyoung\_hwang1](https://avatars.discourse-cdn.com/v4/letter/j/bc79bd/32.png) [@jiyoung\_hwang1](https://forum.inductiveautomation.com/u/jiyoung_hwang1)\
**Post date:** [April 5, 2023, 4:49am UTC](https://forum.inductiveautomation.com/t/perspecrive-custoom-color-script-question/72067/1 "2023-04-05T04:49:22Z")

</div>

![1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/8/d8616201bd16aeb5b193e4263ba197e086210b5f.png)

As you can see in the attached picture, an error occurred.  
"AttributeError: 'NoneType' object has no attribute 'group' "

I don't know how to go about solving this.

Please tell us.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 5, 2023, 6:02am UTC](https://forum.inductiveautomation.com/t/perspecrive-custoom-color-script-question/72067/2 "2023-04-05T06:02:41Z")

</div>

Your _color_ dictionary isn't valid JSON. You can check it on https:jsonlint.org.

```auto
{
	color: ,
	theme: light
}

```

returns

```auto
Error: Parse error on line 1:
{	color: ,	theme: lig
--^
Expecting 'STRING', '}', got 'undefined'

```

I would expect it to look like `{"color": "#112233", "theme": "light"}`.

* * *

Tip: Your question has nothing to do with "building management system". Use a title that describes the problem so the right people read your post.

---

<div class="post-metadata">

**Author:** ![jiyoung\_hwang1](https://avatars.discourse-cdn.com/v4/letter/j/bc79bd/32.png) [@jiyoung\_hwang1](https://forum.inductiveautomation.com/u/jiyoung_hwang1)\
**Post date:** [April 5, 2023, 7:05am UTC](https://forum.inductiveautomation.com/t/perspecrive-custoom-color-script-question/72067/4 "2023-04-05T07:05:31Z")

</div>

I'm not sure what you're talking about because it's my first time using ignition.

Do you want me to delete the existing script and put what you said?

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [April 5, 2023, 7:10am UTC](https://forum.inductiveautomation.com/t/perspecrive-custoom-color-script-question/72067/5 "2023-04-05T07:10:33Z")

</div>

tip #2:

```python
iterable[i] for i in range(len(iterable))

```

is more easily expressed using

```python
x for x in iterable

```

So, line 37 could be written like this:

```python
result = [2 * x for x in result]

```

Line 35 is a bit different. You could use `zip` or `enumerate`, but I think it doesn't look very good.  
But, you already know this line is only run on a known length, which is quite small.  
So, you could just do this:

```python
r = result
result = [r[0]+r[1], r[2]+r[3], r[4]+r[5]]

```

This is simple, more efficient than looping (though that doesn't matter here), but more importantly you know at first glance what's going on. It's much easier to eye-parse than a list comprehension using `range(len(something), 2)`

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 5, 2023, 7:30am UTC](https://forum.inductiveautomation.com/t/perspecrive-custoom-color-script-question/72067/6 "2023-04-05T07:30:45Z")

</div>

> [@jiyoung\_hwang1](#):
>
> I'm not sure what you're talking about ...

If you look at the expression structure at the bottom left (beside the error message) you can see that 'color' has no value. Your `{view.params.color}` parameter is empty or Python type 'None'.

---

<div class="post-metadata">

**Author:** ![jiyoung\_hwang1](https://avatars.discourse-cdn.com/v4/letter/j/bc79bd/32.png) [@jiyoung\_hwang1](https://forum.inductiveautomation.com/u/jiyoung_hwang1)\
**Post date:** [April 5, 2023, 7:34am UTC](https://forum.inductiveautomation.com/t/perspecrive-custoom-color-script-question/72067/7 "2023-04-05T07:34:15Z")

</div>

All right. Let's try.
