fix: hardcode INT/FLOAT dot colors — not defined in LGraphCanvas.link_type_colors
This commit is contained in:
+4
-2
@@ -210,12 +210,14 @@ app.registerExtension({
|
|||||||
const name = keyWidget?.value || this.outputs[0].name;
|
const name = keyWidget?.value || this.outputs[0].name;
|
||||||
this.outputs[0].label = `${val} ${name}`;
|
this.outputs[0].label = `${val} ${name}`;
|
||||||
const slotType = this.outputs[0].type;
|
const slotType = this.outputs[0].type;
|
||||||
|
const TYPE_COLORS = { "INT": "#3d7eb5", "FLOAT": "#68a468", "BOOLEAN": null };
|
||||||
let color;
|
let color;
|
||||||
if (slotType === "BOOLEAN") {
|
if (slotType === "BOOLEAN") {
|
||||||
color = (val === "true") ? "#4caf50" : "#888888";
|
color = (val === "true") ? "#4caf50" : "#888888";
|
||||||
} else {
|
} else {
|
||||||
color = LGraphCanvas?.link_type_colors?.[slotType]
|
color = TYPE_COLORS[slotType]
|
||||||
|| app.canvas?.default_connection_color_byType?.[slotType];
|
?? LGraphCanvas?.link_type_colors?.[slotType]
|
||||||
|
?? app.canvas?.default_connection_color_byType?.[slotType];
|
||||||
}
|
}
|
||||||
if (color) {
|
if (color) {
|
||||||
this.outputs[0].color_on = color;
|
this.outputs[0].color_on = color;
|
||||||
|
|||||||
Reference in New Issue
Block a user