Here is how i managed to set default pin & stroke (link) colors by type
* Initializes the graph and canvas.
* @param canvasElement - The HTMLCanvasElement to initialize LiteGraphCanvas with.
*/
const initializeGraph = (canvasElement: HTMLCanvasElement): void => {
const customLinkTypeColors = {
integer: "#d2ffb0",
string: "#f3b0ff",
boolean: "#F77",
float: "#b0e0ff",
column: "#fffdb0"
};
graph.value = new LGraph()
graphCanvas.value = new LGraphCanvas(canvasElement, graph.value)
graphCanvas.value.default_connection_color_byType = customLinkTypeColors
graphCanvas.value.default_connection_color_byTypeOff = customLinkTypeColors
Object.assign(LGraphCanvas.link_type_colors, customLinkTypeColors);
graph.value.start()
}
And the result: enter image description here