From a1c6d1d30a4e0bc9f366f309137bfe4ed7cf2dc2 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Wed, 9 Feb 2022 11:32:19 +0100 Subject: [PATCH] Scale the dragged slider color based on original --- nih_plug_egui/src/widgets/param_slider.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nih_plug_egui/src/widgets/param_slider.rs b/nih_plug_egui/src/widgets/param_slider.rs index 16c9a346..bae11f79 100644 --- a/nih_plug_egui/src/widgets/param_slider.rs +++ b/nih_plug_egui/src/widgets/param_slider.rs @@ -1,5 +1,6 @@ -use egui::{vec2, Color32, Response, Sense, Stroke, TextStyle, Ui, Widget}; +use egui::{vec2, Response, Sense, Stroke, TextStyle, Ui, Widget}; +use super::util; use nih_plug::{Param, ParamSetter}; /// A slider widget similar to [egui::widgets::Slider] that knows about NIH-plug parameters ranges @@ -95,8 +96,7 @@ impl Widget for ParamSlider<'_, P> { let mut filled_rect = response.rect; filled_rect.set_width(response.rect.width() * filled_proportion); let filled_bg = if response.dragged() { - // TODO: Use something that works with a light theme - Color32::DARK_GRAY + util::add_hsv(ui.visuals().selection.bg_fill, 0.0, -0.1, 0.1) } else { ui.visuals().selection.bg_fill };