Skip to content

Commit ee76f3d

Browse files
committed
Fix contrast for light color presets in the classic theme
1 parent 0870525 commit ee76f3d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

editor/themes/editor_theme_manager.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,9 @@ EditorThemeManager::ThemeConfiguration EditorThemeManager::_create_theme_config(
318318
bool preset_draw_extra_borders = false;
319319
float preset_icon_saturation = config.default_icon_saturation;
320320

321+
// A negative contrast rate looks better for light themes, since it better follows the natural order of UI "elevation".
322+
const float light_contrast = config.style == "Modern" ? -0.4 : -0.06;
323+
321324
// Please use alphabetical order if you're adding a new color preset here.
322325
if (config.preset == "Black (OLED)") {
323326
preset_accent_color = Color(0.45, 0.75, 1.0);
@@ -342,17 +345,15 @@ EditorThemeManager::ThemeConfiguration EditorThemeManager::_create_theme_config(
342345
} else if (config.preset == "Light") {
343346
preset_accent_color = Color(0.18, 0.50, 1.00);
344347
preset_base_color = Color(0.9, 0.9, 0.9);
345-
// A negative contrast rate looks better for light themes, since it better follows the natural order of UI "elevation".
346-
preset_contrast = -0.4;
348+
preset_contrast = light_contrast;
347349
} else if (config.preset == "Solarized (Dark)") {
348350
preset_accent_color = Color(0.15, 0.55, 0.82);
349351
preset_base_color = Color(0.03, 0.21, 0.26);
350352
preset_contrast = 0.23;
351353
} else if (config.preset == "Solarized (Light)") {
352354
preset_accent_color = Color(0.15, 0.55, 0.82);
353355
preset_base_color = Color(0.89, 0.86, 0.79);
354-
// A negative contrast rate looks better for light themes, since it better follows the natural order of UI "elevation".
355-
preset_contrast = -0.4;
356+
preset_contrast = light_contrast;
356357
} else { // Default
357358
preset_accent_color = Color(0.337, 0.62, 1.0);
358359
preset_base_color = Color(0.145, 0.145, 0.145);

0 commit comments

Comments
 (0)