# Change the font color of node's label?

**URL:** <https://discourse.nodered.org/t/change-the-font-color-of-nodes-label/61535>\
**Category:** Developing Nodes\
**Created:** [20 April 2022 10:10 UTC](https://discourse.nodered.org/t/change-the-font-color-of-nodes-label/61535 "2022-04-20T10:10:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![talala](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/talala/32/60332_2.png) [@talala](https://discourse.nodered.org/u/talala)\
**Post date:** [20 April 2022 10:10 UTC](https://discourse.nodered.org/t/change-the-font-color-of-nodes-label/61535/1 "2022-04-20T10:10:29Z")

</div>

Hello, I am having trouble changing the font color (not background color) of a self-created node.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/4/84c9415609b9e1ed4dc9e769adf4221b4c99ab03.png)  
This is how my node looks like for now, as you see the background color is perfect, but I want to change the default text color (black) to white as the background color of my "label" is too dark, I guess changing the text to white would make it looks nicer.  
This is how I defined the node's appearance. It seems I can change it to italic (see [red-ui-flow-node-label-italic api](https://github.com/node-red/node-red/blob/4706e20a1d8f6b470cce2874a6dd90dcd4429a16/packages/node_modules/%40node-red/editor-client/src/sass/flow.scss#L32)), but which API allows me to change the color of the font? I'm trying to understand how to implement it. Any comments or suggestions are welcome!

```auto
<script type="text/javascript">
    RED.nodes.registerType("adcxxx_i2c", {
        category: "i2c_sensor",
        defaults: {
            name: {value:""},
            i2c_device_number: {value:1,validate:RED.validators.number()},
            i2c_address: {value:"0x00"},
        },
        color:"#FFCC66",
        inputs: 1,
        outputs: 1,
        icon: "Raspberry Pi",
        label: function() {
            return this.name || "adcxxx_i2c";
        },
        labelStyle: function() {
            return this.name ? "node_label_italic" : "";
        },
        oneditprepare: function() {
            this.i2c_device_number = !this.i2c_device_number ? 1 : this.i2c_device_number;  
            this.i2c_address = !this.i2c_address ? "0x00" : this.i2c_address;
        },
        oneditsave: function () {
        }
    });
</script>

```

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [20 April 2022 10:46 UTC](https://discourse.nodered.org/t/change-the-font-color-of-nodes-label/61535/2 "2022-04-20T10:46:33Z")

</div>

Short answer is can't be done  
See last long thread on the subject and read knolleary last comment

> [@Change node label color - e.g. for nodes w/ dark background](https://discourse.nodered.org/t/change-node-label-color-e-g-for-nodes-w-dark-background/57450):
>
> Hi! It seems that currently nodes always use black as color for the labels. This looks good for nodes, that use a light background color. For darker background colors, the label yet is (almost) unreadable. [image] I would like to propose to add a logic to use white as the default label color for dark backgrounds. to give node designers the option to define a dedicated label color - if they don't like the default setting. If confirmed, I could propose a PR.

---

<div class="post-metadata">

**Author:** ![Barbudor](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@Barbudor](https://discourse.nodered.org/u/Barbudor)\
**Post date:** [20 April 2022 11:57 UTC](https://discourse.nodered.org/t/change-the-font-color-of-nodes-label/61535/3 "2022-04-20T11:57:14Z")

</div>

I would totally support the ability to change the text colour.  
I my case, we have subflows that handle the integration with our platform API and we are using #6D5AF0 background because it is the official colour of the company. Choosing any other colour would not makes much sense.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/0/004c3ac40f78ba27eb4b7cfd3167fdc8de6c1d7d.png)

---

<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:** [4 May 2022 11:57 UTC](https://discourse.nodered.org/t/change-the-font-color-of-nodes-label/61535/4 "2022-05-04T11:57:56Z")

</div>

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