From 6b638c965b6fec1c88947212792dc299acf67b36 Mon Sep 17 00:00:00 2001 From: EllangoK Date: Sat, 8 Apr 2023 10:47:15 -0400 Subject: [PATCH] matches entry for correct link color --- web/extensions/core/colorPalette.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/web/extensions/core/colorPalette.js b/web/extensions/core/colorPalette.js index 3c0300bf..e84bf6c0 100644 --- a/web/extensions/core/colorPalette.js +++ b/web/extensions/core/colorPalette.js @@ -284,7 +284,20 @@ app.registerExtension({ } else { data = inputNode.outputs[0]; } - let nodeType = data.type; + + const matchingEntry = inputNode.outputs.find(output => { + return outputNode.inputs.some(input => input.type === output.type); + }); + + console.log("matchingEntry: ", matchingEntry) + + const inputTypes = inputNode.outputs.map(output => output.type); + console.log("Input types:", inputTypes); + + const outputTypes = outputNode.inputs.map(input => input.type); + console.log("Output types:", outputTypes); + + let nodeType = matchingEntry.type; color = "#" + Math.floor(Math.random() * 16777215).toString(16); color = colorPalette.colors.node_slot[nodeType];