Merge pull request #49136 from Calinou/editor-light-theme-use-negative-contrast

Use a negative contrast setting for light editor themes
This commit is contained in:
Rémi Verschelde 2021-05-31 10:33:19 +02:00 committed by GitHub
commit 544bbc9483
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -329,16 +329,18 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
preset_contrast = default_contrast;
} else if (preset == "Light") {
preset_accent_color = Color(0.18, 0.50, 1.00);
preset_base_color = Color(1.00, 1.00, 1.00);
preset_contrast = 0.08;
preset_base_color = Color(0.9, 0.9, 0.9);
// A negative contrast rate looks better for light themes, since it better follows the natural order of UI "elevation".
preset_contrast = -0.08;
} else if (preset == "Solarized (Dark)") {
preset_accent_color = Color(0.15, 0.55, 0.82);
preset_base_color = Color(0.04, 0.23, 0.27);
preset_contrast = default_contrast;
} else if (preset == "Solarized (Light)") {
preset_accent_color = Color(0.15, 0.55, 0.82);
preset_base_color = Color(0.99, 0.96, 0.89);
preset_contrast = 0.08;
preset_base_color = Color(0.89, 0.86, 0.79);
// A negative contrast rate looks better for light themes, since it better follows the natural order of UI "elevation".
preset_contrast = -0.08;
} else { // Default
preset_accent_color = Color(0.44, 0.73, 0.98);
preset_base_color = Color(0.21, 0.24, 0.29);
@ -1355,7 +1357,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
const Color comment_color = dim_color;
const Color string_color = (dark_theme ? Color(1.0, 0.85, 0.26) : Color(1.0, 0.82, 0.09)).lerp(mono_color, dark_theme ? 0.5 : 0.3);
const Color te_background_color = dark_theme ? background_color : base_color;
// Use the brightest background color on a light theme (which generally uses a negative contrast rate).
const Color te_background_color = dark_theme ? background_color : dark_color_3;
const Color completion_background_color = dark_theme ? base_color : background_color;
const Color completion_selected_color = alpha1;
const Color completion_existing_color = alpha2;