# Assigning default colors

**URL:** <https://forum.inductiveautomation.com/t/assigning-default-colors/109766>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [August 14, 2025, 11:53am UTC](https://forum.inductiveautomation.com/t/assigning-default-colors/109766 "2025-08-14T11:53:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![christophermomose](https://avatars.discourse-cdn.com/v4/letter/c/a5b964/32.png) [@christophermomose](https://forum.inductiveautomation.com/u/christophermomose)\
**Post date:** [August 14, 2025, 11:53am UTC](https://forum.inductiveautomation.com/t/assigning-default-colors/109766/1 "2025-08-14T11:53:38Z")

</div>

I am wondering how to revert colors to the default theme colors.

I have a binding on textStyle.color, when there is a alarm state I set the color to red using a “if true then map to ‘red’ “.

My question is how do I revert this to a theme color? Obviously mapping it to black or white would work only when the user is on the “correct” theme.

I tried “default” and that does not seem to work it just holds the red after the alarm has cleared.

---

<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:** [August 14, 2025, 12:08pm UTC](https://forum.inductiveautomation.com/t/assigning-default-colors/109766/2 "2025-08-14T12:08:29Z")

</div>

The proper CSS way to do this would be to create a Perspective style class `alarmState` where you set the text color. Rather than `red` I would use a [built-in theme color](https://docs.inductiveautomation.com/docs/8.1/ignition-modules/perspective/styles/perspective-built-in-themes#theme-colors) `--error`. When using this in your style class you will use the `var(--error)` syntax.

Then create an expression binding on the label's `style.classes`:

```python
if(
	{[default]myAlarm}, // replace with your alarm indicator.
	'alarmState',
	''
)

```

This will change with theme selection to match everything else which you will naturally have defined with theme colors (won't you?).

---

<div class="post-metadata">

**Author:** ![christophermomose](https://avatars.discourse-cdn.com/v4/letter/c/a5b964/32.png) [@christophermomose](https://forum.inductiveautomation.com/u/christophermomose)\
**Post date:** [August 14, 2025, 12:58pm UTC](https://forum.inductiveautomation.com/t/assigning-default-colors/109766/3 "2025-08-14T12:58:06Z")

</div>

Thanks, while messing with that I also learned you can go to Map and change the output types which includes a selection for style class.
