summaryrefslogtreecommitdiff
path: root/editor/editor_settings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_settings.cpp')
-rw-r--r--editor/editor_settings.cpp41
1 files changed, 24 insertions, 17 deletions
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index 98bdef2fc1..ff644ad126 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -568,40 +568,39 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
}
void EditorSettings::_load_default_text_editor_theme() {
- _initial_set("text_editor/highlighting/background_color", Color::html("3b000000"));
+
+ bool dark_theme = is_dark_theme();
+
+ _initial_set("text_editor/highlighting/symbol_color", Color::html("badfff"));
+ _initial_set("text_editor/highlighting/keyword_color", Color::html("ffffb3"));
+ _initial_set("text_editor/highlighting/base_type_color", Color::html("a4ffd4"));
+ _initial_set("text_editor/highlighting/engine_type_color", Color::html("83d3ff"));
+ _initial_set("text_editor/highlighting/comment_color", Color::html("676767"));
+ _initial_set("text_editor/highlighting/string_color", Color::html("ef6ebe"));
+ _initial_set("text_editor/highlighting/background_color", dark_theme ? Color::html("3b000000") : Color::html("#323b4f"));
_initial_set("text_editor/highlighting/completion_background_color", Color::html("2C2A32"));
_initial_set("text_editor/highlighting/completion_selected_color", Color::html("434244"));
_initial_set("text_editor/highlighting/completion_existing_color", Color::html("21dfdfdf"));
_initial_set("text_editor/highlighting/completion_scroll_color", Color::html("ffffff"));
_initial_set("text_editor/highlighting/completion_font_color", Color::html("aaaaaa"));
+ _initial_set("text_editor/highlighting/text_color", Color::html("aaaaaa"));
+ _initial_set("text_editor/highlighting/line_number_color", Color::html("66aaaaaa"));
_initial_set("text_editor/highlighting/caret_color", Color::html("aaaaaa"));
_initial_set("text_editor/highlighting/caret_background_color", Color::html("000000"));
- _initial_set("text_editor/highlighting/line_number_color", Color::html("66aaaaaa"));
- _initial_set("text_editor/highlighting/text_color", Color::html("aaaaaa"));
_initial_set("text_editor/highlighting/text_selected_color", Color::html("000000"));
- _initial_set("text_editor/highlighting/keyword_color", Color::html("ffffb3"));
- _initial_set("text_editor/highlighting/base_type_color", Color::html("a4ffd4"));
- _initial_set("text_editor/highlighting/engine_type_color", Color::html("83d3ff"));
- _initial_set("text_editor/highlighting/function_color", Color::html("66a2ce"));
- _initial_set("text_editor/highlighting/member_variable_color", Color::html("e64e59"));
- _initial_set("text_editor/highlighting/comment_color", Color::html("676767"));
- _initial_set("text_editor/highlighting/string_color", Color::html("ef6ebe"));
- _initial_set("text_editor/highlighting/number_color", Color::html("EB9532"));
- _initial_set("text_editor/highlighting/symbol_color", Color::html("badfff"));
_initial_set("text_editor/highlighting/selection_color", Color::html("6ca9c2"));
_initial_set("text_editor/highlighting/brace_mismatch_color", Color(1, 0.2, 0.2));
_initial_set("text_editor/highlighting/current_line_color", Color(0.3, 0.5, 0.8, 0.15));
_initial_set("text_editor/highlighting/line_length_guideline_color", Color(0.3, 0.5, 0.8, 0.1));
+ _initial_set("text_editor/highlighting/word_highlighted_color", Color(0.8, 0.9, 0.9, 0.15));
+ _initial_set("text_editor/highlighting/number_color", Color::html("EB9532"));
+ _initial_set("text_editor/highlighting/function_color", Color::html("66a2ce"));
+ _initial_set("text_editor/highlighting/member_variable_color", Color::html("e64e59"));
_initial_set("text_editor/highlighting/mark_color", Color(1.0, 0.4, 0.4, 0.4));
_initial_set("text_editor/highlighting/breakpoint_color", Color(0.8, 0.8, 0.4, 0.2));
_initial_set("text_editor/highlighting/code_folding_color", Color(0.8, 0.8, 0.8, 0.8));
- _initial_set("text_editor/highlighting/word_highlighted_color", Color(0.8, 0.9, 0.9, 0.15));
_initial_set("text_editor/highlighting/search_result_color", Color(0.05, 0.25, 0.05, 1));
_initial_set("text_editor/highlighting/search_result_border_color", Color(0.1, 0.45, 0.1, 1));
-
- // GDScript highlighter
- _initial_set("text_editor/highlighting/gdscript/function_definition_color", Color::html("#01e1ff"));
- _initial_set("text_editor/highlighting/gdscript/node_path_color", Color::html("#64c15a"));
}
bool EditorSettings::_save_text_editor_theme(String p_file) {
@@ -1193,6 +1192,14 @@ void EditorSettings::load_favorites() {
}
}
+bool EditorSettings::is_dark_theme() {
+ int AUTO_COLOR = 0;
+ int LIGHT_COLOR = 2;
+ Color base_color = get("interface/theme/base_color");
+ int icon_font_color_setting = get("interface/theme/icon_and_font_color");
+ return (icon_font_color_setting == AUTO_COLOR && ((base_color.r + base_color.g + base_color.b) / 3.0) < 0.5) || icon_font_color_setting == LIGHT_COLOR;
+}
+
void EditorSettings::list_text_editor_themes() {
String themes = "Adaptive,Default,Custom";
DirAccess *d = DirAccess::open(get_text_editor_themes_dir());