summaryrefslogtreecommitdiff
path: root/editor/editor_themes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_themes.cpp')
-rw-r--r--editor/editor_themes.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index 576ee436de..0ef173f074 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -337,24 +337,24 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
//Colors
bool dark_theme = EditorSettings::get_singleton()->is_dark_theme();
- const Color dark_color_1 = base_color.linear_interpolate(Color(0, 0, 0, 1), contrast);
- const Color dark_color_2 = base_color.linear_interpolate(Color(0, 0, 0, 1), contrast * 1.5);
- const Color dark_color_3 = base_color.linear_interpolate(Color(0, 0, 0, 1), contrast * 2);
+ const Color dark_color_1 = base_color.lerp(Color(0, 0, 0, 1), contrast);
+ const Color dark_color_2 = base_color.lerp(Color(0, 0, 0, 1), contrast * 1.5);
+ const Color dark_color_3 = base_color.lerp(Color(0, 0, 0, 1), contrast * 2);
const Color background_color = dark_color_2;
// white (dark theme) or black (light theme), will be used to generate the rest of the colors
const Color mono_color = dark_theme ? Color(1, 1, 1) : Color(0, 0, 0);
- const Color contrast_color_1 = base_color.linear_interpolate(mono_color, MAX(contrast, default_contrast));
- const Color contrast_color_2 = base_color.linear_interpolate(mono_color, MAX(contrast * 1.5, default_contrast * 1.5));
+ const Color contrast_color_1 = base_color.lerp(mono_color, MAX(contrast, default_contrast));
+ const Color contrast_color_2 = base_color.lerp(mono_color, MAX(contrast * 1.5, default_contrast * 1.5));
- const Color font_color = mono_color.linear_interpolate(base_color, 0.25);
- const Color font_color_hl = mono_color.linear_interpolate(base_color, 0.15);
+ const Color font_color = mono_color.lerp(base_color, 0.25);
+ const Color font_color_hl = mono_color.lerp(base_color, 0.15);
const Color font_color_disabled = Color(mono_color.r, mono_color.g, mono_color.b, 0.3);
const Color font_color_selection = accent_color * Color(1, 1, 1, 0.4);
- const Color color_disabled = mono_color.inverted().linear_interpolate(base_color, 0.7);
- const Color color_disabled_bg = mono_color.inverted().linear_interpolate(base_color, 0.9);
+ const Color color_disabled = mono_color.inverted().lerp(base_color, 0.7);
+ const Color color_disabled_bg = mono_color.inverted().lerp(base_color, 0.9);
Color icon_color_hover = Color(1, 1, 1) * (dark_theme ? 1.15 : 1.45);
icon_color_hover.a = 1.0;
@@ -391,13 +391,13 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
Color success_color = Color(0.45, 0.95, 0.5);
Color warning_color = Color(1, 0.87, 0.4);
Color error_color = Color(1, 0.47, 0.42);
- Color property_color = font_color.linear_interpolate(Color(0.5, 0.5, 0.5), 0.5);
+ Color property_color = font_color.lerp(Color(0.5, 0.5, 0.5), 0.5);
if (!dark_theme) {
// Darken some colors to be readable on a light background
- success_color = success_color.linear_interpolate(mono_color, 0.35);
- warning_color = warning_color.linear_interpolate(mono_color, 0.35);
- error_color = error_color.linear_interpolate(mono_color, 0.25);
+ success_color = success_color.lerp(mono_color, 0.35);
+ warning_color = warning_color.lerp(mono_color, 0.35);
+ error_color = error_color.lerp(mono_color, 0.25);
}
theme->set_color("success_color", "Editor", success_color);
@@ -434,7 +434,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
editor_register_fonts(theme);
// Highlighted tabs and border width
- Color tab_color = highlight_tabs ? base_color.linear_interpolate(font_color, contrast) : base_color;
+ Color tab_color = highlight_tabs ? base_color.lerp(font_color, contrast) : base_color;
const int border_width = CLAMP(border_size, 0, 3) * EDSCALE;
const int default_margin_size = 4;
@@ -686,7 +686,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_icon("visibility_xray", "PopupMenu", theme->get_icon("GuiVisibilityXray", "EditorIcons"));
theme->set_constant("vseparation", "PopupMenu", (extra_spacing + default_margin_size + 1) * EDSCALE);
- Ref<StyleBoxFlat> sub_inspector_bg = make_flat_stylebox(dark_color_1.linear_interpolate(accent_color, 0.08), 2, 0, 2, 2);
+ Ref<StyleBoxFlat> sub_inspector_bg = make_flat_stylebox(dark_color_1.lerp(accent_color, 0.08), 2, 0, 2, 2);
sub_inspector_bg->set_border_width(MARGIN_LEFT, 2);
sub_inspector_bg->set_border_width(MARGIN_RIGHT, 2);
sub_inspector_bg->set_border_width(MARGIN_BOTTOM, 2);
@@ -763,9 +763,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_stylebox("title_button_hover", "Tree", style_tree_title);
theme->set_stylebox("title_button_pressed", "Tree", style_tree_title);
- Color prop_category_color = dark_color_1.linear_interpolate(mono_color, 0.12);
- Color prop_section_color = dark_color_1.linear_interpolate(mono_color, 0.09);
- Color prop_subsection_color = dark_color_1.linear_interpolate(mono_color, 0.06);
+ Color prop_category_color = dark_color_1.lerp(mono_color, 0.12);
+ Color prop_section_color = dark_color_1.lerp(mono_color, 0.09);
+ Color prop_subsection_color = dark_color_1.lerp(mono_color, 0.06);
theme->set_color("prop_category", "Editor", prop_category_color);
theme->set_color("prop_section", "Editor", prop_section_color);
theme->set_color("prop_subsection", "Editor", prop_subsection_color);
@@ -1124,7 +1124,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_icon("toggle_hidden", "FileDialog", theme->get_icon("GuiVisibilityVisible", "EditorIcons"));
// Use a different color for folder icons to make them easier to distinguish from files.
// On a light theme, the icon will be dark, so we need to lighten it before blending it with the accent color.
- theme->set_color("folder_icon_modulate", "FileDialog", (dark_theme ? Color(1, 1, 1) : Color(4.25, 4.25, 4.25)).linear_interpolate(accent_color, 0.7));
+ theme->set_color("folder_icon_modulate", "FileDialog", (dark_theme ? Color(1, 1, 1) : Color(4.25, 4.25, 4.25)).lerp(accent_color, 0.7));
theme->set_color("files_disabled", "FileDialog", font_color_disabled);
// color picker
@@ -1158,13 +1158,13 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
// editor main color
const Color main_color = dark_theme ? Color(0.34, 0.7, 1.0) : Color(0.02, 0.5, 1.0);
- const Color symbol_color = Color(0.34, 0.57, 1.0).linear_interpolate(mono_color, dark_theme ? 0.5 : 0.3);
+ const Color symbol_color = Color(0.34, 0.57, 1.0).lerp(mono_color, dark_theme ? 0.5 : 0.3);
const Color keyword_color = Color(1.0, 0.44, 0.52);
const Color basetype_color = dark_theme ? Color(0.26, 1.0, 0.76) : Color(0.0, 0.76, 0.38);
- const Color type_color = basetype_color.linear_interpolate(mono_color, dark_theme ? 0.4 : 0.3);
- const Color usertype_color = basetype_color.linear_interpolate(mono_color, dark_theme ? 0.7 : 0.5);
+ const Color type_color = basetype_color.lerp(mono_color, dark_theme ? 0.4 : 0.3);
+ const Color usertype_color = basetype_color.lerp(mono_color, dark_theme ? 0.7 : 0.5);
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)).linear_interpolate(mono_color, dark_theme ? 0.5 : 0.3);
+ 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;
const Color completion_background_color = dark_theme ? base_color : background_color;
@@ -1183,9 +1183,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
const Color current_line_color = alpha1;
const Color line_length_guideline_color = dark_theme ? base_color : background_color;
const Color word_highlighted_color = alpha1;
- const Color number_color = basetype_color.linear_interpolate(mono_color, dark_theme ? 0.5 : 0.3);
+ const Color number_color = basetype_color.lerp(mono_color, dark_theme ? 0.5 : 0.3);
const Color function_color = main_color;
- const Color member_variable_color = main_color.linear_interpolate(mono_color, 0.6);
+ const Color member_variable_color = main_color.lerp(mono_color, 0.6);
const Color mark_color = Color(error_color.r, error_color.g, error_color.b, 0.3);
const Color bookmark_color = Color(0.08, 0.49, 0.98);
const Color breakpoint_color = error_color;