diff --git a/scene/gui/color_mode.cpp b/scene/gui/color_mode.cpp index 123938f964e1..77ce0fe26fc1 100644 --- a/scene/gui/color_mode.cpp +++ b/scene/gui/color_mode.cpp @@ -157,9 +157,9 @@ void ColorModeHSV::slider_draw(int p_which) { right_color = color; right_color.a = 1; } else if (p_which == 0) { - Ref hue = color_picker->get_theme_icon(SNAME("color_hue"), SNAME("ColorPicker")); - slider->draw_texture_rect(hue, Rect2(Vector2(), Vector2(size.x, margin)), false); - return; + float v = color.get_v(); + left_color = Color(v, v, v); + right_color = left_color; } else { Color s_col; Color v_col; @@ -179,6 +179,11 @@ void ColorModeHSV::slider_draw(int p_which) { pos.set(3, Vector2(0, margin)); slider->draw_polygon(pos, col); + + if (p_which == 0) { // H + Ref hue = color_picker->get_theme_icon(SNAME("color_hue"), SNAME("ColorPicker")); + slider->draw_texture_rect(hue, Rect2(Vector2(), Vector2(size.x, margin)), false, Color::from_hsv(0, 0, color.get_v(), color.get_s())); + } } String ColorModeRAW::get_slider_label(int idx) const { @@ -287,12 +292,6 @@ void ColorModeOKHSL::slider_draw(int p_which) { Size2 size = slider->get_size(); const real_t margin = 16 * color_picker->get_theme_default_base_scale(); - if (p_which == 0) { // H - Ref hue = color_picker->get_theme_icon(SNAME("color_okhsl_hue"), SNAME("ColorPicker")); - slider->draw_texture_rect(hue, Rect2(Vector2(), Vector2(size.x, margin)), false); - return; - } - Vector pos; Vector col; Color left_color; @@ -319,7 +318,7 @@ void ColorModeOKHSL::slider_draw(int p_which) { pos.set(3, Vector2(size.x, margin)); pos.set(4, Vector2(size.x * 0.5, margin)); pos.set(5, Vector2(0, margin)); - } else { // A / S + } else { pos.resize(4); col.resize(4); @@ -330,6 +329,10 @@ void ColorModeOKHSL::slider_draw(int p_which) { left_color.a = 0; right_color = color; right_color.a = 1; + } else if (p_which == 0) { + float l = color.get_ok_hsl_l(); + left_color = Color(l, l, l); + right_color = left_color; } else { left_color.set_ok_hsl(color.get_ok_hsl_h(), 0, color.get_ok_hsl_l()); right_color.set_ok_hsl(color.get_ok_hsl_h(), 1, color.get_ok_hsl_l()); @@ -346,4 +349,10 @@ void ColorModeOKHSL::slider_draw(int p_which) { } slider->draw_polygon(pos, col); + + if (p_which == 0) { // H + Ref hue = color_picker->get_theme_icon(SNAME("color_okhsl_hue"), SNAME("ColorPicker")); + slider->draw_texture_rect(hue, Rect2(Vector2(), Vector2(size.x, margin)), false, Color::from_hsv(0, 0, color.get_ok_hsl_l() * 2.0, color.get_ok_hsl_s())); + return; + } }