# Foreground color change in template

**URL:** <https://discourse.nodered.org/t/foreground-color-change-in-template/47467>\
**Category:** Dashboard\
**Created:** [22 June 2021 09:27 UTC](https://discourse.nodered.org/t/foreground-color-change-in-template/47467 "2021-06-22T09:27:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![juntiedt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juntiedt/32/58357_2.png) [@juntiedt](https://discourse.nodered.org/u/juntiedt)\
**Post date:** [22 June 2021 09:27 UTC](https://discourse.nodered.org/t/foreground-color-change-in-template/47467/1 "2021-06-22T09:27:26Z")

</div>

I am sending this msg.payload to a smal template (size1x2) which shows a room and the last time of the sensor read.

```auto
msg.payload = "<center>" + "<br>" + room + "<br>" + "<font size='2'>" + msg.time + "</font>" + "</center>";

```

Now I want to change the color of the room to light blue when a window sensor sends open and back to white when the window is closed. As I have no experience in template programming any help is very much appreciated.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [22 July 2021 09:27 UTC](https://discourse.nodered.org/t/foreground-color-change-in-template/47467/2 "2021-07-22T09:27:35Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
