import { app } from "../../../scripts/app.js"; import { color_balance_widget } from "./nodes/color_balance_widget.js"; import { color_hue_saturation_widget } from "./nodes/color_hue_saturation_widget.js"; //import { addRGBIntegerWidget } from "./widgets/rgb_int_widget.js"; app.registerExtension({ name: "md.color_mod.frontend_extension", async beforeRegisterNodeDef(nodeType, nodeData, app) { const onNodeCreated = nodeType.prototype.onNodeCreated; if (nodeData.name === "mdColorBalance") { nodeType.prototype.onNodeCreated = function () { onNodeCreated?.apply(this, arguments); this._inst = new color_balance_widget(this); }; } if (nodeData.name === "mdColorHueSaturation") { nodeType.prototype.onNodeCreated = function () { onNodeCreated?.apply(this, arguments); this._inst = new color_hue_saturation_widget(this); }; } /* if (nodeData.name === "mdPrimitiveColorRGB") { nodeType.prototype.onNodeCreated = function () { const result = onNodeCreated?.apply(this, arguments); addRGBIntegerWidget(this, "rgb", 16711680); return result; }; } */ }, });