From b79de5295177a5a9fc7b47facb584fdf1072720f Mon Sep 17 00:00:00 2001 From: passivestar <60579014+passivestar@users.noreply.github.com> Date: Wed, 14 Jan 2026 18:16:39 +0400 Subject: [PATCH] Limit maximum luminance for elevated surfaces in modern theme --- editor/themes/theme_modern.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editor/themes/theme_modern.cpp b/editor/themes/theme_modern.cpp index 77a0a830ca..15b3225c18 100644 --- a/editor/themes/theme_modern.cpp +++ b/editor/themes/theme_modern.cpp @@ -44,7 +44,8 @@ // Helper. static Color _get_base_color(EditorThemeManager::ThemeConfiguration &p_config, float p_dimness_ofs = 0.0, float p_saturation_mult = 1.0) { Color color = p_config.base_color; - color.set_v(CLAMP(Math::lerp(color.get_v(), 0, p_config.contrast * p_dimness_ofs), 0, 1)); + const float final_contrast = (p_dimness_ofs < 0) ? CLAMP(p_config.contrast, -0.1, 0.5) : p_config.contrast; + color.set_v(CLAMP(Math::lerp(color.get_v(), 0, final_contrast * p_dimness_ofs), 0, 1)); color.set_s(color.get_s() * p_saturation_mult); return color; }