I'm helping someone and feel it is a valid question:
original thread
And I see that others are posting helpful examples:
like this one.
But I'd like to raise the question:
@mariulin was wanting to change the colour of the switch node with a message property.
I tried and after a bit of trying, I believe it can only be set with direct colour names entered where it has the fields to enter the colour/s.

So as to be sure:
1 - can you use msg.(something) to set the colours?
2 - can you enter RGB values like: #e6d00b?
Or are you limited to colour names? (eg: red pink yellow etc)
Not urgently, but could you pass that onto @mariulin so he too knows.
I have branched out and replaced the switch with the button node.
however, in my button change example it is possible:
you have to inject:
node.send({ui_control:{onicon:"fa-3x fa-lightbulb-o",oncolor:"#e6d00b"},label:"on",payload:true});
and this one to change icon, color ... :
node.send({ui_control:{officon:"fa-2x fa-lightbulb-o",offcolor:"grey"},label:"off",payload:false});
to a Switch node , and put variables in :
optionnal : {{msg.label}}
@Trying_to_learn did you try this example ?
What makes this work ? @dceejay says it's not possible? magic? lol