2023-11-13 20:48:05 +00:00
|
|
|
use std::sync::Arc;
|
|
|
|
|
2024-03-29 15:10:47 +00:00
|
|
|
use gpui::{hsla, FontStyle, FontWeight, HighlightStyle, WindowBackgroundAppearance};
|
2023-11-13 20:48:05 +00:00
|
|
|
|
|
|
|
use crate::{
|
2024-05-23 13:50:59 +00:00
|
|
|
default_color_scales, AccentColors, Appearance, PlayerColors, StatusColors, SyntaxTheme,
|
|
|
|
SystemColors, Theme, ThemeColors, ThemeFamily, ThemeStyles,
|
2023-11-13 20:48:05 +00:00
|
|
|
};
|
|
|
|
|
2024-10-03 17:17:31 +00:00
|
|
|
/// The default theme family for Zed.
|
|
|
|
///
|
|
|
|
/// This is used to construct the default theme fallback values, as well as to
|
|
|
|
/// have a theme available at compile time for tests.
|
|
|
|
pub fn zed_default_themes() -> ThemeFamily {
|
2023-11-13 20:48:05 +00:00
|
|
|
ThemeFamily {
|
2024-10-03 17:17:31 +00:00
|
|
|
id: "zed-default".to_string(),
|
|
|
|
name: "Zed Default".into(),
|
2023-11-13 20:48:05 +00:00
|
|
|
author: "".into(),
|
2024-10-03 17:17:31 +00:00
|
|
|
themes: vec![zed_default_dark()],
|
2023-11-13 20:48:05 +00:00
|
|
|
scales: default_color_scales(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-10-03 17:17:31 +00:00
|
|
|
pub(crate) fn zed_default_dark() -> Theme {
|
2023-11-13 22:09:55 +00:00
|
|
|
let bg = hsla(215. / 360., 12. / 100., 15. / 100., 1.);
|
|
|
|
let editor = hsla(220. / 360., 12. / 100., 18. / 100., 1.);
|
2023-11-20 15:46:23 +00:00
|
|
|
let elevated_surface = hsla(225. / 360., 12. / 100., 17. / 100., 1.);
|
2023-11-13 20:48:05 +00:00
|
|
|
|
2023-11-13 22:09:55 +00:00
|
|
|
let blue = hsla(207.8 / 360., 81. / 100., 66. / 100., 1.0);
|
|
|
|
let gray = hsla(218.8 / 360., 10. / 100., 40. / 100., 1.0);
|
|
|
|
let green = hsla(95. / 360., 38. / 100., 62. / 100., 1.0);
|
|
|
|
let orange = hsla(29. / 360., 54. / 100., 61. / 100., 1.0);
|
|
|
|
let purple = hsla(286. / 360., 51. / 100., 64. / 100., 1.0);
|
|
|
|
let red = hsla(355. / 360., 65. / 100., 65. / 100., 1.0);
|
|
|
|
let teal = hsla(187. / 360., 47. / 100., 55. / 100., 1.0);
|
|
|
|
let yellow = hsla(39. / 360., 67. / 100., 69. / 100., 1.0);
|
2023-11-13 20:48:05 +00:00
|
|
|
|
|
|
|
Theme {
|
|
|
|
id: "one_dark".to_string(),
|
|
|
|
name: "One Dark".into(),
|
|
|
|
appearance: Appearance::Dark,
|
|
|
|
styles: ThemeStyles {
|
2024-03-29 15:10:47 +00:00
|
|
|
window_background_appearance: WindowBackgroundAppearance::Opaque,
|
2023-11-13 20:48:05 +00:00
|
|
|
system: SystemColors::default(),
|
2024-05-23 13:50:59 +00:00
|
|
|
accents: AccentColors(vec![blue, orange, purple, teal, red, green, yellow]),
|
2023-11-13 20:48:05 +00:00
|
|
|
colors: ThemeColors {
|
|
|
|
border: hsla(225. / 360., 13. / 100., 12. / 100., 1.),
|
|
|
|
border_variant: hsla(228. / 360., 8. / 100., 25. / 100., 1.),
|
|
|
|
border_focused: hsla(223. / 360., 78. / 100., 65. / 100., 1.),
|
|
|
|
border_selected: hsla(222.6 / 360., 77.5 / 100., 65.1 / 100., 1.0),
|
|
|
|
border_transparent: SystemColors::default().transparent,
|
|
|
|
border_disabled: hsla(222.0 / 360., 11.6 / 100., 33.7 / 100., 1.0),
|
2023-11-13 22:38:44 +00:00
|
|
|
elevated_surface_background: elevated_surface,
|
2023-11-13 20:48:05 +00:00
|
|
|
surface_background: bg,
|
|
|
|
background: bg,
|
2023-11-20 15:46:23 +00:00
|
|
|
element_background: hsla(223.0 / 360., 13. / 100., 21. / 100., 1.0),
|
2023-11-13 20:48:05 +00:00
|
|
|
element_hover: hsla(225.0 / 360., 11.8 / 100., 26.7 / 100., 1.0),
|
|
|
|
element_active: hsla(220.0 / 360., 11.8 / 100., 20.0 / 100., 1.0),
|
|
|
|
element_selected: hsla(224.0 / 360., 11.3 / 100., 26.1 / 100., 1.0),
|
2023-12-04 14:37:56 +00:00
|
|
|
element_disabled: SystemColors::default().transparent,
|
2023-11-13 20:48:05 +00:00
|
|
|
drop_target_background: hsla(220.0 / 360., 8.3 / 100., 21.4 / 100., 1.0),
|
|
|
|
ghost_element_background: SystemColors::default().transparent,
|
|
|
|
ghost_element_hover: hsla(225.0 / 360., 11.8 / 100., 26.7 / 100., 1.0),
|
|
|
|
ghost_element_active: hsla(220.0 / 360., 11.8 / 100., 20.0 / 100., 1.0),
|
|
|
|
ghost_element_selected: hsla(224.0 / 360., 11.3 / 100., 26.1 / 100., 1.0),
|
2023-12-04 14:37:56 +00:00
|
|
|
ghost_element_disabled: SystemColors::default().transparent,
|
2023-11-24 21:57:35 +00:00
|
|
|
text: hsla(221. / 360., 11. / 100., 86. / 100., 1.0),
|
|
|
|
text_muted: hsla(218.0 / 360., 7. / 100., 46. / 100., 1.0),
|
2023-11-13 20:48:05 +00:00
|
|
|
text_placeholder: hsla(220.0 / 360., 6.6 / 100., 44.5 / 100., 1.0),
|
|
|
|
text_disabled: hsla(220.0 / 360., 6.6 / 100., 44.5 / 100., 1.0),
|
|
|
|
text_accent: hsla(222.6 / 360., 77.5 / 100., 65.1 / 100., 1.0),
|
|
|
|
icon: hsla(222.9 / 360., 9.9 / 100., 86.1 / 100., 1.0),
|
|
|
|
icon_muted: hsla(220.0 / 360., 12.1 / 100., 66.1 / 100., 1.0),
|
|
|
|
icon_disabled: hsla(220.0 / 360., 6.4 / 100., 45.7 / 100., 1.0),
|
|
|
|
icon_placeholder: hsla(220.0 / 360., 6.4 / 100., 45.7 / 100., 1.0),
|
2024-03-02 16:11:08 +00:00
|
|
|
icon_accent: blue,
|
2023-11-13 20:48:05 +00:00
|
|
|
status_bar_background: bg,
|
|
|
|
title_bar_background: bg,
|
2024-08-02 22:44:22 +00:00
|
|
|
title_bar_inactive_background: bg,
|
2023-11-13 20:48:05 +00:00
|
|
|
toolbar_background: editor,
|
|
|
|
tab_bar_background: bg,
|
|
|
|
tab_inactive_background: bg,
|
|
|
|
tab_active_background: editor,
|
2024-01-12 15:37:18 +00:00
|
|
|
search_match_background: bg,
|
2023-11-29 22:38:27 +00:00
|
|
|
|
2023-11-13 20:48:05 +00:00
|
|
|
editor_background: editor,
|
|
|
|
editor_gutter_background: editor,
|
|
|
|
editor_subheader_background: bg,
|
|
|
|
editor_active_line_background: hsla(222.9 / 360., 13.5 / 100., 20.4 / 100., 1.0),
|
2023-11-13 22:09:55 +00:00
|
|
|
editor_highlighted_line_background: hsla(207.8 / 360., 81. / 100., 66. / 100., 0.1),
|
2023-11-13 20:48:05 +00:00
|
|
|
editor_line_number: hsla(222.0 / 360., 11.5 / 100., 34.1 / 100., 1.0),
|
|
|
|
editor_active_line_number: hsla(216.0 / 360., 5.9 / 100., 49.6 / 100., 1.0),
|
|
|
|
editor_invisible: hsla(222.0 / 360., 11.5 / 100., 34.1 / 100., 1.0),
|
2023-12-18 16:16:00 +00:00
|
|
|
editor_wrap_guide: hsla(228. / 360., 8. / 100., 25. / 100., 1.),
|
|
|
|
editor_active_wrap_guide: hsla(228. / 360., 8. / 100., 25. / 100., 1.),
|
2024-05-23 13:50:59 +00:00
|
|
|
editor_indent_guide: hsla(228. / 360., 8. / 100., 25. / 100., 1.),
|
|
|
|
editor_indent_guide_active: hsla(225. / 360., 13. / 100., 12. / 100., 1.),
|
2023-11-13 22:09:55 +00:00
|
|
|
editor_document_highlight_read_background: hsla(
|
|
|
|
207.8 / 360.,
|
|
|
|
81. / 100.,
|
|
|
|
66. / 100.,
|
|
|
|
0.2,
|
|
|
|
),
|
2023-11-13 20:48:05 +00:00
|
|
|
editor_document_highlight_write_background: gpui::red(),
|
2024-09-26 16:48:23 +00:00
|
|
|
editor_document_highlight_bracket_background: gpui::green(),
|
2023-11-29 22:38:27 +00:00
|
|
|
|
2023-11-13 20:48:05 +00:00
|
|
|
terminal_background: bg,
|
2024-03-01 01:19:05 +00:00
|
|
|
// todo("Use one colors for terminal")
|
2024-09-17 16:51:31 +00:00
|
|
|
terminal_ansi_background: crate::black().dark().step_12(),
|
2024-01-19 19:22:53 +00:00
|
|
|
terminal_foreground: crate::white().dark().step_12(),
|
|
|
|
terminal_bright_foreground: crate::white().dark().step_11(),
|
|
|
|
terminal_dim_foreground: crate::white().dark().step_10(),
|
2023-11-13 22:09:55 +00:00
|
|
|
terminal_ansi_black: crate::black().dark().step_12(),
|
|
|
|
terminal_ansi_red: crate::red().dark().step_11(),
|
|
|
|
terminal_ansi_green: crate::green().dark().step_11(),
|
|
|
|
terminal_ansi_yellow: crate::yellow().dark().step_11(),
|
|
|
|
terminal_ansi_blue: crate::blue().dark().step_11(),
|
|
|
|
terminal_ansi_magenta: crate::violet().dark().step_11(),
|
|
|
|
terminal_ansi_cyan: crate::cyan().dark().step_11(),
|
|
|
|
terminal_ansi_white: crate::neutral().dark().step_12(),
|
|
|
|
terminal_ansi_bright_black: crate::black().dark().step_11(),
|
|
|
|
terminal_ansi_bright_red: crate::red().dark().step_10(),
|
|
|
|
terminal_ansi_bright_green: crate::green().dark().step_10(),
|
|
|
|
terminal_ansi_bright_yellow: crate::yellow().dark().step_10(),
|
|
|
|
terminal_ansi_bright_blue: crate::blue().dark().step_10(),
|
|
|
|
terminal_ansi_bright_magenta: crate::violet().dark().step_10(),
|
|
|
|
terminal_ansi_bright_cyan: crate::cyan().dark().step_10(),
|
|
|
|
terminal_ansi_bright_white: crate::neutral().dark().step_11(),
|
2024-01-19 19:22:53 +00:00
|
|
|
terminal_ansi_dim_black: crate::black().dark().step_10(),
|
|
|
|
terminal_ansi_dim_red: crate::red().dark().step_9(),
|
|
|
|
terminal_ansi_dim_green: crate::green().dark().step_9(),
|
|
|
|
terminal_ansi_dim_yellow: crate::yellow().dark().step_9(),
|
|
|
|
terminal_ansi_dim_blue: crate::blue().dark().step_9(),
|
|
|
|
terminal_ansi_dim_magenta: crate::violet().dark().step_9(),
|
|
|
|
terminal_ansi_dim_cyan: crate::cyan().dark().step_9(),
|
|
|
|
terminal_ansi_dim_white: crate::neutral().dark().step_10(),
|
2023-12-11 16:43:49 +00:00
|
|
|
panel_background: bg,
|
|
|
|
panel_focused_border: blue,
|
2024-10-24 11:07:20 +00:00
|
|
|
panel_indent_guide: hsla(228. / 360., 8. / 100., 25. / 100., 1.),
|
|
|
|
panel_indent_guide_hover: hsla(225. / 360., 13. / 100., 12. / 100., 1.),
|
|
|
|
panel_indent_guide_active: hsla(225. / 360., 13. / 100., 12. / 100., 1.),
|
2023-12-11 16:43:49 +00:00
|
|
|
pane_focused_border: blue,
|
2024-04-01 16:07:26 +00:00
|
|
|
pane_group_border: hsla(225. / 360., 13. / 100., 12. / 100., 1.),
|
2023-12-11 16:43:49 +00:00
|
|
|
scrollbar_thumb_background: gpui::transparent_black(),
|
|
|
|
scrollbar_thumb_hover_background: hsla(225.0 / 360., 11.8 / 100., 26.7 / 100., 1.0),
|
|
|
|
scrollbar_thumb_border: hsla(228. / 360., 8. / 100., 25. / 100., 1.),
|
|
|
|
scrollbar_track_background: gpui::transparent_black(),
|
|
|
|
scrollbar_track_border: hsla(228. / 360., 8. / 100., 25. / 100., 1.),
|
|
|
|
editor_foreground: hsla(218. / 360., 14. / 100., 71. / 100., 1.),
|
|
|
|
link_text_hover: blue,
|
2023-11-13 22:09:55 +00:00
|
|
|
},
|
|
|
|
status: StatusColors {
|
|
|
|
conflict: yellow,
|
2024-01-02 21:37:55 +00:00
|
|
|
conflict_background: yellow,
|
|
|
|
conflict_border: yellow,
|
2023-11-13 22:09:55 +00:00
|
|
|
created: green,
|
2024-01-02 21:37:55 +00:00
|
|
|
created_background: green,
|
|
|
|
created_border: green,
|
2023-11-13 22:09:55 +00:00
|
|
|
deleted: red,
|
2024-01-02 21:37:55 +00:00
|
|
|
deleted_background: red,
|
|
|
|
deleted_border: red,
|
2023-11-13 22:09:55 +00:00
|
|
|
error: red,
|
2024-01-02 21:37:55 +00:00
|
|
|
error_background: red,
|
|
|
|
error_border: red,
|
2023-11-13 22:09:55 +00:00
|
|
|
hidden: gray,
|
2024-01-02 21:37:55 +00:00
|
|
|
hidden_background: gray,
|
|
|
|
hidden_border: gray,
|
2023-11-13 22:09:55 +00:00
|
|
|
hint: blue,
|
2024-01-02 21:37:55 +00:00
|
|
|
hint_background: blue,
|
|
|
|
hint_border: blue,
|
2023-11-13 22:09:55 +00:00
|
|
|
ignored: gray,
|
2024-01-02 21:37:55 +00:00
|
|
|
ignored_background: gray,
|
|
|
|
ignored_border: gray,
|
2023-11-13 22:09:55 +00:00
|
|
|
info: blue,
|
2024-01-02 21:37:55 +00:00
|
|
|
info_background: blue,
|
|
|
|
info_border: blue,
|
2023-11-13 22:09:55 +00:00
|
|
|
modified: yellow,
|
2024-01-02 21:37:55 +00:00
|
|
|
modified_background: yellow,
|
|
|
|
modified_border: yellow,
|
2023-11-13 22:09:55 +00:00
|
|
|
predictive: gray,
|
2024-01-02 21:37:55 +00:00
|
|
|
predictive_background: gray,
|
|
|
|
predictive_border: gray,
|
2023-11-13 22:09:55 +00:00
|
|
|
renamed: blue,
|
2024-01-02 21:37:55 +00:00
|
|
|
renamed_background: blue,
|
|
|
|
renamed_border: blue,
|
2023-11-13 22:09:55 +00:00
|
|
|
success: green,
|
2024-01-02 21:37:55 +00:00
|
|
|
success_background: green,
|
|
|
|
success_border: green,
|
2023-11-13 22:09:55 +00:00
|
|
|
unreachable: gray,
|
2024-01-02 21:37:55 +00:00
|
|
|
unreachable_background: gray,
|
|
|
|
unreachable_border: gray,
|
2023-11-13 22:09:55 +00:00
|
|
|
warning: yellow,
|
2024-01-02 21:37:55 +00:00
|
|
|
warning_background: yellow,
|
|
|
|
warning_border: yellow,
|
2023-11-13 20:48:05 +00:00
|
|
|
},
|
|
|
|
player: PlayerColors::dark(),
|
2023-11-13 22:09:55 +00:00
|
|
|
syntax: Arc::new(SyntaxTheme {
|
|
|
|
highlights: vec![
|
|
|
|
("attribute".into(), purple.into()),
|
|
|
|
("boolean".into(), orange.into()),
|
|
|
|
("comment".into(), gray.into()),
|
|
|
|
("comment.doc".into(), gray.into()),
|
|
|
|
("constant".into(), yellow.into()),
|
|
|
|
("constructor".into(), blue.into()),
|
|
|
|
("embedded".into(), HighlightStyle::default()),
|
|
|
|
(
|
|
|
|
"emphasis".into(),
|
|
|
|
HighlightStyle {
|
|
|
|
font_style: Some(FontStyle::Italic),
|
|
|
|
..HighlightStyle::default()
|
|
|
|
},
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"emphasis.strong".into(),
|
|
|
|
HighlightStyle {
|
|
|
|
font_weight: Some(FontWeight::BOLD),
|
|
|
|
..HighlightStyle::default()
|
|
|
|
},
|
|
|
|
),
|
|
|
|
("enum".into(), HighlightStyle::default()),
|
|
|
|
("function".into(), blue.into()),
|
|
|
|
("function.method".into(), blue.into()),
|
|
|
|
("function.definition".into(), blue.into()),
|
|
|
|
("hint".into(), blue.into()),
|
|
|
|
("keyword".into(), purple.into()),
|
|
|
|
("label".into(), HighlightStyle::default()),
|
|
|
|
("link_text".into(), blue.into()),
|
|
|
|
(
|
|
|
|
"link_uri".into(),
|
|
|
|
HighlightStyle {
|
2024-03-02 16:11:08 +00:00
|
|
|
color: Some(teal),
|
2023-11-13 22:09:55 +00:00
|
|
|
font_style: Some(FontStyle::Italic),
|
|
|
|
..HighlightStyle::default()
|
|
|
|
},
|
|
|
|
),
|
|
|
|
("number".into(), orange.into()),
|
|
|
|
("operator".into(), HighlightStyle::default()),
|
|
|
|
("predictive".into(), HighlightStyle::default()),
|
|
|
|
("preproc".into(), HighlightStyle::default()),
|
|
|
|
("primary".into(), HighlightStyle::default()),
|
|
|
|
("property".into(), red.into()),
|
|
|
|
("punctuation".into(), HighlightStyle::default()),
|
|
|
|
("punctuation.bracket".into(), HighlightStyle::default()),
|
|
|
|
("punctuation.delimiter".into(), HighlightStyle::default()),
|
|
|
|
("punctuation.list_marker".into(), HighlightStyle::default()),
|
|
|
|
("punctuation.special".into(), HighlightStyle::default()),
|
|
|
|
("string".into(), green.into()),
|
|
|
|
("string.escape".into(), HighlightStyle::default()),
|
|
|
|
("string.regex".into(), red.into()),
|
|
|
|
("string.special".into(), HighlightStyle::default()),
|
|
|
|
("string.special.symbol".into(), HighlightStyle::default()),
|
|
|
|
("tag".into(), HighlightStyle::default()),
|
|
|
|
("text.literal".into(), HighlightStyle::default()),
|
|
|
|
("title".into(), HighlightStyle::default()),
|
|
|
|
("type".into(), teal.into()),
|
|
|
|
("variable".into(), HighlightStyle::default()),
|
|
|
|
("variable.special".into(), red.into()),
|
|
|
|
("variant".into(), HighlightStyle::default()),
|
|
|
|
],
|
|
|
|
}),
|
2023-11-13 20:48:05 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|