You all are going to hate me but:
$('#red-ui-tab-d9450c0f08a45cfa').find('circle').css('fill', 'red')
where d945...cfa
is the flow Id.
Combine that line with the ClientCode node and you can change the color all the time:
[{"id":"0e710fe5d053391c","type":"ClientCode","z":"864df4104ed3c1e1","name":"","clientcode":"$('#red-ui-tab-' + msg.flowid).find('circle').css('fill', msg.color)","format":"javascript","x":2399.9999999999995,"y":1229.9999999999998,"wires":[[]]},{"id":"6d97573977674ead","type":"change","z":"864df4104ed3c1e1","name":"","rules":[{"t":"set","p":"flowid","pt":"msg","to":"d9450c0f08a45cfa","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2117,"y":1231,"wires":[["0e710fe5d053391c"]]},{"id":"ec9c248c0d44d0f2","type":"inject","z":"864df4104ed3c1e1","name":"red","props":[{"p":"color","v":"red","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":1718,"y":1162,"wires":[["6d97573977674ead"]]},{"id":"ebf91b241b2155e8","type":"inject","z":"864df4104ed3c1e1","name":"blue","props":[{"p":"color","v":"blue","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":1714,"y":1243,"wires":[["6d97573977674ead"]]},{"id":"11502c2c85cc2605","type":"inject","z":"864df4104ed3c1e1","name":"green","props":[{"p":"color","v":"green","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":1720,"y":1315,"wires":[["6d97573977674ead"]]}]
change the flowid in the change node in that flow.
Edit: it can also be generalised so that you don't need to supply the flow id by retrieving the node in the frontend and using its 'z' value (which is the flowid):
[{"id":"0e710fe5d053391c","type":"ClientCode","z":"864df4104ed3c1e1","name":"","clientcode":"let flowid = RED.nodes.node(msg.this_node_id).z || msg.flowid\n\n$('#red-ui-tab-' + flowid).find('circle').css('fill', msg.color)","format":"javascript","x":2508,"y":1350,"wires":[[]]},{"id":"6d97573977674ead","type":"change","z":"864df4104ed3c1e1","name":"","rules":[{"t":"set","p":"flowid","pt":"msg","to":"d9450c0f08a45cfa","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2116,"y":1256,"wires":[["684a84833ff13f86"]]},{"id":"ec9c248c0d44d0f2","type":"inject","z":"864df4104ed3c1e1","name":"red","props":[{"p":"color","v":"red","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":1718,"y":1162,"wires":[["6d97573977674ead"]]},{"id":"ebf91b241b2155e8","type":"inject","z":"864df4104ed3c1e1","name":"blue","props":[{"p":"color","v":"blue","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":1714,"y":1243,"wires":[["6d97573977674ead"]]},{"id":"11502c2c85cc2605","type":"inject","z":"864df4104ed3c1e1","name":"green","props":[{"p":"color","v":"green","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":1717,"y":1366,"wires":[["6d97573977674ead"]]},{"id":"684a84833ff13f86","type":"function","z":"864df4104ed3c1e1","name":"function 17","func":"\nmsg.this_node_id = node.id\n\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2311,"y":1292,"wires":[["0e710fe5d053391c"]]}]
Edit2: live demonstration