From fa5aa11898d897cdacd344e1c5d503e485483d51 Mon Sep 17 00:00:00 2001 From: Nuno Donato Date: Fri, 26 May 2017 16:14:45 +0100 Subject: [PATCH] Added color presets for easy theme switching Also tweaked the default colors (darker and less satured) --- editor/editor_settings.cpp | 6 ++++-- editor/editor_themes.cpp | 26 +++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 858c38c796c..df12c7c75f6 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -511,9 +511,11 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { set("interface/separate_distraction_mode", false); - set("interface/theme/base_color", Color(0.3, 0.3, 0.3, 1)); + set("interface/theme/preset", 0); + hints["interface/theme/preset"] = PropertyInfo(Variant::INT, "interface/theme/preset", PROPERTY_HINT_ENUM, "Default,Grey,Godot 2,Arc,Custom", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); + set("interface/theme/base_color", Color::html("#273241")); hints["interface/theme/highlight_color"] = PropertyInfo(Variant::COLOR, "interface/theme/highlight_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - set("interface/theme/highlight_color", Color(0.5, 0.5, 0.6, 1)); + set("interface/theme/highlight_color", Color::html("#b79047")); hints["interface/theme/base_color"] = PropertyInfo(Variant::COLOR, "interface/theme/base_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); set("interface/theme/contrast", 0.2); hints["interface/theme/contrast"] = PropertyInfo(Variant::REAL, "interface/theme/contrast", PROPERTY_HINT_RANGE, "0.01, 1, 0.01"); diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 9968b730447..bf15f43d322 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -96,8 +96,32 @@ Ref create_editor_theme() { // Define colors Color highlight_color = EDITOR_DEF("interface/theme/highlight_color", Color::html("#b79047")); - Color base_color = EDITOR_DEF("interface/theme/base_color", Color::html("#213d4c")); + Color base_color = EDITOR_DEF("interface/theme/base_color", Color::html("#273241")); float contrast = EDITOR_DEF("interface/theme/contrast", 0.25); + int preset = EDITOR_DEF("interface/theme/preset", 0); + + switch (preset) { + case 0: { // Default + highlight_color = Color::html("#b79047"); + base_color = Color::html("#273241"); + contrast = 0.25; + } break; + case 1: { // Grey + highlight_color = Color::html("#3e3e3e"); + base_color = Color::html("#3d3d3d"); + contrast = 0.2; + } break; + case 2: { // Godot 2 + highlight_color = Color::html("#86ace2"); + base_color = Color::html("#3C3A44"); + contrast = 0.25; + } break; + case 3: { // Arc + highlight_color = Color::html("#68a7f2"); + base_color = Color::html("#434a59"); + contrast = 0.2; + } break; + } Color dark_color_1 = base_color.linear_interpolate(Color(0, 0, 0, 1), contrast); Color dark_color_2 = base_color.linear_interpolate(Color(0, 0, 0, 1), contrast * 1.5);