Hello, I am having trouble changing the font color (not background color) of a self-created node.
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), 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!
<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>