# Ui\_level font color

**URL:** <https://discourse.nodered.org/t/ui-level-font-color/64498>\
**Category:** Dashboard\
**Created:** [29 June 2022 12:42 UTC](https://discourse.nodered.org/t/ui-level-font-color/64498 "2022-06-29T12:42:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kundepuu](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@Kundepuu](https://discourse.nodered.org/u/Kundepuu)\
**Post date:** [29 June 2022 12:42 UTC](https://discourse.nodered.org/t/ui-level-font-color/64498/1 "2022-06-29T12:42:13Z")

</div>

![level](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/f/0fdb89342f2782ea7690b6f76fe01bbd062c3e68.png)

I want to change value font color according to the color of the segments, but it change also segments value colors.  
How to do?

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [29 June 2022 15:19 UTC](https://discourse.nodered.org/t/ui-level-font-color/64498/2 "2022-06-29T15:19:53Z")

</div>

If I understand you correctly, you want the color of the value be dynamic so if value changes, it will change also the color if it belongs in other segments area?

If so, this is not anyhow supported.

I'm not having any plans to improve the widget by adding more features to it. This widget is maintained only against possible technical issues if any.

But as the workaround I suggest to hide ui\_level value field  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/d/3d0b3ebaa22e5972835c26ffd9b80cf0fb476594.png)

Then make your own value field using the `ui_template` node, place it next to the `ui_level` node, feed same data and you have full control over the appearance of the value field. Change the color of the text according to incoming data is show even as an example of `ui_template` help page. Your versin will be of course a bit more complex.

---

<div class="post-metadata">

**Author:** ![Kundepuu](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@Kundepuu](https://discourse.nodered.org/u/Kundepuu)\
**Post date:** [1 July 2022 03:44 UTC](https://discourse.nodered.org/t/ui-level-font-color/64498/3 "2022-07-01T03:44:39Z")

</div>

Thanks hotNipi !

![template fixing](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/6/b64595a3c36408262fced5b18a40f4c4abcaa235.png)

function node

```auto
let tavoite=flow.get("tuotedata.SalmonellaTavoite");
if (msg.payload > tavoite){
    msg.color="#00ff00"; 
    }else if (msg.payload>4){
        msg.color="#eb9900";
    }else if (msg.payload>0){
        msg.color="#ff0000";        
    }else if (msg.payload==0){
        msg.color="#595959";
        msg.payload=0; 
    }
    msg.control = {seg1:4, seg2:tavoite};
return msg;

```

template

```auto
<div><b style="color:{{msg.color}}; font-size:1em">{{msg.payload}}</b></div>

```

---

<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:** [15 July 2022 03:45 UTC](https://discourse.nodered.org/t/ui-level-font-color/64498/4 "2022-07-15T03:45:15Z")

</div>

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