From 66e899643c25f02eaf5b09ba9d9b85e58d3565a8 Mon Sep 17 00:00:00 2001 From: Baldur Gislason Date: Wed, 5 Apr 2023 15:26:22 +0000 Subject: [PATCH] Made slider colours configurable --- src/litegraph.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/litegraph.js b/src/litegraph.js index 4effe006e..53ebfc772 100644 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -9734,13 +9734,13 @@ LGraphNode.prototype.executeAction = function(action) var nvalue = (w.value - w.options.min) / range; if(nvalue < 0.0) nvalue = 0.0; if(nvalue > 1.0) nvalue = 1.0; - ctx.fillStyle = active_widget == w ? "#89A" : "#678"; + ctx.fillStyle = w.hasOwnProperty("slider_color") ? w.slider_color : (active_widget == w ? "#89A" : "#678"); ctx.fillRect(margin, y, nvalue * (widget_width - margin * 2), H); if(show_text && !w.disabled) ctx.strokeRect(margin, y, widget_width - margin * 2, H); if (w.marker) { var marker_nvalue = (w.marker - w.options.min) / range; - ctx.fillStyle = "#AA9"; + ctx.fillStyle = w.hasOwnProperty("marker_color") ? w.marker_color : "#AA9"; ctx.fillRect( margin + marker_nvalue * (widget_width - margin * 2), y, 2, H ); } if (show_text) {