input_dot_color - chrisgoringe/Comfy-Custom-Node-How-To GitHub Wiki

Set the color of an input dot

Maybe a bit niche, but... the most likely place you might want to do this is in onConnectionsChange, so:

    const onConnectionsChange = nodeType.prototype.onConnectionsChange;
    nodeType.prototype.onConnectionsChange = function (side,slot,connect,link_info,output) {
        this.inputs[0].color_on = app.canvas.default_connection_color_byType["STRING"];  // set color_on on an input - here I'm reading the color for STRING from the color pallet
        onConnectionsChange?.apply(side,slot,connect,link_info,output);                  // and then process the change (which includes a redraw)
    }