From e505fb330ccbe819df4af3b513a0ef225cf720ec Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Wed, 8 Nov 2023 16:43:32 -0500 Subject: [PATCH 01/76] WIP --- crates/theme2/src/default_colors.rs | 128 +++++++++++++-------------- crates/theme2/src/scale.rs | 2 + crates/ui2/src/components/tooltip.rs | 4 +- 3 files changed, 68 insertions(+), 66 deletions(-) diff --git a/crates/theme2/src/default_colors.rs b/crates/theme2/src/default_colors.rs index ec57538e8f710e813ebcbb3ee5e7cb3083ccd895..2b3fc5ada112e7f39cf84255eb888b19ab191ed1 100644 --- a/crates/theme2/src/default_colors.rs +++ b/crates/theme2/src/default_colors.rs @@ -102,7 +102,7 @@ impl PlayerColors { } fn neutral() -> ColorScaleSet { - slate() + olive() } impl Default for SystemColors { @@ -142,24 +142,24 @@ impl SyntaxTheme { ("boolean".into(), tomato().light().step_11().into()), ("comment".into(), neutral().light().step_11().into()), ("comment.doc".into(), iris().light().step_12().into()), - ("constant".into(), red().light().step_7().into()), - ("constructor".into(), red().light().step_7().into()), - ("embedded".into(), red().light().step_7().into()), - ("emphasis".into(), red().light().step_7().into()), - ("emphasis.strong".into(), red().light().step_7().into()), - ("enum".into(), red().light().step_7().into()), - ("function".into(), red().light().step_7().into()), - ("hint".into(), red().light().step_7().into()), + ("constant".into(), red().light().step_9().into()), + ("constructor".into(), red().light().step_9().into()), + ("embedded".into(), red().light().step_9().into()), + ("emphasis".into(), red().light().step_9().into()), + ("emphasis.strong".into(), red().light().step_9().into()), + ("enum".into(), red().light().step_9().into()), + ("function".into(), red().light().step_9().into()), + ("hint".into(), red().light().step_9().into()), ("keyword".into(), orange().light().step_11().into()), - ("label".into(), red().light().step_7().into()), - ("link_text".into(), red().light().step_7().into()), - ("link_uri".into(), red().light().step_7().into()), - ("number".into(), red().light().step_7().into()), - ("operator".into(), red().light().step_7().into()), - ("predictive".into(), red().light().step_7().into()), - ("preproc".into(), red().light().step_7().into()), - ("primary".into(), red().light().step_7().into()), - ("property".into(), red().light().step_7().into()), + ("label".into(), red().light().step_9().into()), + ("link_text".into(), red().light().step_9().into()), + ("link_uri".into(), red().light().step_9().into()), + ("number".into(), red().light().step_9().into()), + ("operator".into(), red().light().step_9().into()), + ("predictive".into(), red().light().step_9().into()), + ("preproc".into(), red().light().step_9().into()), + ("primary".into(), red().light().step_9().into()), + ("property".into(), red().light().step_9().into()), ("punctuation".into(), neutral().light().step_11().into()), ( "punctuation.bracket".into(), @@ -173,22 +173,22 @@ impl SyntaxTheme { "punctuation.list_marker".into(), blue().light().step_11().into(), ), - ("punctuation.special".into(), red().light().step_7().into()), + ("punctuation.special".into(), red().light().step_9().into()), ("string".into(), jade().light().step_11().into()), - ("string.escape".into(), red().light().step_7().into()), + ("string.escape".into(), red().light().step_9().into()), ("string.regex".into(), tomato().light().step_11().into()), - ("string.special".into(), red().light().step_7().into()), + ("string.special".into(), red().light().step_9().into()), ( "string.special.symbol".into(), - red().light().step_7().into(), + red().light().step_9().into(), ), - ("tag".into(), red().light().step_7().into()), - ("text.literal".into(), red().light().step_7().into()), - ("title".into(), red().light().step_7().into()), - ("type".into(), red().light().step_7().into()), - ("variable".into(), red().light().step_7().into()), - ("variable.special".into(), red().light().step_7().into()), - ("variant".into(), red().light().step_7().into()), + ("tag".into(), red().light().step_9().into()), + ("text.literal".into(), red().light().step_9().into()), + ("title".into(), red().light().step_9().into()), + ("type".into(), red().light().step_9().into()), + ("variable".into(), red().light().step_9().into()), + ("variable.special".into(), red().light().step_9().into()), + ("variant".into(), red().light().step_9().into()), ], inlay_style: tomato().light().step_1().into(), // todo!("nate: use a proper style") suggestion_style: orange().light().step_1().into(), // todo!("nate: use proper style") @@ -202,24 +202,24 @@ impl SyntaxTheme { ("boolean".into(), tomato().dark().step_11().into()), ("comment".into(), neutral().dark().step_11().into()), ("comment.doc".into(), iris().dark().step_12().into()), - ("constant".into(), red().dark().step_7().into()), - ("constructor".into(), red().dark().step_7().into()), - ("embedded".into(), red().dark().step_7().into()), - ("emphasis".into(), red().dark().step_7().into()), - ("emphasis.strong".into(), red().dark().step_7().into()), - ("enum".into(), red().dark().step_7().into()), - ("function".into(), red().dark().step_7().into()), - ("hint".into(), red().dark().step_7().into()), + ("constant".into(), red().dark().step_9().into()), + ("constructor".into(), red().dark().step_9().into()), + ("embedded".into(), red().dark().step_9().into()), + ("emphasis".into(), red().dark().step_9().into()), + ("emphasis.strong".into(), red().dark().step_9().into()), + ("enum".into(), red().dark().step_9().into()), + ("function".into(), red().dark().step_9().into()), + ("hint".into(), red().dark().step_9().into()), ("keyword".into(), orange().dark().step_11().into()), - ("label".into(), red().dark().step_7().into()), - ("link_text".into(), red().dark().step_7().into()), - ("link_uri".into(), red().dark().step_7().into()), - ("number".into(), red().dark().step_7().into()), - ("operator".into(), red().dark().step_7().into()), - ("predictive".into(), red().dark().step_7().into()), - ("preproc".into(), red().dark().step_7().into()), - ("primary".into(), red().dark().step_7().into()), - ("property".into(), red().dark().step_7().into()), + ("label".into(), red().dark().step_9().into()), + ("link_text".into(), red().dark().step_9().into()), + ("link_uri".into(), red().dark().step_9().into()), + ("number".into(), red().dark().step_9().into()), + ("operator".into(), red().dark().step_9().into()), + ("predictive".into(), red().dark().step_9().into()), + ("preproc".into(), red().dark().step_9().into()), + ("primary".into(), red().dark().step_9().into()), + ("property".into(), red().dark().step_9().into()), ("punctuation".into(), neutral().dark().step_11().into()), ( "punctuation.bracket".into(), @@ -233,19 +233,19 @@ impl SyntaxTheme { "punctuation.list_marker".into(), blue().dark().step_11().into(), ), - ("punctuation.special".into(), red().dark().step_7().into()), + ("punctuation.special".into(), red().dark().step_9().into()), ("string".into(), jade().dark().step_11().into()), - ("string.escape".into(), red().dark().step_7().into()), + ("string.escape".into(), red().dark().step_9().into()), ("string.regex".into(), tomato().dark().step_11().into()), - ("string.special".into(), red().dark().step_7().into()), - ("string.special.symbol".into(), red().dark().step_7().into()), - ("tag".into(), red().dark().step_7().into()), - ("text.literal".into(), red().dark().step_7().into()), - ("title".into(), red().dark().step_7().into()), - ("type".into(), red().dark().step_7().into()), - ("variable".into(), red().dark().step_7().into()), - ("variable.special".into(), red().dark().step_7().into()), - ("variant".into(), red().dark().step_7().into()), + ("string.special".into(), red().dark().step_9().into()), + ("string.special.symbol".into(), red().dark().step_9().into()), + ("tag".into(), red().dark().step_9().into()), + ("text.literal".into(), red().dark().step_9().into()), + ("title".into(), red().dark().step_9().into()), + ("type".into(), red().dark().step_9().into()), + ("variable".into(), red().dark().step_9().into()), + ("variable.special".into(), red().dark().step_9().into()), + ("variant".into(), red().dark().step_9().into()), ], inlay_style: tomato().dark().step_1().into(), // todo!("nate: use a proper style") suggestion_style: orange().dark().step_1().into(), // todo!("nate: use a proper style") @@ -278,7 +278,7 @@ impl ThemeColors { ghost_element_active: neutral().light().step_5(), ghost_element_selected: neutral().light().step_5(), ghost_element_disabled: neutral().light_alpha().step_3(), - text: neutral().light().step_12(), + text: yellow().light().step_9(), text_muted: neutral().light().step_11(), text_placeholder: neutral().light().step_10(), text_disabled: neutral().light().step_9(), @@ -350,8 +350,8 @@ impl ThemeColors { ghost_element_active: neutral().dark().step_5(), ghost_element_selected: neutral().dark().step_5(), ghost_element_disabled: neutral().dark_alpha().step_3(), - text: neutral().dark().step_12(), - text_muted: neutral().dark().step_11(), + text: green().dark().step_9(), + text_muted: blue().dark().step_9(), text_placeholder: neutral().dark().step_10(), text_disabled: neutral().dark().step_9(), text_accent: blue().dark().step_11(), @@ -367,11 +367,11 @@ impl ThemeColors { tab_active_background: neutral().dark().step_1(), tab_inactive_background: neutral().dark().step_2(), editor_background: neutral().dark().step_1(), - editor_gutter_background: neutral().dark().step_1(), // todo!("pick the right colors") - editor_subheader_background: neutral().dark().step_2(), + editor_gutter_background: neutral().dark().step_1(), + editor_subheader_background: neutral().dark().step_3(), editor_active_line_background: neutral().dark_alpha().step_3(), - editor_line_number: neutral().dark_alpha().step_3(), // todo!("pick the right colors") - editor_active_line_number: neutral().dark_alpha().step_3(), // todo!("pick the right colors") + editor_line_number: neutral().dark_alpha().step_10(), + editor_active_line_number: neutral().dark_alpha().step_12(), editor_highlighted_line_background: neutral().dark_alpha().step_4(), // todo!("pick the right colors") editor_invisible: neutral().dark_alpha().step_4(), // todo!("pick the right colors") editor_wrap_guide: neutral().dark_alpha().step_4(), // todo!("pick the right colors") diff --git a/crates/theme2/src/scale.rs b/crates/theme2/src/scale.rs index 8b561c84722677d3b32e0007ae663a022b89465f..c1c2ff924c866473fb90f89842f0d32432b9da27 100644 --- a/crates/theme2/src/scale.rs +++ b/crates/theme2/src/scale.rs @@ -128,6 +128,8 @@ impl ColorScale { } /// `Step 10` - Used for hovered or active solid backgrounds, particularly when `Step 9` is their normal state. + /// + /// May also be used for extremely low contrast text. This should be used sparingly, as it may be difficult to read. #[inline] pub fn step_10(&self) -> Hsla { self.step(ColorScaleStep::TEN) diff --git a/crates/ui2/src/components/tooltip.rs b/crates/ui2/src/components/tooltip.rs index 84630920128a3a107a31e5a7fecb8dca2b139037..87860ce943135997c8a0a816d81d44d5a500fb25 100644 --- a/crates/ui2/src/components/tooltip.rs +++ b/crates/ui2/src/components/tooltip.rs @@ -1,4 +1,4 @@ -use gpui::{div, px, Div, ParentElement, Render, SharedString, Styled, ViewContext}; +use gpui::{div, Div, ParentElement, Render, SharedString, Styled, ViewContext}; use theme2::ActiveTheme; #[derive(Clone, Debug)] @@ -19,7 +19,7 @@ impl Render for TextTooltip { let theme = cx.theme(); div() .bg(theme.colors().background) - .rounded(px(8.)) + .rounded_lg() .border() .font("Zed Sans") .border_color(theme.colors().border) From c7139db39e6dfc155e9a159d9c00ac930cbb2799 Mon Sep 17 00:00:00 2001 From: Julia Date: Wed, 8 Nov 2023 16:51:54 -0500 Subject: [PATCH 02/76] Get tsserver running again --- crates/zed/src/languages/typescript.rs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/crates/zed/src/languages/typescript.rs b/crates/zed/src/languages/typescript.rs index 676d0fd4c0d7afeaf1d3d39bd0c91f17c1a862cf..d259afb05debea950bd767b407d8f77a1a2a2de9 100644 --- a/crates/zed/src/languages/typescript.rs +++ b/crates/zed/src/languages/typescript.rs @@ -2,6 +2,7 @@ use anyhow::{anyhow, Result}; use async_compression::futures::bufread::GzipDecoder; use async_tar::Archive; use async_trait::async_trait; +use collections::HashMap; use futures::{future::BoxFuture, FutureExt}; use gpui::AppContext; use language::{LanguageServerName, LspAdapter, LspAdapterDelegate}; @@ -20,12 +21,7 @@ use util::{fs::remove_matching, github::latest_github_release}; use util::{github::GitHubLspBinaryVersion, ResultExt}; fn typescript_server_binary_arguments(server_path: &Path) -> Vec { - vec![ - server_path.into(), - "--stdio".into(), - "--tsserver-path".into(), - "node_modules/typescript/lib".into(), - ] + vec![server_path.into(), "--stdio".into()] } fn eslint_server_binary_arguments(server_path: &Path) -> Vec { @@ -158,9 +154,20 @@ impl LspAdapter for TypeScriptLspAdapter { async fn initialization_options(&self) -> Option { Some(json!({ - "provideFormatter": true + "provideFormatter": true, + "tsserver": { + "path": "node_modules/typescript/lib", + }, })) } + + async fn language_ids(&self) -> HashMap { + HashMap::from_iter([ + ("TypeScript".into(), "typescript".into()), + ("JavaScript".into(), "javascript".into()), + ("TSX".into(), "typescriptreact".into()), + ]) + } } async fn get_cached_ts_server_binary( From 25c8b19dfb4f207960836b9ce1584da891a40ca2 Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Thu, 9 Nov 2023 01:21:22 -0500 Subject: [PATCH 03/76] WIP --- crates/theme2/src/default_colors.rs | 75 +++++++++++++++-------------- 1 file changed, 39 insertions(+), 36 deletions(-) diff --git a/crates/theme2/src/default_colors.rs b/crates/theme2/src/default_colors.rs index 2b3fc5ada112e7f39cf84255eb888b19ab191ed1..92e38ed39e6cc938b02b888e12f5fc5bfbf6daa1 100644 --- a/crates/theme2/src/default_colors.rs +++ b/crates/theme2/src/default_colors.rs @@ -102,7 +102,7 @@ impl PlayerColors { } fn neutral() -> ColorScaleSet { - olive() + slate() } impl Default for SystemColors { @@ -198,28 +198,28 @@ impl SyntaxTheme { pub fn default_dark() -> Self { Self { highlights: vec![ - ("attribute".into(), cyan().dark().step_11().into()), + ("attribute".into(), tomato().dark().step_11().into()), ("boolean".into(), tomato().dark().step_11().into()), ("comment".into(), neutral().dark().step_11().into()), ("comment.doc".into(), iris().dark().step_12().into()), - ("constant".into(), red().dark().step_9().into()), - ("constructor".into(), red().dark().step_9().into()), - ("embedded".into(), red().dark().step_9().into()), - ("emphasis".into(), red().dark().step_9().into()), - ("emphasis.strong".into(), red().dark().step_9().into()), - ("enum".into(), red().dark().step_9().into()), - ("function".into(), red().dark().step_9().into()), - ("hint".into(), red().dark().step_9().into()), - ("keyword".into(), orange().dark().step_11().into()), - ("label".into(), red().dark().step_9().into()), - ("link_text".into(), red().dark().step_9().into()), - ("link_uri".into(), red().dark().step_9().into()), - ("number".into(), red().dark().step_9().into()), - ("operator".into(), red().dark().step_9().into()), - ("predictive".into(), red().dark().step_9().into()), - ("preproc".into(), red().dark().step_9().into()), - ("primary".into(), red().dark().step_9().into()), - ("property".into(), red().dark().step_9().into()), + ("constant".into(), orange().dark().step_11().into()), + ("constructor".into(), gold().dark().step_11().into()), + ("embedded".into(), red().dark().step_11().into()), + ("emphasis".into(), red().dark().step_11().into()), + ("emphasis.strong".into(), red().dark().step_11().into()), + ("enum".into(), yellow().dark().step_11().into()), + ("function".into(), blue().dark().step_11().into()), + ("hint".into(), indigo().dark().step_11().into()), + ("keyword".into(), plum().dark().step_11().into()), + ("label".into(), red().dark().step_11().into()), + ("link_text".into(), red().dark().step_11().into()), + ("link_uri".into(), red().dark().step_11().into()), + ("number".into(), red().dark().step_11().into()), + ("operator".into(), red().dark().step_11().into()), + ("predictive".into(), red().dark().step_11().into()), + ("preproc".into(), red().dark().step_11().into()), + ("primary".into(), red().dark().step_11().into()), + ("property".into(), red().dark().step_11().into()), ("punctuation".into(), neutral().dark().step_11().into()), ( "punctuation.bracket".into(), @@ -233,22 +233,25 @@ impl SyntaxTheme { "punctuation.list_marker".into(), blue().dark().step_11().into(), ), - ("punctuation.special".into(), red().dark().step_9().into()), - ("string".into(), jade().dark().step_11().into()), - ("string.escape".into(), red().dark().step_9().into()), + ("punctuation.special".into(), red().dark().step_11().into()), + ("string".into(), lime().dark().step_11().into()), + ("string.escape".into(), orange().dark().step_11().into()), ("string.regex".into(), tomato().dark().step_11().into()), - ("string.special".into(), red().dark().step_9().into()), - ("string.special.symbol".into(), red().dark().step_9().into()), - ("tag".into(), red().dark().step_9().into()), - ("text.literal".into(), red().dark().step_9().into()), - ("title".into(), red().dark().step_9().into()), - ("type".into(), red().dark().step_9().into()), - ("variable".into(), red().dark().step_9().into()), - ("variable.special".into(), red().dark().step_9().into()), - ("variant".into(), red().dark().step_9().into()), + ("string.special".into(), red().dark().step_11().into()), + ( + "string.special.symbol".into(), + red().dark().step_11().into(), + ), + ("tag".into(), red().dark().step_11().into()), + ("text.literal".into(), purple().dark().step_11().into()), + ("title".into(), sky().dark().step_11().into()), + ("type".into(), mint().dark().step_11().into()), + ("variable".into(), red().dark().step_11().into()), + ("variable.special".into(), red().dark().step_11().into()), + ("variant".into(), red().dark().step_11().into()), ], - inlay_style: tomato().dark().step_1().into(), // todo!("nate: use a proper style") - suggestion_style: orange().dark().step_1().into(), // todo!("nate: use a proper style") + inlay_style: neutral().dark().step_11().into(), // todo!("nate: use a proper style") + suggestion_style: orange().dark().step_11().into(), // todo!("nate: use a proper style") } } } @@ -350,8 +353,8 @@ impl ThemeColors { ghost_element_active: neutral().dark().step_5(), ghost_element_selected: neutral().dark().step_5(), ghost_element_disabled: neutral().dark_alpha().step_3(), - text: green().dark().step_9(), - text_muted: blue().dark().step_9(), + text: neutral().dark().step_12(), + text_muted: neutral().dark().step_11(), text_placeholder: neutral().dark().step_10(), text_disabled: neutral().dark().step_9(), text_accent: blue().dark().step_11(), From bdeb32c34b8654623974b5d5b811bd72f8126361 Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Thu, 9 Nov 2023 01:39:31 -0500 Subject: [PATCH 04/76] Extend VSCode theme importer --- crates/theme2/src/themes/andromeda.rs | 8 +++++ crates/theme2/src/themes/ayu.rs | 12 +++++++ crates/theme2/src/themes/dracula.rs | 4 +++ crates/theme2/src/themes/gruvbox.rs | 24 +++++++++++++ crates/theme2/src/themes/night_owl.rs | 8 +++++ crates/theme2/src/themes/nord.rs | 4 +++ crates/theme2/src/themes/notctis.rs | 44 ++++++++++++++++++++++++ crates/theme2/src/themes/palenight.rs | 12 +++++++ crates/theme2/src/themes/rose_pine.rs | 12 +++++++ crates/theme2/src/themes/solarized.rs | 6 ++++ crates/theme2/src/themes/synthwave_84.rs | 3 ++ crates/theme_importer/src/vscode.rs | 16 +++++++++ 12 files changed, 153 insertions(+) diff --git a/crates/theme2/src/themes/andromeda.rs b/crates/theme2/src/themes/andromeda.rs index 22a0a8741c43f52a2f437dfa4a8bffb3b51f103b..72354a79a853488c51938463f93af9bc33f2c5ad 100644 --- a/crates/theme2/src/themes/andromeda.rs +++ b/crates/theme2/src/themes/andromeda.rs @@ -30,6 +30,10 @@ pub fn andromeda() -> UserThemeFamily { text: Some(rgba(0xd4cdd8ff).into()), tab_inactive_background: Some(rgba(0x23262eff).into()), tab_active_background: Some(rgba(0x23262eff).into()), + editor_background: Some(rgba(0x23262eff).into()), + editor_gutter_background: Some(rgba(0x23262eff).into()), + editor_line_number: Some(rgba(0x746f77ff).into()), + editor_active_line_number: Some(rgba(0xd4cdd8ff).into()), terminal_ansi_bright_red: Some(rgba(0xee5d42ff).into()), terminal_ansi_bright_green: Some(rgba(0x95e072ff).into()), terminal_ansi_bright_yellow: Some(rgba(0xffe66dff).into()), @@ -64,6 +68,10 @@ pub fn andromeda() -> UserThemeFamily { text: Some(rgba(0xd4cdd8ff).into()), tab_inactive_background: Some(rgba(0x23262eff).into()), tab_active_background: Some(rgba(0x262933ff).into()), + editor_background: Some(rgba(0x262933ff).into()), + editor_gutter_background: Some(rgba(0x262933ff).into()), + editor_line_number: Some(rgba(0x746f77ff).into()), + editor_active_line_number: Some(rgba(0xd4cdd8ff).into()), terminal_ansi_bright_red: Some(rgba(0xee5d42ff).into()), terminal_ansi_bright_green: Some(rgba(0x95e072ff).into()), terminal_ansi_bright_yellow: Some(rgba(0xffe66dff).into()), diff --git a/crates/theme2/src/themes/ayu.rs b/crates/theme2/src/themes/ayu.rs index 8d79289046b94389bffb0759d2210d76c440c4c0..b27f62b442d7bd0c5b6e39954c048888bc5abef1 100644 --- a/crates/theme2/src/themes/ayu.rs +++ b/crates/theme2/src/themes/ayu.rs @@ -30,6 +30,10 @@ pub fn ayu() -> UserThemeFamily { text: Some(rgba(0x8a9199ff).into()), tab_inactive_background: Some(rgba(0xf8f9faff).into()), tab_active_background: Some(rgba(0xf8f9faff).into()), + editor_background: Some(rgba(0xf8f9faff).into()), + editor_gutter_background: Some(rgba(0xf8f9faff).into()), + editor_line_number: Some(rgba(0x8a919966).into()), + editor_active_line_number: Some(rgba(0x5c6166ff).into()), terminal_background: Some(rgba(0xf8f9faff).into()), terminal_ansi_bright_black: Some(rgba(0x686868ff).into()), terminal_ansi_bright_red: Some(rgba(0xef7070ff).into()), @@ -69,6 +73,10 @@ pub fn ayu() -> UserThemeFamily { text: Some(rgba(0x707a8cff).into()), tab_inactive_background: Some(rgba(0x1f2430ff).into()), tab_active_background: Some(rgba(0x1f2430ff).into()), + editor_background: Some(rgba(0x1f2430ff).into()), + editor_gutter_background: Some(rgba(0x1f2430ff).into()), + editor_line_number: Some(rgba(0x8a919966).into()), + editor_active_line_number: Some(rgba(0xcccac2ff).into()), terminal_background: Some(rgba(0x1f2430ff).into()), terminal_ansi_bright_black: Some(rgba(0x686868ff).into()), terminal_ansi_bright_red: Some(rgba(0xf18678ff).into()), @@ -108,6 +116,10 @@ pub fn ayu() -> UserThemeFamily { text: Some(rgba(0x565b66ff).into()), tab_inactive_background: Some(rgba(0x0b0e14ff).into()), tab_active_background: Some(rgba(0x0b0e14ff).into()), + editor_background: Some(rgba(0x0b0e14ff).into()), + editor_gutter_background: Some(rgba(0x0b0e14ff).into()), + editor_line_number: Some(rgba(0x6c738099).into()), + editor_active_line_number: Some(rgba(0xbfbdb6ff).into()), terminal_background: Some(rgba(0x0b0e14ff).into()), terminal_ansi_bright_black: Some(rgba(0x686868ff).into()), terminal_ansi_bright_red: Some(rgba(0xef7077ff).into()), diff --git a/crates/theme2/src/themes/dracula.rs b/crates/theme2/src/themes/dracula.rs index 57c04851a5a45d821060d20d65b9b36f0d25e455..ac5d594b9f4509170e44b8eff0fdbe6b5a3b197a 100644 --- a/crates/theme2/src/themes/dracula.rs +++ b/crates/theme2/src/themes/dracula.rs @@ -29,6 +29,10 @@ pub fn dracula() -> UserThemeFamily { text: Some(rgba(0xf8f8f2ff).into()), tab_inactive_background: Some(rgba(0x21222cff).into()), tab_active_background: Some(rgba(0x282a35ff).into()), + editor_background: Some(rgba(0x282a35ff).into()), + editor_gutter_background: Some(rgba(0x282a35ff).into()), + editor_line_number: Some(rgba(0x6272a4ff).into()), + editor_active_line_number: Some(rgba(0xf8f8f2ff).into()), terminal_background: Some(rgba(0x282a35ff).into()), terminal_ansi_bright_black: Some(rgba(0x6272a4ff).into()), terminal_ansi_bright_red: Some(rgba(0xff6d6dff).into()), diff --git a/crates/theme2/src/themes/gruvbox.rs b/crates/theme2/src/themes/gruvbox.rs index 2e79b250dac13232ffa0bef549b34fe9eb6e7924..2c388079a598f5c86ee3f6a1a1e348bfe14d1e86 100644 --- a/crates/theme2/src/themes/gruvbox.rs +++ b/crates/theme2/src/themes/gruvbox.rs @@ -28,6 +28,10 @@ pub fn gruvbox() -> UserThemeFamily { text: Some(rgba(0xebdbb2ff).into()), tab_inactive_background: Some(rgba(0x1d2021ff).into()), tab_active_background: Some(rgba(0x32302fff).into()), + editor_background: Some(rgba(0x1d2021ff).into()), + editor_gutter_background: Some(rgba(0x1d2021ff).into()), + editor_line_number: Some(rgba(0x665c54ff).into()), + editor_active_line_number: Some(rgba(0xebdbb2ff).into()), terminal_background: Some(rgba(0x1d2021ff).into()), terminal_ansi_bright_black: Some(rgba(0x928374ff).into()), terminal_ansi_bright_red: Some(rgba(0xfb4833ff).into()), @@ -65,6 +69,10 @@ pub fn gruvbox() -> UserThemeFamily { text: Some(rgba(0xebdbb2ff).into()), tab_inactive_background: Some(rgba(0x282828ff).into()), tab_active_background: Some(rgba(0x3c3836ff).into()), + editor_background: Some(rgba(0x282828ff).into()), + editor_gutter_background: Some(rgba(0x282828ff).into()), + editor_line_number: Some(rgba(0x665c54ff).into()), + editor_active_line_number: Some(rgba(0xebdbb2ff).into()), terminal_background: Some(rgba(0x282828ff).into()), terminal_ansi_bright_black: Some(rgba(0x928374ff).into()), terminal_ansi_bright_red: Some(rgba(0xfb4833ff).into()), @@ -102,6 +110,10 @@ pub fn gruvbox() -> UserThemeFamily { text: Some(rgba(0xebdbb2ff).into()), tab_inactive_background: Some(rgba(0x32302fff).into()), tab_active_background: Some(rgba(0x504945ff).into()), + editor_background: Some(rgba(0x32302fff).into()), + editor_gutter_background: Some(rgba(0x32302fff).into()), + editor_line_number: Some(rgba(0x665c54ff).into()), + editor_active_line_number: Some(rgba(0xebdbb2ff).into()), terminal_background: Some(rgba(0x32302fff).into()), terminal_ansi_bright_black: Some(rgba(0x928374ff).into()), terminal_ansi_bright_red: Some(rgba(0xfb4833ff).into()), @@ -139,6 +151,10 @@ pub fn gruvbox() -> UserThemeFamily { text: Some(rgba(0x3c3836ff).into()), tab_inactive_background: Some(rgba(0xf9f5d7ff).into()), tab_active_background: Some(rgba(0xf2e5bcff).into()), + editor_background: Some(rgba(0xf9f5d7ff).into()), + editor_gutter_background: Some(rgba(0xf9f5d7ff).into()), + editor_line_number: Some(rgba(0xbdae93ff).into()), + editor_active_line_number: Some(rgba(0x3c3836ff).into()), terminal_background: Some(rgba(0xf9f5d7ff).into()), terminal_ansi_bright_black: Some(rgba(0x928374ff).into()), terminal_ansi_bright_red: Some(rgba(0x9d0006ff).into()), @@ -176,6 +192,10 @@ pub fn gruvbox() -> UserThemeFamily { text: Some(rgba(0x3c3836ff).into()), tab_inactive_background: Some(rgba(0xfbf1c7ff).into()), tab_active_background: Some(rgba(0xebdbb2ff).into()), + editor_background: Some(rgba(0xfbf1c7ff).into()), + editor_gutter_background: Some(rgba(0xfbf1c7ff).into()), + editor_line_number: Some(rgba(0xbdae93ff).into()), + editor_active_line_number: Some(rgba(0x3c3836ff).into()), terminal_background: Some(rgba(0xfbf1c7ff).into()), terminal_ansi_bright_black: Some(rgba(0x928374ff).into()), terminal_ansi_bright_red: Some(rgba(0x9d0006ff).into()), @@ -213,6 +233,10 @@ pub fn gruvbox() -> UserThemeFamily { text: Some(rgba(0x3c3836ff).into()), tab_inactive_background: Some(rgba(0xf2e5bcff).into()), tab_active_background: Some(rgba(0xd5c4a1ff).into()), + editor_background: Some(rgba(0xf2e5bcff).into()), + editor_gutter_background: Some(rgba(0xf2e5bcff).into()), + editor_line_number: Some(rgba(0xbdae93ff).into()), + editor_active_line_number: Some(rgba(0x3c3836ff).into()), terminal_background: Some(rgba(0xf2e5bcff).into()), terminal_ansi_bright_black: Some(rgba(0x928374ff).into()), terminal_ansi_bright_red: Some(rgba(0x9d0006ff).into()), diff --git a/crates/theme2/src/themes/night_owl.rs b/crates/theme2/src/themes/night_owl.rs index 90ae45f8797c522258840c4d2efd28586be74c47..24fa9e60735d725d1796935892da266234b286be 100644 --- a/crates/theme2/src/themes/night_owl.rs +++ b/crates/theme2/src/themes/night_owl.rs @@ -30,6 +30,10 @@ pub fn night_owl() -> UserThemeFamily { text: Some(rgba(0xd6deebff).into()), tab_inactive_background: Some(rgba(0x01101cff).into()), tab_active_background: Some(rgba(0x0a2842ff).into()), + editor_background: Some(rgba(0x011526ff).into()), + editor_gutter_background: Some(rgba(0x011526ff).into()), + editor_line_number: Some(rgba(0x4b6479ff).into()), + editor_active_line_number: Some(rgba(0xd6deebff).into()), terminal_ansi_bright_black: Some(rgba(0x575656ff).into()), terminal_ansi_bright_red: Some(rgba(0xef524fff).into()), terminal_ansi_bright_green: Some(rgba(0x21da6eff).into()), @@ -68,6 +72,10 @@ pub fn night_owl() -> UserThemeFamily { text: Some(rgba(0x403f53ff).into()), tab_inactive_background: Some(rgba(0xf0f0f0ff).into()), tab_active_background: Some(rgba(0xf6f6f6ff).into()), + editor_background: Some(rgba(0xfbfbfbff).into()), + editor_gutter_background: Some(rgba(0xfbfbfbff).into()), + editor_line_number: Some(rgba(0x90a7b2ff).into()), + editor_active_line_number: Some(rgba(0x403f53ff).into()), terminal_background: Some(rgba(0xf6f6f6ff).into()), terminal_ansi_bright_black: Some(rgba(0x403f53ff).into()), terminal_ansi_bright_red: Some(rgba(0xde3c3aff).into()), diff --git a/crates/theme2/src/themes/nord.rs b/crates/theme2/src/themes/nord.rs index b1dedd6b16eb2cdc991aca441938cfa17a75e888..5b8688737a3678e3635130cd0f9064c65ae2ae14 100644 --- a/crates/theme2/src/themes/nord.rs +++ b/crates/theme2/src/themes/nord.rs @@ -29,6 +29,10 @@ pub fn nord() -> UserThemeFamily { text: Some(rgba(0xd8dee9ff).into()), tab_inactive_background: Some(rgba(0x2e3440ff).into()), tab_active_background: Some(rgba(0x3b4252ff).into()), + editor_background: Some(rgba(0x2e3440ff).into()), + editor_gutter_background: Some(rgba(0x2e3440ff).into()), + editor_line_number: Some(rgba(0x4c566aff).into()), + editor_active_line_number: Some(rgba(0xd8dee9ff).into()), terminal_background: Some(rgba(0x2e3440ff).into()), terminal_ansi_bright_black: Some(rgba(0x4c566aff).into()), terminal_ansi_bright_red: Some(rgba(0xbf616aff).into()), diff --git a/crates/theme2/src/themes/notctis.rs b/crates/theme2/src/themes/notctis.rs index f5b8f1207d45ce5de6664b1bc7ffe9f8c3237172..bb835c5397104220d5e12788f85bdeeeaab9aa2e 100644 --- a/crates/theme2/src/themes/notctis.rs +++ b/crates/theme2/src/themes/notctis.rs @@ -30,6 +30,10 @@ pub fn notctis() -> UserThemeFamily { text: Some(rgba(0xbecfdaff).into()), tab_inactive_background: Some(rgba(0x08324eff).into()), tab_active_background: Some(rgba(0x07263aff).into()), + editor_background: Some(rgba(0x07263aff).into()), + editor_gutter_background: Some(rgba(0x07263aff).into()), + editor_line_number: Some(rgba(0x4c6b7fff).into()), + editor_active_line_number: Some(rgba(0xbecfdaff).into()), terminal_background: Some(rgba(0x051b28ff).into()), terminal_ansi_bright_black: Some(rgba(0x475e6cff).into()), terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()), @@ -69,6 +73,10 @@ pub fn notctis() -> UserThemeFamily { text: Some(rgba(0xcbbec2ff).into()), tab_inactive_background: Some(rgba(0x413036ff).into()), tab_active_background: Some(rgba(0x322a2dff).into()), + editor_background: Some(rgba(0x322a2dff).into()), + editor_gutter_background: Some(rgba(0x322a2dff).into()), + editor_line_number: Some(rgba(0x715b63ff).into()), + editor_active_line_number: Some(rgba(0xcbbec2ff).into()), terminal_background: Some(rgba(0x272022ff).into()), terminal_ansi_bright_black: Some(rgba(0x69545bff).into()), terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()), @@ -108,6 +116,10 @@ pub fn notctis() -> UserThemeFamily { text: Some(rgba(0x005661ff).into()), tab_inactive_background: Some(rgba(0xcaedf2ff).into()), tab_active_background: Some(rgba(0xf4f6f6ff).into()), + editor_background: Some(rgba(0xf4f6f6ff).into()), + editor_gutter_background: Some(rgba(0xf4f6f6ff).into()), + editor_line_number: Some(rgba(0xa0abacff).into()), + editor_active_line_number: Some(rgba(0x005661ff).into()), terminal_background: Some(rgba(0xe1eeefff).into()), terminal_ansi_bright_black: Some(rgba(0x004d57ff).into()), terminal_ansi_bright_red: Some(rgba(0xff3f00ff).into()), @@ -147,6 +159,10 @@ pub fn notctis() -> UserThemeFamily { text: Some(rgba(0x0c006bff).into()), tab_inactive_background: Some(rgba(0xe2dff6ff).into()), tab_active_background: Some(rgba(0xf2f1f8ff).into()), + editor_background: Some(rgba(0xf2f1f8ff).into()), + editor_gutter_background: Some(rgba(0xf2f1f8ff).into()), + editor_line_number: Some(rgba(0x9c99b0ff).into()), + editor_active_line_number: Some(rgba(0x0c006bff).into()), terminal_background: Some(rgba(0xe9e7f3ff).into()), terminal_ansi_bright_black: Some(rgba(0x0f0080ff).into()), terminal_ansi_bright_red: Some(rgba(0xff3f00ff).into()), @@ -186,6 +202,10 @@ pub fn notctis() -> UserThemeFamily { text: Some(rgba(0x005661ff).into()), tab_inactive_background: Some(rgba(0xf0e9d6ff).into()), tab_active_background: Some(rgba(0xfef8ecff).into()), + editor_background: Some(rgba(0xfef8ecff).into()), + editor_gutter_background: Some(rgba(0xfef8ecff).into()), + editor_line_number: Some(rgba(0xa0abacff).into()), + editor_active_line_number: Some(rgba(0x005661ff).into()), terminal_background: Some(rgba(0xf6eddaff).into()), terminal_ansi_bright_black: Some(rgba(0x004d57ff).into()), terminal_ansi_bright_red: Some(rgba(0xff3f00ff).into()), @@ -225,6 +245,10 @@ pub fn notctis() -> UserThemeFamily { text: Some(rgba(0xc5cdd3ff).into()), tab_inactive_background: Some(rgba(0x202d37ff).into()), tab_active_background: Some(rgba(0x1b2932ff).into()), + editor_background: Some(rgba(0x1b2932ff).into()), + editor_gutter_background: Some(rgba(0x1b2932ff).into()), + editor_line_number: Some(rgba(0x5d6e79ff).into()), + editor_active_line_number: Some(rgba(0xc5cdd3ff).into()), terminal_background: Some(rgba(0x0e1920ff).into()), terminal_ansi_bright_black: Some(rgba(0x425866ff).into()), terminal_ansi_bright_red: Some(rgba(0xca8468ff).into()), @@ -264,6 +288,10 @@ pub fn notctis() -> UserThemeFamily { text: Some(rgba(0xb1c9ccff).into()), tab_inactive_background: Some(rgba(0x052e32ff).into()), tab_active_background: Some(rgba(0x052428ff).into()), + editor_background: Some(rgba(0x052428ff).into()), + editor_gutter_background: Some(rgba(0x052428ff).into()), + editor_line_number: Some(rgba(0x4e6b6eff).into()), + editor_active_line_number: Some(rgba(0xb1c9ccff).into()), terminal_background: Some(rgba(0x03181aff).into()), terminal_ansi_bright_black: Some(rgba(0x47686cff).into()), terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()), @@ -303,6 +331,10 @@ pub fn notctis() -> UserThemeFamily { text: Some(rgba(0xb1c9ccff).into()), tab_inactive_background: Some(rgba(0x052e32ff).into()), tab_active_background: Some(rgba(0x031316ff).into()), + editor_background: Some(rgba(0x031316ff).into()), + editor_gutter_background: Some(rgba(0x031316ff).into()), + editor_line_number: Some(rgba(0x4e6b6eff).into()), + editor_active_line_number: Some(rgba(0xb1c9ccff).into()), terminal_background: Some(rgba(0x020c0eff).into()), terminal_ansi_bright_black: Some(rgba(0x47686cff).into()), terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()), @@ -342,6 +374,10 @@ pub fn notctis() -> UserThemeFamily { text: Some(rgba(0xb1c9ccff).into()), tab_inactive_background: Some(rgba(0x052e32ff).into()), tab_active_background: Some(rgba(0x031316ff).into()), + editor_background: Some(rgba(0x031316ff).into()), + editor_gutter_background: Some(rgba(0x031316ff).into()), + editor_line_number: Some(rgba(0x4e6b6eff).into()), + editor_active_line_number: Some(rgba(0xb1c9ccff).into()), terminal_background: Some(rgba(0x020c0eff).into()), terminal_ansi_bright_black: Some(rgba(0x47686cff).into()), terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()), @@ -381,6 +417,10 @@ pub fn notctis() -> UserThemeFamily { text: Some(rgba(0xc5c2d6ff).into()), tab_inactive_background: Some(rgba(0x2f2c49ff).into()), tab_active_background: Some(rgba(0x292640ff).into()), + editor_background: Some(rgba(0x292640ff).into()), + editor_gutter_background: Some(rgba(0x292640ff).into()), + editor_line_number: Some(rgba(0x5c5973ff).into()), + editor_active_line_number: Some(rgba(0xc5c2d6ff).into()), terminal_background: Some(rgba(0x1f1d30ff).into()), terminal_ansi_bright_black: Some(rgba(0x504e65ff).into()), terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()), @@ -420,6 +460,10 @@ pub fn notctis() -> UserThemeFamily { text: Some(rgba(0xccbfd9ff).into()), tab_inactive_background: Some(rgba(0x3d2e4dff).into()), tab_active_background: Some(rgba(0x30243dff).into()), + editor_background: Some(rgba(0x30243dff).into()), + editor_gutter_background: Some(rgba(0x30243dff).into()), + editor_line_number: Some(rgba(0x665973ff).into()), + editor_active_line_number: Some(rgba(0xccbfd9ff).into()), terminal_background: Some(rgba(0x291d35ff).into()), terminal_ansi_bright_black: Some(rgba(0x594e65ff).into()), terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()), diff --git a/crates/theme2/src/themes/palenight.rs b/crates/theme2/src/themes/palenight.rs index 7ed27d3b7576601c4bcc573e2d43bbc818152f50..6e5651fe03acfcc1df15e12be5f2fbeea1aec339 100644 --- a/crates/theme2/src/themes/palenight.rs +++ b/crates/theme2/src/themes/palenight.rs @@ -30,6 +30,10 @@ pub fn palenight() -> UserThemeFamily { text: Some(rgba(0xffffffff).into()), tab_inactive_background: Some(rgba(0x31364aff).into()), tab_active_background: Some(rgba(0x292c3eff).into()), + editor_background: Some(rgba(0x292c3eff).into()), + editor_gutter_background: Some(rgba(0x292c3eff).into()), + editor_line_number: Some(rgba(0x4c5374ff).into()), + editor_active_line_number: Some(rgba(0xbfc7d5ff).into()), terminal_ansi_bright_black: Some(rgba(0x676e95ff).into()), terminal_ansi_bright_red: Some(rgba(0xff5571ff).into()), terminal_ansi_bright_green: Some(rgba(0xc3e88dff).into()), @@ -68,6 +72,10 @@ pub fn palenight() -> UserThemeFamily { text: Some(rgba(0xffffffff).into()), tab_inactive_background: Some(rgba(0x31364aff).into()), tab_active_background: Some(rgba(0x292c3eff).into()), + editor_background: Some(rgba(0x292c3eff).into()), + editor_gutter_background: Some(rgba(0x292c3eff).into()), + editor_line_number: Some(rgba(0x4c5374ff).into()), + editor_active_line_number: Some(rgba(0xbfc7d5ff).into()), terminal_ansi_bright_black: Some(rgba(0x676e95ff).into()), terminal_ansi_bright_red: Some(rgba(0xff5571ff).into()), terminal_ansi_bright_green: Some(rgba(0xc3e88dff).into()), @@ -106,6 +114,10 @@ pub fn palenight() -> UserThemeFamily { text: Some(rgba(0xffffffff).into()), tab_inactive_background: Some(rgba(0x31364aff).into()), tab_active_background: Some(rgba(0x25283aff).into()), + editor_background: Some(rgba(0x292c3eff).into()), + editor_gutter_background: Some(rgba(0x292c3eff).into()), + editor_line_number: Some(rgba(0x4c5374ff).into()), + editor_active_line_number: Some(rgba(0xbfc7d5ff).into()), terminal_ansi_bright_black: Some(rgba(0x676e95ff).into()), terminal_ansi_bright_red: Some(rgba(0xff5571ff).into()), terminal_ansi_bright_green: Some(rgba(0xc3e88dff).into()), diff --git a/crates/theme2/src/themes/rose_pine.rs b/crates/theme2/src/themes/rose_pine.rs index 913af127fbbab692ccb1f0261c71ec10b1da1ac4..f12b9090d4ba7a219b95c915ae743619c4874a72 100644 --- a/crates/theme2/src/themes/rose_pine.rs +++ b/crates/theme2/src/themes/rose_pine.rs @@ -30,6 +30,10 @@ pub fn rose_pine() -> UserThemeFamily { text: Some(rgba(0xe0def4ff).into()), tab_inactive_background: Some(rgba(0x000000ff).into()), tab_active_background: Some(rgba(0x6e6a861a).into()), + editor_background: Some(rgba(0x191724ff).into()), + editor_gutter_background: Some(rgba(0x191724ff).into()), + editor_line_number: Some(rgba(0x908caaff).into()), + editor_active_line_number: Some(rgba(0xe0def4ff).into()), terminal_ansi_bright_black: Some(rgba(0x908caaff).into()), terminal_ansi_bright_red: Some(rgba(0xeb6f92ff).into()), terminal_ansi_bright_green: Some(rgba(0x30738fff).into()), @@ -68,6 +72,10 @@ pub fn rose_pine() -> UserThemeFamily { text: Some(rgba(0xe0def4ff).into()), tab_inactive_background: Some(rgba(0x000000ff).into()), tab_active_background: Some(rgba(0x817c9c14).into()), + editor_background: Some(rgba(0x232136ff).into()), + editor_gutter_background: Some(rgba(0x232136ff).into()), + editor_line_number: Some(rgba(0x908caaff).into()), + editor_active_line_number: Some(rgba(0xe0def4ff).into()), terminal_ansi_bright_black: Some(rgba(0x908caaff).into()), terminal_ansi_bright_red: Some(rgba(0xeb6f92ff).into()), terminal_ansi_bright_green: Some(rgba(0x3d8fb0ff).into()), @@ -106,6 +114,10 @@ pub fn rose_pine() -> UserThemeFamily { text: Some(rgba(0x575279ff).into()), tab_inactive_background: Some(rgba(0x000000ff).into()), tab_active_background: Some(rgba(0x6e6a860d).into()), + editor_background: Some(rgba(0xfaf4edff).into()), + editor_gutter_background: Some(rgba(0xfaf4edff).into()), + editor_line_number: Some(rgba(0x797593ff).into()), + editor_active_line_number: Some(rgba(0x575279ff).into()), terminal_ansi_bright_black: Some(rgba(0x797593ff).into()), terminal_ansi_bright_red: Some(rgba(0xb3627aff).into()), terminal_ansi_bright_green: Some(rgba(0x276983ff).into()), diff --git a/crates/theme2/src/themes/solarized.rs b/crates/theme2/src/themes/solarized.rs index 0a78328e2e80f5895a2bd29a5c84d18f2777b042..41a8e21e5ac810c0515edb94e9f4244f654c93ee 100644 --- a/crates/theme2/src/themes/solarized.rs +++ b/crates/theme2/src/themes/solarized.rs @@ -27,6 +27,9 @@ pub fn solarized() -> UserThemeFamily { element_background: Some(rgba(0x29a19899).into()), tab_inactive_background: Some(rgba(0x003f51ff).into()), tab_active_background: Some(rgba(0x002a36ff).into()), + editor_background: Some(rgba(0x002a35ff).into()), + editor_gutter_background: Some(rgba(0x002a35ff).into()), + editor_line_number: Some(rgba(0x566c74ff).into()), terminal_ansi_bright_black: Some(rgba(0x586e75ff).into()), terminal_ansi_bright_red: Some(rgba(0xcb4b15ff).into()), terminal_ansi_bright_green: Some(rgba(0x859900ff).into()), @@ -62,6 +65,9 @@ pub fn solarized() -> UserThemeFamily { element_background: Some(rgba(0xab9d56ff).into()), tab_inactive_background: Some(rgba(0xd3cbb7ff).into()), tab_active_background: Some(rgba(0xfdf6e3ff).into()), + editor_background: Some(rgba(0xfdf6e3ff).into()), + editor_gutter_background: Some(rgba(0xfdf6e3ff).into()), + editor_line_number: Some(rgba(0x9ca8a6ff).into()), terminal_ansi_bright_black: Some(rgba(0x657b83ff).into()), terminal_ansi_bright_red: Some(rgba(0xcb4b15ff).into()), terminal_ansi_bright_green: Some(rgba(0x859900ff).into()), diff --git a/crates/theme2/src/themes/synthwave_84.rs b/crates/theme2/src/themes/synthwave_84.rs index 8c0520ee11d13fc2d72939e3639cb0746fe5ae7b..9f157ade619f122230f6e489cebe7c53463b3500 100644 --- a/crates/theme2/src/themes/synthwave_84.rs +++ b/crates/theme2/src/themes/synthwave_84.rs @@ -20,6 +20,9 @@ pub fn synthwave_84() -> UserThemeFamily { element_background: Some(rgba(0x614d85ff).into()), text: Some(rgba(0xffffffff).into()), tab_inactive_background: Some(rgba(0x252334ff).into()), + editor_background: Some(rgba(0x252334ff).into()), + editor_gutter_background: Some(rgba(0x252334ff).into()), + editor_line_number: Some(rgba(0xffffff73).into()), terminal_ansi_bright_red: Some(rgba(0xfe444fff).into()), terminal_ansi_bright_green: Some(rgba(0x71f1b7ff).into()), terminal_ansi_bright_yellow: Some(rgba(0xfede5cff).into()), diff --git a/crates/theme_importer/src/vscode.rs b/crates/theme_importer/src/vscode.rs index 5a09870dc8251e9e5d0b93e386f4b246b14503e5..864aa47ea2e96563eefc0f8bf64a95be2cb89ab4 100644 --- a/crates/theme_importer/src/vscode.rs +++ b/crates/theme_importer/src/vscode.rs @@ -488,6 +488,22 @@ impl VsCodeThemeConverter { .tab_inactive_background .as_ref() .traverse(|color| try_parse_color(&color))?, + editor_background: vscode_colors + .editor_background + .as_ref() + .traverse(|color| try_parse_color(&color))?, + editor_gutter_background: vscode_colors + .editor_background + .as_ref() + .traverse(|color| try_parse_color(&color))?, + editor_line_number: vscode_colors + .editor_line_number_foreground + .as_ref() + .traverse(|color| try_parse_color(&color))?, + editor_active_line_number: vscode_colors + .editor_foreground + .as_ref() + .traverse(|color| try_parse_color(&color))?, terminal_background: vscode_colors .terminal_background .as_ref() From 8be07eddcca62b5cd7abeb0d52f7ab6c4f48c6b2 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Thu, 9 Nov 2023 14:23:33 +0200 Subject: [PATCH 05/76] Change locate prettier method signature --- crates/prettier/src/prettier.rs | 70 +++++++++++++++++---------------- crates/project/src/project.rs | 46 +++++++++++++--------- 2 files changed, 64 insertions(+), 52 deletions(-) diff --git a/crates/prettier/src/prettier.rs b/crates/prettier/src/prettier.rs index 06c1b66977c7a84d813d99cf508da5b52809a394..5960b93ccdcbb5c5b45f030396a6951635cc7942 100644 --- a/crates/prettier/src/prettier.rs +++ b/crates/prettier/src/prettier.rs @@ -1,3 +1,4 @@ +use std::ops::ControlFlow; use std::path::{Path, PathBuf}; use std::sync::Arc; @@ -58,7 +59,7 @@ impl Prettier { fs: &dyn Fs, installed_prettiers: &HashSet, locate_from: &Path, - ) -> anyhow::Result> { + ) -> anyhow::Result>> { let mut path_to_check = locate_from .components() .take_while(|component| component.as_os_str().to_string_lossy() != "node_modules") @@ -76,14 +77,14 @@ impl Prettier { loop { if installed_prettiers.contains(&path_to_check) { log::debug!("Found prettier path {path_to_check:?} in installed prettiers"); - return Ok(Some(path_to_check)); + return Ok(ControlFlow::Continue(Some(path_to_check))); } else if let Some(package_json_contents) = read_package_json(fs, &path_to_check).await? { if has_prettier_in_package_json(&package_json_contents) { if has_prettier_in_node_modules(fs, &path_to_check).await? { log::debug!("Found prettier path {path_to_check:?} in both package.json and node_modules"); - return Ok(Some(path_to_check)); + return Ok(ControlFlow::Continue(Some(path_to_check))); } else if project_path_with_prettier_dependency.is_none() { project_path_with_prettier_dependency = Some(path_to_check.clone()); } @@ -109,7 +110,7 @@ impl Prettier { }) { anyhow::ensure!(has_prettier_in_node_modules(fs, &path_to_check).await?, "Found prettier path {path_to_check:?} in the workspace root for project in {project_path_with_prettier_dependency:?}, but it's not installed into workspace root's node_modules"); log::info!("Found prettier path {path_to_check:?} in the workspace root for project in {project_path_with_prettier_dependency:?}"); - return Ok(Some(path_to_check)); + return Ok(ControlFlow::Continue(Some(path_to_check))); } else { log::warn!("Skipping path {path_to_check:?} that has prettier in its 'node_modules' subdirectory, but is not included in its package.json workspaces {workspaces:?}"); } @@ -132,7 +133,7 @@ impl Prettier { } None => { log::debug!("Found no prettier in ancestors of {locate_from:?}"); - return Ok(None); + return Ok(ControlFlow::Continue(None)); } } } @@ -497,36 +498,39 @@ mod tests { .await; assert!( - Prettier::locate_prettier_installation( - fs.as_ref(), - &HashSet::default(), - Path::new("/root/.config/zed/settings.json"), - ) - .await - .unwrap() - .is_none(), + matches!( + Prettier::locate_prettier_installation( + fs.as_ref(), + &HashSet::default(), + Path::new("/root/.config/zed/settings.json"), + ) + .await, + Ok(ControlFlow::Continue(None)) + ), "Should successfully find no prettier for path hierarchy without it" ); assert!( - Prettier::locate_prettier_installation( - fs.as_ref(), - &HashSet::default(), - Path::new("/root/work/project/src/index.js") - ) - .await - .unwrap() - .is_none(), + matches!( + Prettier::locate_prettier_installation( + fs.as_ref(), + &HashSet::default(), + Path::new("/root/work/project/src/index.js") + ) + .await, + Ok(ControlFlow::Continue(None)) + ), "Should successfully find no prettier for path hierarchy that has node_modules with prettier, but no package.json mentions of it" ); assert!( - Prettier::locate_prettier_installation( - fs.as_ref(), - &HashSet::default(), - Path::new("/root/work/project/node_modules/expect/build/print.js") - ) - .await - .unwrap() - .is_none(), + matches!( + Prettier::locate_prettier_installation( + fs.as_ref(), + &HashSet::default(), + Path::new("/root/work/project/node_modules/expect/build/print.js") + ) + .await, + Ok(ControlFlow::Continue(None)) + ), "Even though it has package.json with prettier in it and no prettier on node_modules along the path, nothing should fail since declared inside node_modules" ); } @@ -580,7 +584,7 @@ mod tests { ) .await .unwrap(), - Some(PathBuf::from("/root/web_blog")), + ControlFlow::Continue(Some(PathBuf::from("/root/web_blog"))), "Should find a preinstalled prettier in the project root" ); assert_eq!( @@ -591,7 +595,7 @@ mod tests { ) .await .unwrap(), - Some(PathBuf::from("/root/web_blog")), + ControlFlow::Continue(Some(PathBuf::from("/root/web_blog"))), "Should find a preinstalled prettier in the project root even for node_modules files" ); } @@ -649,7 +653,7 @@ mod tests { ) .await .unwrap(), - Some(PathBuf::from("/root/work")), + ControlFlow::Continue(Some(PathBuf::from("/root/work"))), "Should return first cached value found without path checks" ); } @@ -703,7 +707,7 @@ mod tests { &HashSet::default(), Path::new("/root/work/full-stack-foundations/exercises/03.loading/01.problem.loader/app/routes/users+/$username_+/notes.tsx"), ).await.unwrap(), - Some(PathBuf::from("/root/work/full-stack-foundations")), + ControlFlow::Continue(Some(PathBuf::from("/root/work/full-stack-foundations"))), "Should ascend to the multi-workspace root and find the prettier there", ); } diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs index f7a050e7e068ffad30ad0cad464d556979e244ca..40736b97c208f7e6a55998474014ce6feef4efcb 100644 --- a/crates/project/src/project.rs +++ b/crates/project/src/project.rs @@ -69,7 +69,7 @@ use std::{ hash::Hash, mem, num::NonZeroU32, - ops::Range, + ops::{ControlFlow, Range}, path::{self, Component, Path, PathBuf}, process::Stdio, str, @@ -173,7 +173,8 @@ pub struct Project { struct DefaultPrettier { instance: Option, Arc>>>>, installation_process: Option>>>>, - #[cfg(not(any(test, feature = "test-support")))] + // TODO kb uncomment + // #[cfg(not(any(test, feature = "test-support")))] installed_plugins: HashSet<&'static str>, } @@ -8442,7 +8443,10 @@ impl Project { }) .await { - Ok(None) => { + Ok(ControlFlow::Break(())) => { + return None; + } + Ok(ControlFlow::Continue(None)) => { let started_default_prettier = project.update(&mut cx, |project, _| { project @@ -8466,7 +8470,7 @@ impl Project { } } } - Ok(Some(prettier_dir)) => { + Ok(ControlFlow::Continue(Some(prettier_dir))) => { project.update(&mut cx, |project, _| { project .prettiers_per_worktree @@ -8536,17 +8540,18 @@ impl Project { } } - #[cfg(any(test, feature = "test-support"))] - fn install_default_formatters( - &mut self, - _worktree: Option, - _new_language: &Language, - _language_settings: &LanguageSettings, - _cx: &mut ModelContext, - ) { - } + // TODO kb uncomment + // #[cfg(any(test, feature = "test-support"))] + // fn install_default_formatters( + // &mut self, + // _worktree: Option, + // _new_language: &Language, + // _language_settings: &LanguageSettings, + // _cx: &mut ModelContext, + // ) { + // } - #[cfg(not(any(test, feature = "test-support")))] + // #[cfg(not(any(test, feature = "test-support")))] fn install_default_formatters( &mut self, worktree: Option, @@ -8593,7 +8598,7 @@ impl Project { .await }) } - None => Task::ready(Ok(None)), + None => Task::ready(Ok(ControlFlow::Break(()))), }; let mut plugins_to_install = prettier_plugins; let previous_installation_process = @@ -8622,8 +8627,9 @@ impl Project { .context("locate prettier installation") .map_err(Arc::new)? { - Some(_non_default_prettier) => return Ok(()), - None => { + ControlFlow::Break(()) => return Ok(()), + ControlFlow::Continue(Some(_non_default_prettier)) => return Ok(()), + ControlFlow::Continue(None) => { let mut needs_install = match previous_installation_process { Some(previous_installation_process) => { previous_installation_process.await.is_err() @@ -8708,7 +8714,8 @@ fn start_default_prettier( .get_or_insert_with(|| DefaultPrettier { instance: None, installation_process: None, - #[cfg(not(any(test, feature = "test-support")))] + // TODO kb uncomment + // #[cfg(not(any(test, feature = "test-support")))] installed_plugins: HashSet::default(), }) .instance = Some(new_default_prettier.clone()); @@ -8790,7 +8797,8 @@ fn register_new_prettier( } } -#[cfg(not(any(test, feature = "test-support")))] +// TODO kb uncomment +// #[cfg(not(any(test, feature = "test-support")))] async fn install_default_prettier( plugins_to_install: HashSet<&'static str>, node: Arc, From ce40d5e0c50b5e20e7d0bb46f16172f028f52564 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Thu, 9 Nov 2023 14:30:54 +0200 Subject: [PATCH 06/76] Adjust the tests --- crates/prettier/src/prettier.rs | 83 ++++++++++++++++++++++++++++----- 1 file changed, 71 insertions(+), 12 deletions(-) diff --git a/crates/prettier/src/prettier.rs b/crates/prettier/src/prettier.rs index 5960b93ccdcbb5c5b45f030396a6951635cc7942..b73cd8a1b0b070913d317ec13257c339249d88cf 100644 --- a/crates/prettier/src/prettier.rs +++ b/crates/prettier/src/prettier.rs @@ -529,9 +529,9 @@ mod tests { Path::new("/root/work/project/node_modules/expect/build/print.js") ) .await, - Ok(ControlFlow::Continue(None)) + Ok(ControlFlow::Break(())) ), - "Even though it has package.json with prettier in it and no prettier on node_modules along the path, nothing should fail since declared inside node_modules" + "Should not format files inside node_modules/" ); } @@ -595,8 +595,8 @@ mod tests { ) .await .unwrap(), - ControlFlow::Continue(Some(PathBuf::from("/root/web_blog"))), - "Should find a preinstalled prettier in the project root even for node_modules files" + ControlFlow::Break(()), + "Should not allow formatting node_modules/ contents" ); } @@ -608,6 +608,18 @@ mod tests { json!({ "work": { "web_blog": { + "node_modules": { + "expect": { + "build": { + "print.js": "// print.js file contents", + }, + "package.json": r#"{ + "devDependencies": { + "prettier": "2.5.1" + } + }"#, + }, + }, "pages": { "[slug].tsx": "// [slug].tsx file contents", }, @@ -628,33 +640,55 @@ mod tests { ) .await; - let path = "/root/work/web_blog/node_modules/pages/[slug].tsx"; match Prettier::locate_prettier_installation( fs.as_ref(), &HashSet::default(), - Path::new(path) + Path::new("/root/work/web_blog/pages/[slug].tsx") ) .await { Ok(path) => panic!("Expected to fail for prettier in package.json but not in node_modules found, but got path {path:?}"), Err(e) => { let message = e.to_string(); - assert!(message.contains(path), "Error message should mention which start file was used for location"); - assert!(message.contains("/root/work/web_blog"), "Error message should mention potential candidates without prettier node_modules contents"); + assert!(message.contains("/root/work/web_blog"), "Error message should mention which project had prettier defined"); }, }; - assert_eq!( Prettier::locate_prettier_installation( fs.as_ref(), &HashSet::from_iter( [PathBuf::from("/root"), PathBuf::from("/root/work")].into_iter() ), - Path::new("/root/work/web_blog/node_modules/pages/[slug].tsx") + Path::new("/root/work/web_blog/pages/[slug].tsx") ) .await .unwrap(), ControlFlow::Continue(Some(PathBuf::from("/root/work"))), - "Should return first cached value found without path checks" + "Should return closest cached value found without path checks" + ); + + assert_eq!( + Prettier::locate_prettier_installation( + fs.as_ref(), + &HashSet::default(), + Path::new("/root/work/web_blog/node_modules/expect/build/print.js") + ) + .await + .unwrap(), + ControlFlow::Break(()), + "Should not allow formatting files inside node_modules/" + ); + assert_eq!( + Prettier::locate_prettier_installation( + fs.as_ref(), + &HashSet::from_iter( + [PathBuf::from("/root"), PathBuf::from("/root/work")].into_iter() + ), + Path::new("/root/work/web_blog/node_modules/expect/build/print.js") + ) + .await + .unwrap(), + ControlFlow::Break(()), + "Should ignore cache lookup for files inside node_modules/" ); } @@ -678,7 +712,9 @@ mod tests { }, }, }, - "node_modules": {}, + "node_modules": { + "test.js": "// test.js contents", + }, "package.json": r#"{ "devDependencies": { "prettier": "^3.0.3" @@ -710,6 +746,29 @@ mod tests { ControlFlow::Continue(Some(PathBuf::from("/root/work/full-stack-foundations"))), "Should ascend to the multi-workspace root and find the prettier there", ); + + assert_eq!( + Prettier::locate_prettier_installation( + fs.as_ref(), + &HashSet::default(), + Path::new("/root/work/full-stack-foundations/node_modules/prettier/index.js") + ) + .await + .unwrap(), + ControlFlow::Break(()), + "Should not allow formatting files inside root node_modules/" + ); + assert_eq!( + Prettier::locate_prettier_installation( + fs.as_ref(), + &HashSet::default(), + Path::new("/root/work/full-stack-foundations/exercises/03.loading/01.problem.loader/node_modules/test.js") + ) + .await + .unwrap(), + ControlFlow::Break(()), + "Should not allow formatting files inside submodule's node_modules/" + ); } #[gpui::test] From 2e957bc5647b99c7746f3ddfad04d5298152c36f Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Thu, 9 Nov 2023 14:40:53 +0200 Subject: [PATCH 07/76] Do not propose prettier formatters for documents in node_modules/ --- crates/prettier/src/prettier.rs | 6 ++++++ crates/project/src/project.rs | 30 +++++++++++++----------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/crates/prettier/src/prettier.rs b/crates/prettier/src/prettier.rs index b73cd8a1b0b070913d317ec13257c339249d88cf..cb9d32d0b05115e1e9b3176c38ed6caf4b98ec49 100644 --- a/crates/prettier/src/prettier.rs +++ b/crates/prettier/src/prettier.rs @@ -64,6 +64,12 @@ impl Prettier { .components() .take_while(|component| component.as_os_str().to_string_lossy() != "node_modules") .collect::(); + if path_to_check != locate_from { + log::debug!( + "Skipping prettier location for path {path_to_check:?} that is inside node_modules" + ); + return Ok(ControlFlow::Break(())); + } let path_to_check_metadata = fs .metadata(&path_to_check) .await diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs index 40736b97c208f7e6a55998474014ce6feef4efcb..468659e5b9fbfcceee9b03f49ec663832a354e18 100644 --- a/crates/project/src/project.rs +++ b/crates/project/src/project.rs @@ -173,8 +173,7 @@ pub struct Project { struct DefaultPrettier { instance: Option, Arc>>>>, installation_process: Option>>>>, - // TODO kb uncomment - // #[cfg(not(any(test, feature = "test-support")))] + #[cfg(not(any(test, feature = "test-support")))] installed_plugins: HashSet<&'static str>, } @@ -8540,18 +8539,17 @@ impl Project { } } - // TODO kb uncomment - // #[cfg(any(test, feature = "test-support"))] - // fn install_default_formatters( - // &mut self, - // _worktree: Option, - // _new_language: &Language, - // _language_settings: &LanguageSettings, - // _cx: &mut ModelContext, - // ) { - // } + #[cfg(any(test, feature = "test-support"))] + fn install_default_formatters( + &mut self, + _worktree: Option, + _new_language: &Language, + _language_settings: &LanguageSettings, + _cx: &mut ModelContext, + ) { + } - // #[cfg(not(any(test, feature = "test-support")))] + #[cfg(not(any(test, feature = "test-support")))] fn install_default_formatters( &mut self, worktree: Option, @@ -8714,8 +8712,7 @@ fn start_default_prettier( .get_or_insert_with(|| DefaultPrettier { instance: None, installation_process: None, - // TODO kb uncomment - // #[cfg(not(any(test, feature = "test-support")))] + #[cfg(not(any(test, feature = "test-support")))] installed_plugins: HashSet::default(), }) .instance = Some(new_default_prettier.clone()); @@ -8797,8 +8794,7 @@ fn register_new_prettier( } } -// TODO kb uncomment -// #[cfg(not(any(test, feature = "test-support")))] +#[cfg(not(any(test, feature = "test-support")))] async fn install_default_prettier( plugins_to_install: HashSet<&'static str>, node: Arc, From f55d89088bcdc43d1ac4f7ac787d6dc732e7c0ea Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Thu, 9 Nov 2023 17:18:41 +0200 Subject: [PATCH 08/76] Port changes to gpui2 --- crates/prettier2/src/prettier2.rs | 154 ++++++++++++++++++++++-------- crates/project2/src/project2.rs | 16 ++-- 2 files changed, 122 insertions(+), 48 deletions(-) diff --git a/crates/prettier2/src/prettier2.rs b/crates/prettier2/src/prettier2.rs index 44151774ae53194558ec38f97451c3c399246455..faa97bad7e981960eea5c614c22eb226c7c27d08 100644 --- a/crates/prettier2/src/prettier2.rs +++ b/crates/prettier2/src/prettier2.rs @@ -7,6 +7,7 @@ use lsp::{LanguageServer, LanguageServerId}; use node_runtime::NodeRuntime; use serde::{Deserialize, Serialize}; use std::{ + ops::ControlFlow, path::{Path, PathBuf}, sync::Arc, }; @@ -58,11 +59,17 @@ impl Prettier { fs: &dyn Fs, installed_prettiers: &HashSet, locate_from: &Path, - ) -> anyhow::Result> { + ) -> anyhow::Result>> { let mut path_to_check = locate_from .components() .take_while(|component| component.as_os_str().to_string_lossy() != "node_modules") .collect::(); + if path_to_check != locate_from { + log::debug!( + "Skipping prettier location for path {path_to_check:?} that is inside node_modules" + ); + return Ok(ControlFlow::Break(())); + } let path_to_check_metadata = fs .metadata(&path_to_check) .await @@ -76,14 +83,14 @@ impl Prettier { loop { if installed_prettiers.contains(&path_to_check) { log::debug!("Found prettier path {path_to_check:?} in installed prettiers"); - return Ok(Some(path_to_check)); + return Ok(ControlFlow::Continue(Some(path_to_check))); } else if let Some(package_json_contents) = read_package_json(fs, &path_to_check).await? { if has_prettier_in_package_json(&package_json_contents) { if has_prettier_in_node_modules(fs, &path_to_check).await? { log::debug!("Found prettier path {path_to_check:?} in both package.json and node_modules"); - return Ok(Some(path_to_check)); + return Ok(ControlFlow::Continue(Some(path_to_check))); } else if project_path_with_prettier_dependency.is_none() { project_path_with_prettier_dependency = Some(path_to_check.clone()); } @@ -109,7 +116,7 @@ impl Prettier { }) { anyhow::ensure!(has_prettier_in_node_modules(fs, &path_to_check).await?, "Found prettier path {path_to_check:?} in the workspace root for project in {project_path_with_prettier_dependency:?}, but it's not installed into workspace root's node_modules"); log::info!("Found prettier path {path_to_check:?} in the workspace root for project in {project_path_with_prettier_dependency:?}"); - return Ok(Some(path_to_check)); + return Ok(ControlFlow::Continue(Some(path_to_check))); } else { log::warn!("Skipping path {path_to_check:?} that has prettier in its 'node_modules' subdirectory, but is not included in its package.json workspaces {workspaces:?}"); } @@ -132,7 +139,7 @@ impl Prettier { } None => { log::debug!("Found no prettier in ancestors of {locate_from:?}"); - return Ok(None); + return Ok(ControlFlow::Continue(None)); } } } @@ -527,37 +534,40 @@ mod tests { .await; assert!( - Prettier::locate_prettier_installation( - fs.as_ref(), - &HashSet::default(), - Path::new("/root/.config/zed/settings.json"), - ) - .await - .unwrap() - .is_none(), + matches!( + Prettier::locate_prettier_installation( + fs.as_ref(), + &HashSet::default(), + Path::new("/root/.config/zed/settings.json"), + ) + .await, + Ok(ControlFlow::Continue(None)) + ), "Should successfully find no prettier for path hierarchy without it" ); assert!( - Prettier::locate_prettier_installation( - fs.as_ref(), - &HashSet::default(), - Path::new("/root/work/project/src/index.js") - ) - .await - .unwrap() - .is_none(), + matches!( + Prettier::locate_prettier_installation( + fs.as_ref(), + &HashSet::default(), + Path::new("/root/work/project/src/index.js") + ) + .await, + Ok(ControlFlow::Continue(None)) + ), "Should successfully find no prettier for path hierarchy that has node_modules with prettier, but no package.json mentions of it" ); assert!( - Prettier::locate_prettier_installation( - fs.as_ref(), - &HashSet::default(), - Path::new("/root/work/project/node_modules/expect/build/print.js") - ) - .await - .unwrap() - .is_none(), - "Even though it has package.json with prettier in it and no prettier on node_modules along the path, nothing should fail since declared inside node_modules" + matches!( + Prettier::locate_prettier_installation( + fs.as_ref(), + &HashSet::default(), + Path::new("/root/work/project/node_modules/expect/build/print.js") + ) + .await, + Ok(ControlFlow::Break(())) + ), + "Should not format files inside node_modules/" ); } @@ -610,7 +620,7 @@ mod tests { ) .await .unwrap(), - Some(PathBuf::from("/root/web_blog")), + ControlFlow::Continue(Some(PathBuf::from("/root/web_blog"))), "Should find a preinstalled prettier in the project root" ); assert_eq!( @@ -621,8 +631,8 @@ mod tests { ) .await .unwrap(), - Some(PathBuf::from("/root/web_blog")), - "Should find a preinstalled prettier in the project root even for node_modules files" + ControlFlow::Break(()), + "Should not allow formatting node_modules/ contents" ); } @@ -634,6 +644,18 @@ mod tests { json!({ "work": { "web_blog": { + "node_modules": { + "expect": { + "build": { + "print.js": "// print.js file contents", + }, + "package.json": r#"{ + "devDependencies": { + "prettier": "2.5.1" + } + }"#, + }, + }, "pages": { "[slug].tsx": "// [slug].tsx file contents", }, @@ -654,18 +676,16 @@ mod tests { ) .await; - let path = "/root/work/web_blog/node_modules/pages/[slug].tsx"; match Prettier::locate_prettier_installation( fs.as_ref(), &HashSet::default(), - Path::new(path) + Path::new("/root/work/web_blog/pages/[slug].tsx") ) .await { Ok(path) => panic!("Expected to fail for prettier in package.json but not in node_modules found, but got path {path:?}"), Err(e) => { let message = e.to_string(); - assert!(message.contains(path), "Error message should mention which start file was used for location"); - assert!(message.contains("/root/work/web_blog"), "Error message should mention potential candidates without prettier node_modules contents"); + assert!(message.contains("/root/work/web_blog"), "Error message should mention which project had prettier defined"); }, }; @@ -675,12 +695,37 @@ mod tests { &HashSet::from_iter( [PathBuf::from("/root"), PathBuf::from("/root/work")].into_iter() ), - Path::new("/root/work/web_blog/node_modules/pages/[slug].tsx") + Path::new("/root/work/web_blog/pages/[slug].tsx") + ) + .await + .unwrap(), + ControlFlow::Continue(Some(PathBuf::from("/root/work"))), + "Should return closest cached value found without path checks" + ); + + assert_eq!( + Prettier::locate_prettier_installation( + fs.as_ref(), + &HashSet::default(), + Path::new("/root/work/web_blog/node_modules/expect/build/print.js") + ) + .await + .unwrap(), + ControlFlow::Break(()), + "Should not allow formatting files inside node_modules/" + ); + assert_eq!( + Prettier::locate_prettier_installation( + fs.as_ref(), + &HashSet::from_iter( + [PathBuf::from("/root"), PathBuf::from("/root/work")].into_iter() + ), + Path::new("/root/work/web_blog/node_modules/expect/build/print.js") ) .await .unwrap(), - Some(PathBuf::from("/root/work")), - "Should return first cached value found without path checks" + ControlFlow::Break(()), + "Should ignore cache lookup for files inside node_modules/" ); } @@ -704,7 +749,9 @@ mod tests { }, }, }, - "node_modules": {}, + "node_modules": { + "test.js": "// test.js contents", + }, "package.json": r#"{ "devDependencies": { "prettier": "^3.0.3" @@ -733,9 +780,32 @@ mod tests { &HashSet::default(), Path::new("/root/work/full-stack-foundations/exercises/03.loading/01.problem.loader/app/routes/users+/$username_+/notes.tsx"), ).await.unwrap(), - Some(PathBuf::from("/root/work/full-stack-foundations")), + ControlFlow::Continue(Some(PathBuf::from("/root/work/full-stack-foundations"))), "Should ascend to the multi-workspace root and find the prettier there", ); + + assert_eq!( + Prettier::locate_prettier_installation( + fs.as_ref(), + &HashSet::default(), + Path::new("/root/work/full-stack-foundations/node_modules/prettier/index.js") + ) + .await + .unwrap(), + ControlFlow::Break(()), + "Should not allow formatting files inside root node_modules/" + ); + assert_eq!( + Prettier::locate_prettier_installation( + fs.as_ref(), + &HashSet::default(), + Path::new("/root/work/full-stack-foundations/exercises/03.loading/01.problem.loader/node_modules/test.js") + ) + .await + .unwrap(), + ControlFlow::Break(()), + "Should not allow formatting files inside submodule's node_modules/" + ); } #[gpui::test] diff --git a/crates/project2/src/project2.rs b/crates/project2/src/project2.rs index 95f04dfc8225d80daa0b54527d44bedcaf780a99..61b0f486d31620b14ad8d12d6ba675250277ad7f 100644 --- a/crates/project2/src/project2.rs +++ b/crates/project2/src/project2.rs @@ -69,7 +69,7 @@ use std::{ hash::Hash, mem, num::NonZeroU32, - ops::Range, + ops::{ControlFlow, Range}, path::{self, Component, Path, PathBuf}, process::Stdio, str, @@ -8488,7 +8488,10 @@ impl Project { }) .await { - Ok(None) => { + Ok(ControlFlow::Break(())) => { + return None; + } + Ok(ControlFlow::Continue(None)) => { match project.update(&mut cx, |project, _| { project .prettiers_per_worktree @@ -8520,7 +8523,7 @@ impl Project { .shared())), } } - Ok(Some(prettier_dir)) => { + Ok(ControlFlow::Continue(Some(prettier_dir))) => { match project.update(&mut cx, |project, _| { project .prettiers_per_worktree @@ -8662,7 +8665,7 @@ impl Project { .await }) } - None => Task::ready(Ok(None)), + None => Task::ready(Ok(ControlFlow::Break(()))), }; let mut plugins_to_install = prettier_plugins; let previous_installation_process = @@ -8692,8 +8695,9 @@ impl Project { .context("locate prettier installation") .map_err(Arc::new)? { - Some(_non_default_prettier) => return Ok(()), - None => { + ControlFlow::Break(()) => return Ok(()), + ControlFlow::Continue(Some(_non_default_prettier)) => return Ok(()), + ControlFlow::Continue(None) => { let mut needs_install = match previous_installation_process { Some(previous_installation_process) => { previous_installation_process.await.is_err() From 7253160b042c3900909dca3ec618c35243ec3fce Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Thu, 9 Nov 2023 11:01:18 -0500 Subject: [PATCH 09/76] Add more vscode colors --- crates/theme_importer/src/vscode.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/crates/theme_importer/src/vscode.rs b/crates/theme_importer/src/vscode.rs index 864aa47ea2e96563eefc0f8bf64a95be2cb89ab4..2456f77f3a7312b9ab191df76aafa184b1ac07b2 100644 --- a/crates/theme_importer/src/vscode.rs +++ b/crates/theme_importer/src/vscode.rs @@ -445,7 +445,7 @@ impl VsCodeThemeConverter { .as_ref() .traverse(|color| try_parse_color(&color))?, border_focused: vscode_colors - .panel_border + .focus_border .as_ref() .traverse(|color| try_parse_color(&color))?, border_disabled: vscode_colors @@ -476,6 +476,22 @@ impl VsCodeThemeConverter { .button_background .as_ref() .traverse(|color| try_parse_color(&color))?, + element_hover: vscode_colors + .list_hover_background + .as_ref() + .traverse(|color| try_parse_color(&color))?, + element_selected: vscode_colors + .list_active_selection_background + .as_ref() + .traverse(|color| try_parse_color(&color))?, + ghost_element_hover: vscode_colors + .list_hover_background + .as_ref() + .traverse(|color| try_parse_color(&color))?, + drop_target_background: vscode_colors + .list_drop_background + .as_ref() + .traverse(|color| try_parse_color(&color))?, text: vscode_colors .foreground .as_ref() From 604682bb9144a5718b606d7ff779d42a3d4b7f26 Mon Sep 17 00:00:00 2001 From: "Joseph T. Lyons" Date: Thu, 9 Nov 2023 11:08:30 -0500 Subject: [PATCH 10/76] Fix typo in EULA --- script/eula/eula.md | 2 +- script/eula/eula.rtf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/script/eula/eula.md b/script/eula/eula.md index 95d051d0b39092e5407e47e09f719cfe4d4bde7c..b1cd6d4eb52936424b14bfe91e0c0f1f3caf515e 100644 --- a/script/eula/eula.md +++ b/script/eula/eula.md @@ -40,7 +40,7 @@ Customer Data consisting of non-personally-identifiable information that helps Z ##### 3.3.1.2. Crash Reports -Customer Data consisting of data related to the behavior of the Solution prior to a crash or failure, such as stack traces are collected and classified as " Crash Reports". Zed will use commercially reasonable efforts to exclude any personally identifiable information from Crash Reports, but due to the nature of a crash, Zed does not ensure that information such as paths will be excluded from Crash Reports. Crash Reports will be used solely for Zed's internal purposes in connection with diagnosing defects in the Solution that led to the crash. You may grant us permission to capture Crash Reports when installing or activating the Solution, and You may change Your preferences at any time in the settings feature of the Solution. Once You grant us this permission, Zed will retain the Crash Reports indefinitely. +Customer Data consisting of data related to the behavior of the Solution prior to a crash or failure, such as stack traces are collected and classified as "Crash Reports". Zed will use commercially reasonable efforts to exclude any personally identifiable information from Crash Reports, but due to the nature of a crash, Zed does not ensure that information such as paths will be excluded from Crash Reports. Crash Reports will be used solely for Zed's internal purposes in connection with diagnosing defects in the Solution that led to the crash. You may grant us permission to capture Crash Reports when installing or activating the Solution, and You may change Your preferences at any time in the settings feature of the Solution. Once You grant us this permission, Zed will retain the Crash Reports indefinitely. ##### 3.3.1.3. User Content diff --git a/script/eula/eula.rtf b/script/eula/eula.rtf index 24e37a20dc37767d02600995c8de32b2a071d6be..3bdbb463bbd807e967da9ab69293ae17be7c81e2 100644 --- a/script/eula/eula.rtf +++ b/script/eula/eula.rtf @@ -69,7 +69,7 @@ \f0\b\fs20 \cf2 3.3.1.2. Crash Reports\ \pard\pardeftab720\sa240\partightenfactor0 -\f1\b0\fs24 \cf2 Customer Data consisting of data related to the behavior of the Solution prior to a crash or failure, such as stack traces are collected and classified as " Crash Reports". Zed will use commercially reasonable efforts to exclude any personally identifiable information from Crash Reports, but due to the nature of a crash, Zed does not ensure that information such as paths will be excluded from Crash Reports. Crash Reports will be used solely for Zed's internal purposes in connection with diagnosing defects in the Solution that led to the crash. You may grant us permission to capture Crash Reports when installing or activating the Solution, and You may change Your preferences at any time in the settings feature of the Solution. Once You grant us this permission, Zed will retain the Crash Reports indefinitely.\ +\f1\b0\fs24 \cf2 Customer Data consisting of data related to the behavior of the Solution prior to a crash or failure, such as stack traces are collected and classified as "Crash Reports". Zed will use commercially reasonable efforts to exclude any personally identifiable information from Crash Reports, but due to the nature of a crash, Zed does not ensure that information such as paths will be excluded from Crash Reports. Crash Reports will be used solely for Zed's internal purposes in connection with diagnosing defects in the Solution that led to the crash. You may grant us permission to capture Crash Reports when installing or activating the Solution, and You may change Your preferences at any time in the settings feature of the Solution. Once You grant us this permission, Zed will retain the Crash Reports indefinitely.\ \pard\pardeftab720\sa332\partightenfactor0 \f0\b\fs20 \cf2 3.3.1.3. User Content\ From cfee1401ed5e19fff04e3b970b685cd02d540c53 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 9 Nov 2023 17:30:41 +0100 Subject: [PATCH 11/76] Extract `AnyElement::{measure,draw}` Co-Authored-By: Nathan Sobo --- crates/gpui2/src/element.rs | 31 +++++++++++++++++- crates/gpui2/src/elements/uniform_list.rs | 38 +++++++++-------------- 2 files changed, 44 insertions(+), 25 deletions(-) diff --git a/crates/gpui2/src/element.rs b/crates/gpui2/src/element.rs index 8fdc17de07296d95def915f3a605f3988913eb2a..775b3b8a895215c49476e06d34913b3aa311c695 100644 --- a/crates/gpui2/src/element.rs +++ b/crates/gpui2/src/element.rs @@ -1,4 +1,6 @@ -use crate::{BorrowWindow, Bounds, ElementId, LayoutId, Pixels, ViewContext}; +use crate::{ + AvailableSpace, BorrowWindow, Bounds, ElementId, LayoutId, Pixels, Point, Size, ViewContext, +}; use derive_more::{Deref, DerefMut}; pub(crate) use smallvec::SmallVec; use std::{any::Any, mem}; @@ -196,6 +198,33 @@ impl AnyElement { pub fn paint(&mut self, view_state: &mut V, cx: &mut ViewContext) { self.0.paint(view_state, cx) } + + /// Initializes this element and performs layout within the given available space to determine its size. + pub fn measure( + &mut self, + available_space: Size, + view_state: &mut V, + cx: &mut ViewContext, + ) -> Size { + self.initialize(view_state, cx); + let layout_id = self.layout(view_state, cx); + cx.compute_layout(layout_id, available_space); + cx.layout_bounds(layout_id).size + } + + /// Initializes this element and performs layout in the available space, then paints it at the given origin. + pub fn draw( + &mut self, + origin: Point, + available_space: Size, + view_state: &mut V, + cx: &mut ViewContext, + ) { + self.initialize(view_state, cx); + let layout_id = self.layout(view_state, cx); + cx.compute_layout(layout_id, available_space); + cx.with_element_offset(Some(origin), |cx| self.paint(view_state, cx)) + } } pub trait Component { diff --git a/crates/gpui2/src/elements/uniform_list.rs b/crates/gpui2/src/elements/uniform_list.rs index e1160227637c8374fa47e922a0fabb509308ec1e..a4524d5496b63cacd631ff1ab414dede29bc6086 100644 --- a/crates/gpui2/src/elements/uniform_list.rs +++ b/crates/gpui2/src/elements/uniform_list.rs @@ -1,6 +1,6 @@ use crate::{ - point, px, AnyElement, AvailableSpace, BorrowWindow, Bounds, Component, Element, ElementId, - ElementInteractivity, InteractiveElementState, LayoutId, Pixels, Point, Size, + point, px, size, AnyElement, AvailableSpace, BorrowWindow, Bounds, Component, Element, + ElementId, ElementInteractivity, InteractiveElementState, LayoutId, Pixels, Point, Size, StatefulInteractive, StatefulInteractivity, StatelessInteractive, StatelessInteractivity, StyleRefinement, Styled, ViewContext, }; @@ -165,19 +165,13 @@ impl Element for UniformList { cx.with_z_index(1, |cx| { for (item, ix) in items.iter_mut().zip(visible_range) { - item.initialize(view_state, cx); - - let layout_id = item.layout(view_state, cx); - cx.compute_layout( - layout_id, - Size { - width: AvailableSpace::Definite(bounds.size.width), - height: AvailableSpace::Definite(item_height), - }, - ); - let offset = + let item_origin = padded_bounds.origin + point(px(0.), item_height * ix + scroll_offset); - cx.with_element_offset(Some(offset), |cx| item.paint(view_state, cx)) + let available_space = size( + AvailableSpace::Definite(bounds.size.width), + AvailableSpace::Definite(item_height), + ); + item.draw(item_origin, available_space, view_state, cx); } }); } else { @@ -205,18 +199,14 @@ impl UniformList { cx: &mut ViewContext, ) -> Pixels { let mut items = (self.render_items)(view_state, 0..1, cx); - debug_assert!(items.len() == 1); + debug_assert_eq!(items.len(), 1); let mut item_to_measure = items.pop().unwrap(); - item_to_measure.initialize(view_state, cx); - let layout_id = item_to_measure.layout(view_state, cx); - cx.compute_layout( - layout_id, - Size { - width: AvailableSpace::Definite(list_bounds.size.width), - height: AvailableSpace::MinContent, - }, + let available_space = size( + AvailableSpace::Definite(list_bounds.size.width), + AvailableSpace::MinContent, ); - cx.layout_bounds(layout_id).size.height + let size = item_to_measure.measure(available_space, view_state, cx); + size.height } pub fn track_scroll(mut self, handle: UniformListScrollHandle) -> Self { From 4b5ca3e420f990f2a0fafeec4ec25f5af0a5362e Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Thu, 9 Nov 2023 11:30:59 -0500 Subject: [PATCH 12/76] Allow imported themes to refine StatusColors Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com> --- crates/theme2/src/colors.rs | 2 +- crates/theme2/src/themes/andromeda.rs | 27 +++- crates/theme2/src/themes/ayu.rs | 36 ++++- crates/theme2/src/themes/dracula.rs | 16 ++- crates/theme2/src/themes/gruvbox.rs | 63 ++++++++- crates/theme2/src/themes/night_owl.rs | 27 +++- crates/theme2/src/themes/nord.rs | 14 +- crates/theme2/src/themes/notctis.rs | 146 +++++++++++++++++++-- crates/theme2/src/themes/palenight.rs | 33 ++++- crates/theme2/src/themes/rose_pine.rs | 42 +++++- crates/theme2/src/themes/solarized.rs | 24 +++- crates/theme2/src/themes/synthwave_84.rs | 14 +- crates/theme2/src/user_theme.rs | 4 +- crates/theme_importer/src/main.rs | 2 +- crates/theme_importer/src/theme_printer.rs | 51 ++++--- crates/theme_importer/src/vscode.rs | 30 ++++- 16 files changed, 475 insertions(+), 56 deletions(-) diff --git a/crates/theme2/src/colors.rs b/crates/theme2/src/colors.rs index 83af983d04486ddcb0d03ecfc1d35c034079259e..086b1ed767478591e393014bcc82d271ede70969 100644 --- a/crates/theme2/src/colors.rs +++ b/crates/theme2/src/colors.rs @@ -14,7 +14,7 @@ pub struct SystemColors { } #[derive(Refineable, Clone, Debug)] -#[refineable(debug)] +#[refineable(debug, deserialize)] pub struct StatusColors { pub conflict: Hsla, pub created: Hsla, diff --git a/crates/theme2/src/themes/andromeda.rs b/crates/theme2/src/themes/andromeda.rs index 72354a79a853488c51938463f93af9bc33f2c5ad..6afff66df1012d2c34489cea22530f99de993513 100644 --- a/crates/theme2/src/themes/andromeda.rs +++ b/crates/theme2/src/themes/andromeda.rs @@ -4,7 +4,8 @@ use gpui::rgba; use crate::{ - Appearance, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, + UserThemeStylesRefinement, }; pub fn andromeda() -> UserThemeFamily { @@ -19,7 +20,7 @@ pub fn andromeda() -> UserThemeFamily { colors: ThemeColorsRefinement { border: Some(rgba(0x1b1d23ff).into()), border_variant: Some(rgba(0x1b1d23ff).into()), - border_focused: Some(rgba(0x1b1d23ff).into()), + border_focused: Some(rgba(0x746f77ff).into()), border_selected: Some(rgba(0x1b1d23ff).into()), border_transparent: Some(rgba(0x1b1d23ff).into()), border_disabled: Some(rgba(0x1b1d23ff).into()), @@ -27,6 +28,10 @@ pub fn andromeda() -> UserThemeFamily { surface_background: Some(rgba(0x23262eff).into()), background: Some(rgba(0x23262eff).into()), element_background: Some(rgba(0x00e8c5cc).into()), + element_hover: Some(rgba(0x23262eff).into()), + element_selected: Some(rgba(0x23262eff).into()), + drop_target_background: Some(rgba(0x3a404eff).into()), + ghost_element_hover: Some(rgba(0x23262eff).into()), text: Some(rgba(0xd4cdd8ff).into()), tab_inactive_background: Some(rgba(0x23262eff).into()), tab_active_background: Some(rgba(0x23262eff).into()), @@ -48,6 +53,12 @@ pub fn andromeda() -> UserThemeFamily { terminal_ansi_cyan: Some(rgba(0x00e8c6ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xfc634cff).into()), + error: Some(rgba(0xfc634cff).into()), + hidden: Some(rgba(0x746f77ff).into()), + ..Default::default() + }, }, }, UserTheme { @@ -57,7 +68,7 @@ pub fn andromeda() -> UserThemeFamily { colors: ThemeColorsRefinement { border: Some(rgba(0x1b1d23ff).into()), border_variant: Some(rgba(0x1b1d23ff).into()), - border_focused: Some(rgba(0x1b1d23ff).into()), + border_focused: Some(rgba(0x746f77ff).into()), border_selected: Some(rgba(0x1b1d23ff).into()), border_transparent: Some(rgba(0x1b1d23ff).into()), border_disabled: Some(rgba(0x1b1d23ff).into()), @@ -65,6 +76,10 @@ pub fn andromeda() -> UserThemeFamily { surface_background: Some(rgba(0x23262eff).into()), background: Some(rgba(0x262933ff).into()), element_background: Some(rgba(0x00e8c5cc).into()), + element_hover: Some(rgba(0x23262eff).into()), + element_selected: Some(rgba(0x23262eff).into()), + drop_target_background: Some(rgba(0x3a404eff).into()), + ghost_element_hover: Some(rgba(0x23262eff).into()), text: Some(rgba(0xd4cdd8ff).into()), tab_inactive_background: Some(rgba(0x23262eff).into()), tab_active_background: Some(rgba(0x262933ff).into()), @@ -86,6 +101,12 @@ pub fn andromeda() -> UserThemeFamily { terminal_ansi_cyan: Some(rgba(0x00e8c6ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xfc634cff).into()), + error: Some(rgba(0xfc634cff).into()), + hidden: Some(rgba(0x746f77ff).into()), + ..Default::default() + }, }, }, ], diff --git a/crates/theme2/src/themes/ayu.rs b/crates/theme2/src/themes/ayu.rs index b27f62b442d7bd0c5b6e39954c048888bc5abef1..8454c0af463527bd62e23decf08e6f9e3dbe0dea 100644 --- a/crates/theme2/src/themes/ayu.rs +++ b/crates/theme2/src/themes/ayu.rs @@ -4,7 +4,8 @@ use gpui::rgba; use crate::{ - Appearance, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, + UserThemeStylesRefinement, }; pub fn ayu() -> UserThemeFamily { @@ -19,7 +20,7 @@ pub fn ayu() -> UserThemeFamily { colors: ThemeColorsRefinement { border: Some(rgba(0x6b7d8f1f).into()), border_variant: Some(rgba(0x6b7d8f1f).into()), - border_focused: Some(rgba(0x6b7d8f1f).into()), + border_focused: Some(rgba(0xffaa32b3).into()), border_selected: Some(rgba(0x6b7d8f1f).into()), border_transparent: Some(rgba(0x6b7d8f1f).into()), border_disabled: Some(rgba(0x6b7d8f1f).into()), @@ -27,6 +28,9 @@ pub fn ayu() -> UserThemeFamily { surface_background: Some(rgba(0xf8f9faff).into()), background: Some(rgba(0xf8f9faff).into()), element_background: Some(rgba(0xffaa32ff).into()), + element_hover: Some(rgba(0x55728f1f).into()), + element_selected: Some(rgba(0x55728f1f).into()), + ghost_element_hover: Some(rgba(0x55728f1f).into()), text: Some(rgba(0x8a9199ff).into()), tab_inactive_background: Some(rgba(0xf8f9faff).into()), tab_active_background: Some(rgba(0xf8f9faff).into()), @@ -53,6 +57,12 @@ pub fn ayu() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0xc7c7c7ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xe65050ff).into()), + error: Some(rgba(0xe65050ff).into()), + hidden: Some(rgba(0x8a9199ff).into()), + ..Default::default() + }, }, }, UserTheme { @@ -62,7 +72,7 @@ pub fn ayu() -> UserThemeFamily { colors: ThemeColorsRefinement { border: Some(rgba(0x171a24ff).into()), border_variant: Some(rgba(0x171a24ff).into()), - border_focused: Some(rgba(0x171a24ff).into()), + border_focused: Some(rgba(0xffcb65b3).into()), border_selected: Some(rgba(0x171a24ff).into()), border_transparent: Some(rgba(0x171a24ff).into()), border_disabled: Some(rgba(0x171a24ff).into()), @@ -70,6 +80,9 @@ pub fn ayu() -> UserThemeFamily { surface_background: Some(rgba(0x1f2430ff).into()), background: Some(rgba(0x1f2430ff).into()), element_background: Some(rgba(0xffcb65ff).into()), + element_hover: Some(rgba(0x63759926).into()), + element_selected: Some(rgba(0x63759926).into()), + ghost_element_hover: Some(rgba(0x63759926).into()), text: Some(rgba(0x707a8cff).into()), tab_inactive_background: Some(rgba(0x1f2430ff).into()), tab_active_background: Some(rgba(0x1f2430ff).into()), @@ -96,6 +109,12 @@ pub fn ayu() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0xc7c7c7ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xff6565ff).into()), + error: Some(rgba(0xff6565ff).into()), + hidden: Some(rgba(0x707a8cff).into()), + ..Default::default() + }, }, }, UserTheme { @@ -105,7 +124,7 @@ pub fn ayu() -> UserThemeFamily { colors: ThemeColorsRefinement { border: Some(rgba(0x1e232bff).into()), border_variant: Some(rgba(0x1e232bff).into()), - border_focused: Some(rgba(0x1e232bff).into()), + border_focused: Some(rgba(0xe6b450b3).into()), border_selected: Some(rgba(0x1e232bff).into()), border_transparent: Some(rgba(0x1e232bff).into()), border_disabled: Some(rgba(0x1e232bff).into()), @@ -113,6 +132,9 @@ pub fn ayu() -> UserThemeFamily { surface_background: Some(rgba(0x0b0e14ff).into()), background: Some(rgba(0x0b0e14ff).into()), element_background: Some(rgba(0xe6b450ff).into()), + element_hover: Some(rgba(0x47526640).into()), + element_selected: Some(rgba(0x47526640).into()), + ghost_element_hover: Some(rgba(0x47526640).into()), text: Some(rgba(0x565b66ff).into()), tab_inactive_background: Some(rgba(0x0b0e14ff).into()), tab_active_background: Some(rgba(0x0b0e14ff).into()), @@ -139,6 +161,12 @@ pub fn ayu() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0xc7c7c7ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xd95757ff).into()), + error: Some(rgba(0xd95757ff).into()), + hidden: Some(rgba(0x565b66ff).into()), + ..Default::default() + }, }, }, ], diff --git a/crates/theme2/src/themes/dracula.rs b/crates/theme2/src/themes/dracula.rs index ac5d594b9f4509170e44b8eff0fdbe6b5a3b197a..2a30f5a0c03e7894d6bfb9a6cdf9b4c5652c6461 100644 --- a/crates/theme2/src/themes/dracula.rs +++ b/crates/theme2/src/themes/dracula.rs @@ -4,7 +4,8 @@ use gpui::rgba; use crate::{ - Appearance, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, + UserThemeStylesRefinement, }; pub fn dracula() -> UserThemeFamily { @@ -18,7 +19,7 @@ pub fn dracula() -> UserThemeFamily { colors: ThemeColorsRefinement { border: Some(rgba(0xbd93f9ff).into()), border_variant: Some(rgba(0xbd93f9ff).into()), - border_focused: Some(rgba(0xbd93f9ff).into()), + border_focused: Some(rgba(0x6272a4ff).into()), border_selected: Some(rgba(0xbd93f9ff).into()), border_transparent: Some(rgba(0xbd93f9ff).into()), border_disabled: Some(rgba(0xbd93f9ff).into()), @@ -26,6 +27,10 @@ pub fn dracula() -> UserThemeFamily { surface_background: Some(rgba(0x282a35ff).into()), background: Some(rgba(0x282a35ff).into()), element_background: Some(rgba(0x44475aff).into()), + element_hover: Some(rgba(0x44475a75).into()), + element_selected: Some(rgba(0x44475aff).into()), + drop_target_background: Some(rgba(0x44475aff).into()), + ghost_element_hover: Some(rgba(0x44475a75).into()), text: Some(rgba(0xf8f8f2ff).into()), tab_inactive_background: Some(rgba(0x21222cff).into()), tab_active_background: Some(rgba(0x282a35ff).into()), @@ -52,6 +57,13 @@ pub fn dracula() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0xf8f8f2ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xff5555ff).into()), + error: Some(rgba(0xff5555ff).into()), + hidden: Some(rgba(0x6272a4ff).into()), + warning: Some(rgba(0xffb76bff).into()), + ..Default::default() + }, }, }], } diff --git a/crates/theme2/src/themes/gruvbox.rs b/crates/theme2/src/themes/gruvbox.rs index 2c388079a598f5c86ee3f6a1a1e348bfe14d1e86..33bb90d8e811ca3f5a5d6ebbe4725531d9689944 100644 --- a/crates/theme2/src/themes/gruvbox.rs +++ b/crates/theme2/src/themes/gruvbox.rs @@ -4,7 +4,8 @@ use gpui::rgba; use crate::{ - Appearance, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, + UserThemeStylesRefinement, }; pub fn gruvbox() -> UserThemeFamily { @@ -25,6 +26,10 @@ pub fn gruvbox() -> UserThemeFamily { border_disabled: Some(rgba(0x3c3836ff).into()), background: Some(rgba(0x1d2021ff).into()), element_background: Some(rgba(0x44858780).into()), + element_hover: Some(rgba(0x3c383680).into()), + element_selected: Some(rgba(0x3c383680).into()), + drop_target_background: Some(rgba(0x3c3836ff).into()), + ghost_element_hover: Some(rgba(0x3c383680).into()), text: Some(rgba(0xebdbb2ff).into()), tab_inactive_background: Some(rgba(0x1d2021ff).into()), tab_active_background: Some(rgba(0x32302fff).into()), @@ -51,6 +56,12 @@ pub fn gruvbox() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0xa89984ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xfb4833ff).into()), + error: Some(rgba(0xfb4833ff).into()), + hidden: Some(rgba(0xa89984ff).into()), + ..Default::default() + }, }, }, UserTheme { @@ -66,6 +77,10 @@ pub fn gruvbox() -> UserThemeFamily { border_disabled: Some(rgba(0x3c3836ff).into()), background: Some(rgba(0x282828ff).into()), element_background: Some(rgba(0x44858780).into()), + element_hover: Some(rgba(0x3c383680).into()), + element_selected: Some(rgba(0x3c383680).into()), + drop_target_background: Some(rgba(0x3c3836ff).into()), + ghost_element_hover: Some(rgba(0x3c383680).into()), text: Some(rgba(0xebdbb2ff).into()), tab_inactive_background: Some(rgba(0x282828ff).into()), tab_active_background: Some(rgba(0x3c3836ff).into()), @@ -92,6 +107,12 @@ pub fn gruvbox() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0xa89984ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xfb4833ff).into()), + error: Some(rgba(0xfb4833ff).into()), + hidden: Some(rgba(0xa89984ff).into()), + ..Default::default() + }, }, }, UserTheme { @@ -107,6 +128,10 @@ pub fn gruvbox() -> UserThemeFamily { border_disabled: Some(rgba(0x3c3836ff).into()), background: Some(rgba(0x32302fff).into()), element_background: Some(rgba(0x44858780).into()), + element_hover: Some(rgba(0x3c383680).into()), + element_selected: Some(rgba(0x3c383680).into()), + drop_target_background: Some(rgba(0x3c3836ff).into()), + ghost_element_hover: Some(rgba(0x3c383680).into()), text: Some(rgba(0xebdbb2ff).into()), tab_inactive_background: Some(rgba(0x32302fff).into()), tab_active_background: Some(rgba(0x504945ff).into()), @@ -133,6 +158,12 @@ pub fn gruvbox() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0xa89984ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xfb4833ff).into()), + error: Some(rgba(0xfb4833ff).into()), + hidden: Some(rgba(0xa89984ff).into()), + ..Default::default() + }, }, }, UserTheme { @@ -148,6 +179,10 @@ pub fn gruvbox() -> UserThemeFamily { border_disabled: Some(rgba(0xebdbb2ff).into()), background: Some(rgba(0xf9f5d7ff).into()), element_background: Some(rgba(0x44858780).into()), + element_hover: Some(rgba(0xebdbb280).into()), + element_selected: Some(rgba(0xebdbb280).into()), + drop_target_background: Some(rgba(0xebdbb2ff).into()), + ghost_element_hover: Some(rgba(0xebdbb280).into()), text: Some(rgba(0x3c3836ff).into()), tab_inactive_background: Some(rgba(0xf9f5d7ff).into()), tab_active_background: Some(rgba(0xf2e5bcff).into()), @@ -174,6 +209,12 @@ pub fn gruvbox() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0x9d0006ff).into()), + error: Some(rgba(0x9d0006ff).into()), + hidden: Some(rgba(0x7c6f64ff).into()), + ..Default::default() + }, }, }, UserTheme { @@ -189,6 +230,10 @@ pub fn gruvbox() -> UserThemeFamily { border_disabled: Some(rgba(0xebdbb2ff).into()), background: Some(rgba(0xfbf1c7ff).into()), element_background: Some(rgba(0x44858780).into()), + element_hover: Some(rgba(0xebdbb280).into()), + element_selected: Some(rgba(0xebdbb280).into()), + drop_target_background: Some(rgba(0xebdbb2ff).into()), + ghost_element_hover: Some(rgba(0xebdbb280).into()), text: Some(rgba(0x3c3836ff).into()), tab_inactive_background: Some(rgba(0xfbf1c7ff).into()), tab_active_background: Some(rgba(0xebdbb2ff).into()), @@ -215,6 +260,12 @@ pub fn gruvbox() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0x9d0006ff).into()), + error: Some(rgba(0x9d0006ff).into()), + hidden: Some(rgba(0x7c6f64ff).into()), + ..Default::default() + }, }, }, UserTheme { @@ -230,6 +281,10 @@ pub fn gruvbox() -> UserThemeFamily { border_disabled: Some(rgba(0xebdbb2ff).into()), background: Some(rgba(0xf2e5bcff).into()), element_background: Some(rgba(0x44858780).into()), + element_hover: Some(rgba(0xebdbb280).into()), + element_selected: Some(rgba(0xebdbb280).into()), + drop_target_background: Some(rgba(0xebdbb2ff).into()), + ghost_element_hover: Some(rgba(0xebdbb280).into()), text: Some(rgba(0x3c3836ff).into()), tab_inactive_background: Some(rgba(0xf2e5bcff).into()), tab_active_background: Some(rgba(0xd5c4a1ff).into()), @@ -256,6 +311,12 @@ pub fn gruvbox() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0x9d0006ff).into()), + error: Some(rgba(0x9d0006ff).into()), + hidden: Some(rgba(0x7c6f64ff).into()), + ..Default::default() + }, }, }, ], diff --git a/crates/theme2/src/themes/night_owl.rs b/crates/theme2/src/themes/night_owl.rs index 24fa9e60735d725d1796935892da266234b286be..d406ab79db8794afff4b5f2593a7f2a2c3c99096 100644 --- a/crates/theme2/src/themes/night_owl.rs +++ b/crates/theme2/src/themes/night_owl.rs @@ -4,7 +4,8 @@ use gpui::rgba; use crate::{ - Appearance, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, + UserThemeStylesRefinement, }; pub fn night_owl() -> UserThemeFamily { @@ -19,7 +20,7 @@ pub fn night_owl() -> UserThemeFamily { colors: ThemeColorsRefinement { border: Some(rgba(0x5f7e97ff).into()), border_variant: Some(rgba(0x5f7e97ff).into()), - border_focused: Some(rgba(0x5f7e97ff).into()), + border_focused: Some(rgba(0x122d42ff).into()), border_selected: Some(rgba(0x5f7e97ff).into()), border_transparent: Some(rgba(0x5f7e97ff).into()), border_disabled: Some(rgba(0x5f7e97ff).into()), @@ -27,6 +28,10 @@ pub fn night_owl() -> UserThemeFamily { surface_background: Some(rgba(0x011526ff).into()), background: Some(rgba(0x011526ff).into()), element_background: Some(rgba(0x7d56c1cc).into()), + element_hover: Some(rgba(0x011526ff).into()), + element_selected: Some(rgba(0x234c708c).into()), + drop_target_background: Some(rgba(0x011526ff).into()), + ghost_element_hover: Some(rgba(0x011526ff).into()), text: Some(rgba(0xd6deebff).into()), tab_inactive_background: Some(rgba(0x01101cff).into()), tab_active_background: Some(rgba(0x0a2842ff).into()), @@ -52,6 +57,12 @@ pub fn night_owl() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0xffffffff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xef524fff).into()), + error: Some(rgba(0xef524fff).into()), + hidden: Some(rgba(0x5f7e97ff).into()), + ..Default::default() + }, }, }, UserTheme { @@ -61,7 +72,7 @@ pub fn night_owl() -> UserThemeFamily { colors: ThemeColorsRefinement { border: Some(rgba(0xd9d9d9ff).into()), border_variant: Some(rgba(0xd9d9d9ff).into()), - border_focused: Some(rgba(0xd9d9d9ff).into()), + border_focused: Some(rgba(0x93a1a1ff).into()), border_selected: Some(rgba(0xd9d9d9ff).into()), border_transparent: Some(rgba(0xd9d9d9ff).into()), border_disabled: Some(rgba(0xd9d9d9ff).into()), @@ -69,6 +80,9 @@ pub fn night_owl() -> UserThemeFamily { surface_background: Some(rgba(0xf0f0f0ff).into()), background: Some(rgba(0xfbfbfbff).into()), element_background: Some(rgba(0x29a298ff).into()), + element_hover: Some(rgba(0xd3e7f8ff).into()), + element_selected: Some(rgba(0xd3e7f8ff).into()), + ghost_element_hover: Some(rgba(0xd3e7f8ff).into()), text: Some(rgba(0x403f53ff).into()), tab_inactive_background: Some(rgba(0xf0f0f0ff).into()), tab_active_background: Some(rgba(0xf6f6f6ff).into()), @@ -95,6 +109,13 @@ pub fn night_owl() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0xf0f0f0ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0x403f53ff).into()), + error: Some(rgba(0x403f53ff).into()), + hidden: Some(rgba(0x403f53ff).into()), + warning: Some(rgba(0xdaa900ff).into()), + ..Default::default() + }, }, }, ], diff --git a/crates/theme2/src/themes/nord.rs b/crates/theme2/src/themes/nord.rs index 5b8688737a3678e3635130cd0f9064c65ae2ae14..11335476dd61ebf3972c40e7a20855c65f3adc23 100644 --- a/crates/theme2/src/themes/nord.rs +++ b/crates/theme2/src/themes/nord.rs @@ -4,7 +4,8 @@ use gpui::rgba; use crate::{ - Appearance, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, + UserThemeStylesRefinement, }; pub fn nord() -> UserThemeFamily { @@ -26,6 +27,10 @@ pub fn nord() -> UserThemeFamily { surface_background: Some(rgba(0x2e3440ff).into()), background: Some(rgba(0x2e3440ff).into()), element_background: Some(rgba(0x88bfd0ee).into()), + element_hover: Some(rgba(0x3b4252ff).into()), + element_selected: Some(rgba(0x88bfd0ff).into()), + drop_target_background: Some(rgba(0x88bfd099).into()), + ghost_element_hover: Some(rgba(0x3b4252ff).into()), text: Some(rgba(0xd8dee9ff).into()), tab_inactive_background: Some(rgba(0x2e3440ff).into()), tab_active_background: Some(rgba(0x3b4252ff).into()), @@ -52,6 +57,13 @@ pub fn nord() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0xe5e9f0ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xbf616aff).into()), + error: Some(rgba(0xbf616aff).into()), + hidden: Some(rgba(0xd8dee966).into()), + warning: Some(rgba(0xebcb8bff).into()), + ..Default::default() + }, }, }], } diff --git a/crates/theme2/src/themes/notctis.rs b/crates/theme2/src/themes/notctis.rs index bb835c5397104220d5e12788f85bdeeeaab9aa2e..e590615cfd650e87fd40af2a2f0fb2af7b341c14 100644 --- a/crates/theme2/src/themes/notctis.rs +++ b/crates/theme2/src/themes/notctis.rs @@ -4,7 +4,8 @@ use gpui::rgba; use crate::{ - Appearance, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, + UserThemeStylesRefinement, }; pub fn notctis() -> UserThemeFamily { @@ -19,7 +20,7 @@ pub fn notctis() -> UserThemeFamily { colors: ThemeColorsRefinement { border: Some(rgba(0x1579b6ff).into()), border_variant: Some(rgba(0x1579b6ff).into()), - border_focused: Some(rgba(0x1579b6ff).into()), + border_focused: Some(rgba(0x08324eff).into()), border_selected: Some(rgba(0x1579b6ff).into()), border_transparent: Some(rgba(0x1579b6ff).into()), border_disabled: Some(rgba(0x1579b6ff).into()), @@ -27,6 +28,10 @@ pub fn notctis() -> UserThemeFamily { surface_background: Some(rgba(0x051b28ff).into()), background: Some(rgba(0x07263aff).into()), element_background: Some(rgba(0x007e99ff).into()), + element_hover: Some(rgba(0x00558a65).into()), + element_selected: Some(rgba(0x0b3f5fff).into()), + drop_target_background: Some(rgba(0x00294dff).into()), + ghost_element_hover: Some(rgba(0x00558a65).into()), text: Some(rgba(0xbecfdaff).into()), tab_inactive_background: Some(rgba(0x08324eff).into()), tab_active_background: Some(rgba(0x07263aff).into()), @@ -53,6 +58,13 @@ pub fn notctis() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0xaec3d0ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xe34d1bff).into()), + error: Some(rgba(0xe34d1bff).into()), + hidden: Some(rgba(0x9fb6c6ff).into()), + warning: Some(rgba(0xffa857ff).into()), + ..Default::default() + }, }, }, UserTheme { @@ -62,7 +74,7 @@ pub fn notctis() -> UserThemeFamily { colors: ThemeColorsRefinement { border: Some(rgba(0x997582ff).into()), border_variant: Some(rgba(0x997582ff).into()), - border_focused: Some(rgba(0x997582ff).into()), + border_focused: Some(rgba(0x413036ff).into()), border_selected: Some(rgba(0x997582ff).into()), border_transparent: Some(rgba(0x997582ff).into()), border_disabled: Some(rgba(0x997582ff).into()), @@ -70,6 +82,10 @@ pub fn notctis() -> UserThemeFamily { surface_background: Some(rgba(0x272022ff).into()), background: Some(rgba(0x322a2dff).into()), element_background: Some(rgba(0x007e99ff).into()), + element_hover: Some(rgba(0x533641ff).into()), + element_selected: Some(rgba(0x5c2e3e99).into()), + drop_target_background: Some(rgba(0x38292eff).into()), + ghost_element_hover: Some(rgba(0x533641ff).into()), text: Some(rgba(0xcbbec2ff).into()), tab_inactive_background: Some(rgba(0x413036ff).into()), tab_active_background: Some(rgba(0x322a2dff).into()), @@ -96,6 +112,13 @@ pub fn notctis() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0xb9acb0ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xe34d1bff).into()), + error: Some(rgba(0xe34d1bff).into()), + hidden: Some(rgba(0xbbaab0ff).into()), + warning: Some(rgba(0xffa857ff).into()), + ..Default::default() + }, }, }, UserTheme { @@ -105,7 +128,7 @@ pub fn notctis() -> UserThemeFamily { colors: ThemeColorsRefinement { border: Some(rgba(0x00c6e0ff).into()), border_variant: Some(rgba(0x00c6e0ff).into()), - border_focused: Some(rgba(0x00c6e0ff).into()), + border_focused: Some(rgba(0xe0eff1ff).into()), border_selected: Some(rgba(0x00c6e0ff).into()), border_transparent: Some(rgba(0x00c6e0ff).into()), border_disabled: Some(rgba(0x00c6e0ff).into()), @@ -113,6 +136,10 @@ pub fn notctis() -> UserThemeFamily { surface_background: Some(rgba(0xe1eeefff).into()), background: Some(rgba(0xf4f6f6ff).into()), element_background: Some(rgba(0x089099ff).into()), + element_hover: Some(rgba(0xd1eafaff).into()), + element_selected: Some(rgba(0xb6e1e7ff).into()), + drop_target_background: Some(rgba(0xb1c9ccff).into()), + ghost_element_hover: Some(rgba(0xd1eafaff).into()), text: Some(rgba(0x005661ff).into()), tab_inactive_background: Some(rgba(0xcaedf2ff).into()), tab_active_background: Some(rgba(0xf4f6f6ff).into()), @@ -139,6 +166,13 @@ pub fn notctis() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0x8ca6a6ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xff3f00ff).into()), + error: Some(rgba(0xff3f00ff).into()), + hidden: Some(rgba(0x70838dff).into()), + warning: Some(rgba(0xe07a52ff).into()), + ..Default::default() + }, }, }, UserTheme { @@ -148,7 +182,7 @@ pub fn notctis() -> UserThemeFamily { colors: ThemeColorsRefinement { border: Some(rgba(0xaea4f4ff).into()), border_variant: Some(rgba(0xaea4f4ff).into()), - border_focused: Some(rgba(0xaea4f4ff).into()), + border_focused: Some(rgba(0xdedbf5ff).into()), border_selected: Some(rgba(0xaea4f4ff).into()), border_transparent: Some(rgba(0xaea4f4ff).into()), border_disabled: Some(rgba(0xaea4f4ff).into()), @@ -156,6 +190,10 @@ pub fn notctis() -> UserThemeFamily { surface_background: Some(rgba(0xe9e7f3ff).into()), background: Some(rgba(0xf2f1f8ff).into()), element_background: Some(rgba(0x8d7ffeff).into()), + element_hover: Some(rgba(0xd1cbfeff).into()), + element_selected: Some(rgba(0xbcb6e7ff).into()), + drop_target_background: Some(rgba(0xafaad4aa).into()), + ghost_element_hover: Some(rgba(0xd1cbfeff).into()), text: Some(rgba(0x0c006bff).into()), tab_inactive_background: Some(rgba(0xe2dff6ff).into()), tab_active_background: Some(rgba(0xf2f1f8ff).into()), @@ -182,6 +220,13 @@ pub fn notctis() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0x8ca6a6ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xff3f00ff).into()), + error: Some(rgba(0xff3f00ff).into()), + hidden: Some(rgba(0x74708dff).into()), + warning: Some(rgba(0xe07a52ff).into()), + ..Default::default() + }, }, }, UserTheme { @@ -191,7 +236,7 @@ pub fn notctis() -> UserThemeFamily { colors: ThemeColorsRefinement { border: Some(rgba(0x00c6e0ff).into()), border_variant: Some(rgba(0x00c6e0ff).into()), - border_focused: Some(rgba(0x00c6e0ff).into()), + border_focused: Some(rgba(0xf2eddeff).into()), border_selected: Some(rgba(0x00c6e0ff).into()), border_transparent: Some(rgba(0x00c6e0ff).into()), border_disabled: Some(rgba(0x00c6e0ff).into()), @@ -199,6 +244,10 @@ pub fn notctis() -> UserThemeFamily { surface_background: Some(rgba(0xf6eddaff).into()), background: Some(rgba(0xfef8ecff).into()), element_background: Some(rgba(0x089099ff).into()), + element_hover: Some(rgba(0xd1f2f8ff).into()), + element_selected: Some(rgba(0xb6e1e7ff).into()), + drop_target_background: Some(rgba(0xcccab1ff).into()), + ghost_element_hover: Some(rgba(0xd1f2f8ff).into()), text: Some(rgba(0x005661ff).into()), tab_inactive_background: Some(rgba(0xf0e9d6ff).into()), tab_active_background: Some(rgba(0xfef8ecff).into()), @@ -225,6 +274,13 @@ pub fn notctis() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0x8ca6a6ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xff3f00ff).into()), + error: Some(rgba(0xff3f00ff).into()), + hidden: Some(rgba(0x878476ff).into()), + warning: Some(rgba(0xe07a52ff).into()), + ..Default::default() + }, }, }, UserTheme { @@ -234,7 +290,7 @@ pub fn notctis() -> UserThemeFamily { colors: ThemeColorsRefinement { border: Some(rgba(0x496c83ff).into()), border_variant: Some(rgba(0x496c83ff).into()), - border_focused: Some(rgba(0x496c83ff).into()), + border_focused: Some(rgba(0x202d37ff).into()), border_selected: Some(rgba(0x496c83ff).into()), border_transparent: Some(rgba(0x496c83ff).into()), border_disabled: Some(rgba(0x496c83ff).into()), @@ -242,6 +298,10 @@ pub fn notctis() -> UserThemeFamily { surface_background: Some(rgba(0x0e1920ff).into()), background: Some(rgba(0x1b2932ff).into()), element_background: Some(rgba(0x2e616bff).into()), + element_hover: Some(rgba(0x00558aff).into()), + element_selected: Some(rgba(0x2c414eff).into()), + drop_target_background: Some(rgba(0x152836ff).into()), + ghost_element_hover: Some(rgba(0x00558aff).into()), text: Some(rgba(0xc5cdd3ff).into()), tab_inactive_background: Some(rgba(0x202d37ff).into()), tab_active_background: Some(rgba(0x1b2932ff).into()), @@ -268,6 +328,13 @@ pub fn notctis() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0xc5cdd3ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xb96245ff).into()), + error: Some(rgba(0xb96245ff).into()), + hidden: Some(rgba(0x96a8b6ff).into()), + warning: Some(rgba(0xffa857ff).into()), + ..Default::default() + }, }, }, UserTheme { @@ -277,7 +344,7 @@ pub fn notctis() -> UserThemeFamily { colors: ThemeColorsRefinement { border: Some(rgba(0x0d6571ff).into()), border_variant: Some(rgba(0x0d6571ff).into()), - border_focused: Some(rgba(0x0d6571ff).into()), + border_focused: Some(rgba(0x063940ff).into()), border_selected: Some(rgba(0x0d6571ff).into()), border_transparent: Some(rgba(0x0d6571ff).into()), border_disabled: Some(rgba(0x0d6571ff).into()), @@ -285,6 +352,10 @@ pub fn notctis() -> UserThemeFamily { surface_background: Some(rgba(0x03181aff).into()), background: Some(rgba(0x052428ff).into()), element_background: Some(rgba(0x089099ff).into()), + element_hover: Some(rgba(0x0b505aff).into()), + element_selected: Some(rgba(0x0d6571ff).into()), + drop_target_background: Some(rgba(0x00404dff).into()), + ghost_element_hover: Some(rgba(0x0b505aff).into()), text: Some(rgba(0xb1c9ccff).into()), tab_inactive_background: Some(rgba(0x052e32ff).into()), tab_active_background: Some(rgba(0x052428ff).into()), @@ -311,6 +382,13 @@ pub fn notctis() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0xb1c9ccff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xe34d1bff).into()), + error: Some(rgba(0xe34d1bff).into()), + hidden: Some(rgba(0x87a7abff).into()), + warning: Some(rgba(0xffa487ff).into()), + ..Default::default() + }, }, }, UserTheme { @@ -320,7 +398,7 @@ pub fn notctis() -> UserThemeFamily { colors: ThemeColorsRefinement { border: Some(rgba(0x0d6571ff).into()), border_variant: Some(rgba(0x0d6571ff).into()), - border_focused: Some(rgba(0x0d6571ff).into()), + border_focused: Some(rgba(0x052e32ff).into()), border_selected: Some(rgba(0x0d6571ff).into()), border_transparent: Some(rgba(0x0d6571ff).into()), border_disabled: Some(rgba(0x0d6571ff).into()), @@ -328,6 +406,10 @@ pub fn notctis() -> UserThemeFamily { surface_background: Some(rgba(0x020c0eff).into()), background: Some(rgba(0x031316ff).into()), element_background: Some(rgba(0x089099ff).into()), + element_hover: Some(rgba(0x0b505aff).into()), + element_selected: Some(rgba(0x0d6571ff).into()), + drop_target_background: Some(rgba(0x00404dff).into()), + ghost_element_hover: Some(rgba(0x0b505aff).into()), text: Some(rgba(0xb1c9ccff).into()), tab_inactive_background: Some(rgba(0x052e32ff).into()), tab_active_background: Some(rgba(0x031316ff).into()), @@ -354,6 +436,13 @@ pub fn notctis() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0xb1c9ccff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xe34d1bff).into()), + error: Some(rgba(0xe34d1bff).into()), + hidden: Some(rgba(0x87a7abff).into()), + warning: Some(rgba(0xffa487ff).into()), + ..Default::default() + }, }, }, UserTheme { @@ -363,7 +452,7 @@ pub fn notctis() -> UserThemeFamily { colors: ThemeColorsRefinement { border: Some(rgba(0x0d6571ff).into()), border_variant: Some(rgba(0x0d6571ff).into()), - border_focused: Some(rgba(0x0d6571ff).into()), + border_focused: Some(rgba(0x052e32ff).into()), border_selected: Some(rgba(0x0d6571ff).into()), border_transparent: Some(rgba(0x0d6571ff).into()), border_disabled: Some(rgba(0x0d6571ff).into()), @@ -371,6 +460,10 @@ pub fn notctis() -> UserThemeFamily { surface_background: Some(rgba(0x020c0eff).into()), background: Some(rgba(0x031316ff).into()), element_background: Some(rgba(0x089099ff).into()), + element_hover: Some(rgba(0x0b505aff).into()), + element_selected: Some(rgba(0x0d6571ff).into()), + drop_target_background: Some(rgba(0x00404dff).into()), + ghost_element_hover: Some(rgba(0x0b505aff).into()), text: Some(rgba(0xb1c9ccff).into()), tab_inactive_background: Some(rgba(0x052e32ff).into()), tab_active_background: Some(rgba(0x031316ff).into()), @@ -397,6 +490,13 @@ pub fn notctis() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0xb1c9ccff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xe34d1bff).into()), + error: Some(rgba(0xe34d1bff).into()), + hidden: Some(rgba(0x87a7abff).into()), + warning: Some(rgba(0xffa487ff).into()), + ..Default::default() + }, }, }, UserTheme { @@ -406,7 +506,7 @@ pub fn notctis() -> UserThemeFamily { colors: ThemeColorsRefinement { border: Some(rgba(0x6d66a7ff).into()), border_variant: Some(rgba(0x6d66a7ff).into()), - border_focused: Some(rgba(0x6d66a7ff).into()), + border_focused: Some(rgba(0x2f2c49ff).into()), border_selected: Some(rgba(0x6d66a7ff).into()), border_transparent: Some(rgba(0x6d66a7ff).into()), border_disabled: Some(rgba(0x6d66a7ff).into()), @@ -414,6 +514,10 @@ pub fn notctis() -> UserThemeFamily { surface_background: Some(rgba(0x1f1d30ff).into()), background: Some(rgba(0x292640ff).into()), element_background: Some(rgba(0x007e99ff).into()), + element_hover: Some(rgba(0x383866ff).into()), + element_selected: Some(rgba(0x322e5cff).into()), + drop_target_background: Some(rgba(0x202040ff).into()), + ghost_element_hover: Some(rgba(0x383866ff).into()), text: Some(rgba(0xc5c2d6ff).into()), tab_inactive_background: Some(rgba(0x2f2c49ff).into()), tab_active_background: Some(rgba(0x292640ff).into()), @@ -440,6 +544,13 @@ pub fn notctis() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0xb6b3ccff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xe34d1bff).into()), + error: Some(rgba(0xe34d1bff).into()), + hidden: Some(rgba(0xa9a5c0ff).into()), + warning: Some(rgba(0xffa857ff).into()), + ..Default::default() + }, }, }, UserTheme { @@ -449,7 +560,7 @@ pub fn notctis() -> UserThemeFamily { colors: ThemeColorsRefinement { border: Some(rgba(0x8666a7ff).into()), border_variant: Some(rgba(0x8666a7ff).into()), - border_focused: Some(rgba(0x8666a7ff).into()), + border_focused: Some(rgba(0x3d2e4dff).into()), border_selected: Some(rgba(0x8666a7ff).into()), border_transparent: Some(rgba(0x8666a7ff).into()), border_disabled: Some(rgba(0x8666a7ff).into()), @@ -457,6 +568,10 @@ pub fn notctis() -> UserThemeFamily { surface_background: Some(rgba(0x291d35ff).into()), background: Some(rgba(0x30243dff).into()), element_background: Some(rgba(0x007e99ff).into()), + element_hover: Some(rgba(0x69438dff).into()), + element_selected: Some(rgba(0x472e60ff).into()), + drop_target_background: Some(rgba(0x302040ff).into()), + ghost_element_hover: Some(rgba(0x69438dff).into()), text: Some(rgba(0xccbfd9ff).into()), tab_inactive_background: Some(rgba(0x3d2e4dff).into()), tab_active_background: Some(rgba(0x30243dff).into()), @@ -483,6 +598,13 @@ pub fn notctis() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0xbfafcfff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xe34d1bff).into()), + error: Some(rgba(0xe34d1bff).into()), + hidden: Some(rgba(0xb3a5c0ff).into()), + warning: Some(rgba(0xffa857ff).into()), + ..Default::default() + }, }, }, ], diff --git a/crates/theme2/src/themes/palenight.rs b/crates/theme2/src/themes/palenight.rs index 6e5651fe03acfcc1df15e12be5f2fbeea1aec339..35d1aa7505b460297cc798ceb2172815dd58c7af 100644 --- a/crates/theme2/src/themes/palenight.rs +++ b/crates/theme2/src/themes/palenight.rs @@ -4,7 +4,8 @@ use gpui::rgba; use crate::{ - Appearance, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, + UserThemeStylesRefinement, }; pub fn palenight() -> UserThemeFamily { @@ -27,6 +28,10 @@ pub fn palenight() -> UserThemeFamily { surface_background: Some(rgba(0x292c3eff).into()), background: Some(rgba(0x292c3eff).into()), element_background: Some(rgba(0x7d56c1cc).into()), + element_hover: Some(rgba(0x0000001a).into()), + element_selected: Some(rgba(0x7d56c1ff).into()), + drop_target_background: Some(rgba(0x2e3245ff).into()), + ghost_element_hover: Some(rgba(0x0000001a).into()), text: Some(rgba(0xffffffff).into()), tab_inactive_background: Some(rgba(0x31364aff).into()), tab_active_background: Some(rgba(0x292c3eff).into()), @@ -52,6 +57,12 @@ pub fn palenight() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0xffffffff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xef524fff).into()), + error: Some(rgba(0xef524fff).into()), + hidden: Some(rgba(0x9199c8ff).into()), + ..Default::default() + }, }, }, UserTheme { @@ -69,6 +80,10 @@ pub fn palenight() -> UserThemeFamily { surface_background: Some(rgba(0x292c3eff).into()), background: Some(rgba(0x292c3eff).into()), element_background: Some(rgba(0x7d56c1cc).into()), + element_hover: Some(rgba(0x0000001a).into()), + element_selected: Some(rgba(0x7d56c1ff).into()), + drop_target_background: Some(rgba(0x2e3245ff).into()), + ghost_element_hover: Some(rgba(0x0000001a).into()), text: Some(rgba(0xffffffff).into()), tab_inactive_background: Some(rgba(0x31364aff).into()), tab_active_background: Some(rgba(0x292c3eff).into()), @@ -94,6 +109,12 @@ pub fn palenight() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0xffffffff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xef524fff).into()), + error: Some(rgba(0xef524fff).into()), + hidden: Some(rgba(0x9199c8ff).into()), + ..Default::default() + }, }, }, UserTheme { @@ -111,6 +132,10 @@ pub fn palenight() -> UserThemeFamily { surface_background: Some(rgba(0x25283aff).into()), background: Some(rgba(0x292c3eff).into()), element_background: Some(rgba(0x7d56c1cc).into()), + element_hover: Some(rgba(0x0000001a).into()), + element_selected: Some(rgba(0x7d56c1ff).into()), + drop_target_background: Some(rgba(0x2e3245ff).into()), + ghost_element_hover: Some(rgba(0x0000001a).into()), text: Some(rgba(0xffffffff).into()), tab_inactive_background: Some(rgba(0x31364aff).into()), tab_active_background: Some(rgba(0x25283aff).into()), @@ -136,6 +161,12 @@ pub fn palenight() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0xffffffff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xef524fff).into()), + error: Some(rgba(0xef524fff).into()), + hidden: Some(rgba(0x9199c8ff).into()), + ..Default::default() + }, }, }, ], diff --git a/crates/theme2/src/themes/rose_pine.rs b/crates/theme2/src/themes/rose_pine.rs index f12b9090d4ba7a219b95c915ae743619c4874a72..9cc8b0ab83e2648bd2b76210b8faf2088caa88c8 100644 --- a/crates/theme2/src/themes/rose_pine.rs +++ b/crates/theme2/src/themes/rose_pine.rs @@ -4,7 +4,8 @@ use gpui::rgba; use crate::{ - Appearance, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, + UserThemeStylesRefinement, }; pub fn rose_pine() -> UserThemeFamily { @@ -19,7 +20,7 @@ pub fn rose_pine() -> UserThemeFamily { colors: ThemeColorsRefinement { border: Some(rgba(0x000000ff).into()), border_variant: Some(rgba(0x000000ff).into()), - border_focused: Some(rgba(0x000000ff).into()), + border_focused: Some(rgba(0x6e6a8633).into()), border_selected: Some(rgba(0x000000ff).into()), border_transparent: Some(rgba(0x000000ff).into()), border_disabled: Some(rgba(0x000000ff).into()), @@ -27,6 +28,10 @@ pub fn rose_pine() -> UserThemeFamily { surface_background: Some(rgba(0x1f1d2eff).into()), background: Some(rgba(0x191724ff).into()), element_background: Some(rgba(0xebbcbaff).into()), + element_hover: Some(rgba(0x6e6a861a).into()), + element_selected: Some(rgba(0x6e6a8633).into()), + drop_target_background: Some(rgba(0x1f1d2eff).into()), + ghost_element_hover: Some(rgba(0x6e6a861a).into()), text: Some(rgba(0xe0def4ff).into()), tab_inactive_background: Some(rgba(0x000000ff).into()), tab_active_background: Some(rgba(0x6e6a861a).into()), @@ -52,6 +57,13 @@ pub fn rose_pine() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0xe0def4ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xeb6f92ff).into()), + error: Some(rgba(0xeb6f92ff).into()), + hidden: Some(rgba(0x908caaff).into()), + warning: Some(rgba(0xf5c177ff).into()), + ..Default::default() + }, }, }, UserTheme { @@ -61,7 +73,7 @@ pub fn rose_pine() -> UserThemeFamily { colors: ThemeColorsRefinement { border: Some(rgba(0x000000ff).into()), border_variant: Some(rgba(0x000000ff).into()), - border_focused: Some(rgba(0x000000ff).into()), + border_focused: Some(rgba(0x817c9c26).into()), border_selected: Some(rgba(0x000000ff).into()), border_transparent: Some(rgba(0x000000ff).into()), border_disabled: Some(rgba(0x000000ff).into()), @@ -69,6 +81,10 @@ pub fn rose_pine() -> UserThemeFamily { surface_background: Some(rgba(0x2a273eff).into()), background: Some(rgba(0x232136ff).into()), element_background: Some(rgba(0xea9a97ff).into()), + element_hover: Some(rgba(0x817c9c14).into()), + element_selected: Some(rgba(0x817c9c26).into()), + drop_target_background: Some(rgba(0x2a273eff).into()), + ghost_element_hover: Some(rgba(0x817c9c14).into()), text: Some(rgba(0xe0def4ff).into()), tab_inactive_background: Some(rgba(0x000000ff).into()), tab_active_background: Some(rgba(0x817c9c14).into()), @@ -94,6 +110,13 @@ pub fn rose_pine() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0xe0def4ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xeb6f92ff).into()), + error: Some(rgba(0xeb6f92ff).into()), + hidden: Some(rgba(0x908caaff).into()), + warning: Some(rgba(0xf5c177ff).into()), + ..Default::default() + }, }, }, UserTheme { @@ -103,7 +126,7 @@ pub fn rose_pine() -> UserThemeFamily { colors: ThemeColorsRefinement { border: Some(rgba(0x000000ff).into()), border_variant: Some(rgba(0x000000ff).into()), - border_focused: Some(rgba(0x000000ff).into()), + border_focused: Some(rgba(0x6e6a8614).into()), border_selected: Some(rgba(0x000000ff).into()), border_transparent: Some(rgba(0x000000ff).into()), border_disabled: Some(rgba(0x000000ff).into()), @@ -111,6 +134,10 @@ pub fn rose_pine() -> UserThemeFamily { surface_background: Some(rgba(0xfffaf3ff).into()), background: Some(rgba(0xfaf4edff).into()), element_background: Some(rgba(0xd7827dff).into()), + element_hover: Some(rgba(0x6e6a860d).into()), + element_selected: Some(rgba(0x6e6a8614).into()), + drop_target_background: Some(rgba(0xfffaf3ff).into()), + ghost_element_hover: Some(rgba(0x6e6a860d).into()), text: Some(rgba(0x575279ff).into()), tab_inactive_background: Some(rgba(0x000000ff).into()), tab_active_background: Some(rgba(0x6e6a860d).into()), @@ -136,6 +163,13 @@ pub fn rose_pine() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0x575279ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xb3627aff).into()), + error: Some(rgba(0xb3627aff).into()), + hidden: Some(rgba(0x797593ff).into()), + warning: Some(rgba(0xea9d34ff).into()), + ..Default::default() + }, }, }, ], diff --git a/crates/theme2/src/themes/solarized.rs b/crates/theme2/src/themes/solarized.rs index 41a8e21e5ac810c0515edb94e9f4244f654c93ee..01e3ab9eaf9cc23fdf5240bc6dc6121a6d3bd2a8 100644 --- a/crates/theme2/src/themes/solarized.rs +++ b/crates/theme2/src/themes/solarized.rs @@ -4,7 +4,8 @@ use gpui::rgba; use crate::{ - Appearance, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, + UserThemeStylesRefinement, }; pub fn solarized() -> UserThemeFamily { @@ -19,12 +20,16 @@ pub fn solarized() -> UserThemeFamily { colors: ThemeColorsRefinement { border: Some(rgba(0x003847ff).into()), border_variant: Some(rgba(0x003847ff).into()), - border_focused: Some(rgba(0x003847ff).into()), + border_focused: Some(rgba(0x29a19899).into()), border_selected: Some(rgba(0x003847ff).into()), border_transparent: Some(rgba(0x003847ff).into()), border_disabled: Some(rgba(0x003847ff).into()), background: Some(rgba(0x002a35ff).into()), element_background: Some(rgba(0x29a19899).into()), + element_hover: Some(rgba(0x004353aa).into()), + element_selected: Some(rgba(0x005a6fff).into()), + drop_target_background: Some(rgba(0x00435388).into()), + ghost_element_hover: Some(rgba(0x004353aa).into()), tab_inactive_background: Some(rgba(0x003f51ff).into()), tab_active_background: Some(rgba(0x002a36ff).into()), editor_background: Some(rgba(0x002a35ff).into()), @@ -48,6 +53,12 @@ pub fn solarized() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0x839496ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xffeaeaff).into()), + error: Some(rgba(0xffeaeaff).into()), + hidden: Some(rgba(0x93a1a1ff).into()), + ..Default::default() + }, }, }, UserTheme { @@ -57,12 +68,15 @@ pub fn solarized() -> UserThemeFamily { colors: ThemeColorsRefinement { border: Some(rgba(0xddd6c1ff).into()), border_variant: Some(rgba(0xddd6c1ff).into()), - border_focused: Some(rgba(0xddd6c1ff).into()), + border_focused: Some(rgba(0xd3af86ff).into()), border_selected: Some(rgba(0xddd6c1ff).into()), border_transparent: Some(rgba(0xddd6c1ff).into()), border_disabled: Some(rgba(0xddd6c1ff).into()), background: Some(rgba(0xfdf6e3ff).into()), element_background: Some(rgba(0xab9d56ff).into()), + element_hover: Some(rgba(0xdec98744).into()), + element_selected: Some(rgba(0xdec987ff).into()), + ghost_element_hover: Some(rgba(0xdec98744).into()), tab_inactive_background: Some(rgba(0xd3cbb7ff).into()), tab_active_background: Some(rgba(0xfdf6e3ff).into()), editor_background: Some(rgba(0xfdf6e3ff).into()), @@ -86,6 +100,10 @@ pub fn solarized() -> UserThemeFamily { terminal_ansi_white: Some(rgba(0xeee8d5ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + hidden: Some(rgba(0x586e75ff).into()), + ..Default::default() + }, }, }, ], diff --git a/crates/theme2/src/themes/synthwave_84.rs b/crates/theme2/src/themes/synthwave_84.rs index 9f157ade619f122230f6e489cebe7c53463b3500..f18b9f9409ba8f0b03dd8c4ca46855d391224f8c 100644 --- a/crates/theme2/src/themes/synthwave_84.rs +++ b/crates/theme2/src/themes/synthwave_84.rs @@ -4,7 +4,8 @@ use gpui::rgba; use crate::{ - Appearance, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, + UserThemeStylesRefinement, }; pub fn synthwave_84() -> UserThemeFamily { @@ -16,8 +17,13 @@ pub fn synthwave_84() -> UserThemeFamily { appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { + border_focused: Some(rgba(0x1f212bff).into()), background: Some(rgba(0x252334ff).into()), element_background: Some(rgba(0x614d85ff).into()), + element_hover: Some(rgba(0x37294d99).into()), + element_selected: Some(rgba(0xffffff20).into()), + drop_target_background: Some(rgba(0x34294f66).into()), + ghost_element_hover: Some(rgba(0x37294d99).into()), text: Some(rgba(0xffffffff).into()), tab_inactive_background: Some(rgba(0x252334ff).into()), editor_background: Some(rgba(0x252334ff).into()), @@ -37,6 +43,12 @@ pub fn synthwave_84() -> UserThemeFamily { terminal_ansi_cyan: Some(rgba(0x02edf9ff).into()), ..Default::default() }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xfe444fff).into()), + error: Some(rgba(0xfe444fff).into()), + warning: Some(rgba(0x71f1b7bb).into()), + ..Default::default() + }, }, }], } diff --git a/crates/theme2/src/user_theme.rs b/crates/theme2/src/user_theme.rs index 87ba9a76d1f51629d096e721a27a936ec612f678..0667359dfbda5cefa933664a174ee4e9019d7ebb 100644 --- a/crates/theme2/src/user_theme.rs +++ b/crates/theme2/src/user_theme.rs @@ -1,7 +1,7 @@ use refineable::Refineable; use serde::Deserialize; -use crate::{Appearance, ThemeColors, ThemeColorsRefinement}; +use crate::{Appearance, StatusColors, StatusColorsRefinement, ThemeColors, ThemeColorsRefinement}; #[derive(Deserialize)] pub struct UserThemeFamily { @@ -22,4 +22,6 @@ pub struct UserTheme { pub struct UserThemeStyles { #[refineable] pub colors: ThemeColors, + #[refineable] + pub status: StatusColors, } diff --git a/crates/theme_importer/src/main.rs b/crates/theme_importer/src/main.rs index b41994a0be0c10d0a1ed9d18e2ef03c4deecf9f1..6981ae41707a71ab62294d0b276145b88bc61d5f 100644 --- a/crates/theme_importer/src/main.rs +++ b/crates/theme_importer/src/main.rs @@ -159,7 +159,7 @@ fn main() -> Result<()> { use gpui::rgba; use crate::{{ - Appearance, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, ThemeColorsRefinement, StatusColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, }}; pub fn {theme_family_slug}() -> UserThemeFamily {{ diff --git a/crates/theme_importer/src/theme_printer.rs b/crates/theme_importer/src/theme_printer.rs index 49caf7bfd0be145329efb2e2bfca23fab77f15bd..ba85fb94412295c604b40843ae0976aee5534b11 100644 --- a/crates/theme_importer/src/theme_printer.rs +++ b/crates/theme_importer/src/theme_printer.rs @@ -2,8 +2,8 @@ use std::fmt::{self, Debug}; use gpui::{Hsla, Rgba}; use theme::{ - Appearance, PlayerColor, PlayerColors, StatusColors, SyntaxTheme, SystemColors, - ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, PlayerColor, PlayerColors, StatusColors, StatusColorsRefinement, SyntaxTheme, + SystemColors, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, }; struct RawSyntaxPrinter<'a>(&'a str); @@ -92,6 +92,7 @@ impl<'a> Debug for UserThemeStylesRefinementPrinter<'a> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("UserThemeStylesRefinement") .field("colors", &ThemeColorsRefinementPrinter(&self.0.colors)) + .field("status", &StatusColorsRefinementPrinter(&self.0.status)) .finish() } } @@ -250,23 +251,39 @@ impl<'a> Debug for ThemeColorsRefinementPrinter<'a> { } } -pub struct StatusColorsPrinter<'a>(&'a StatusColors); +pub struct StatusColorsRefinementPrinter<'a>(&'a StatusColorsRefinement); -impl<'a> Debug for StatusColorsPrinter<'a> { +impl<'a> Debug for StatusColorsRefinementPrinter<'a> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("StatusColors") - .field("conflict", &HslaPrinter(self.0.conflict)) - .field("created", &HslaPrinter(self.0.created)) - .field("deleted", &HslaPrinter(self.0.deleted)) - .field("error", &HslaPrinter(self.0.error)) - .field("hidden", &HslaPrinter(self.0.hidden)) - .field("ignored", &HslaPrinter(self.0.ignored)) - .field("info", &HslaPrinter(self.0.info)) - .field("modified", &HslaPrinter(self.0.modified)) - .field("renamed", &HslaPrinter(self.0.renamed)) - .field("success", &HslaPrinter(self.0.success)) - .field("warning", &HslaPrinter(self.0.warning)) - .finish() + let status_colors = vec![ + ("conflict", self.0.conflict), + ("created", self.0.created), + ("deleted", self.0.deleted), + ("error", self.0.error), + ("hidden", self.0.hidden), + ("ignored", self.0.ignored), + ("info", self.0.info), + ("modified", self.0.modified), + ("renamed", self.0.renamed), + ("success", self.0.success), + ("warning", self.0.warning), + ]; + + f.write_str("StatusColorsRefinement {")?; + + for (color_name, color) in status_colors { + if let Some(color) = color { + f.write_str(color_name)?; + f.write_str(": ")?; + f.write_str("Some(")?; + HslaPrinter(color).fmt(f)?; + f.write_str(")")?; + f.write_str(",")?; + } + } + + f.write_str("..Default::default()")?; + f.write_str("}") } } diff --git a/crates/theme_importer/src/vscode.rs b/crates/theme_importer/src/vscode.rs index 2456f77f3a7312b9ab191df76aafa184b1ac07b2..2eb80fc53f23a92b27126d2d19841ba325585102 100644 --- a/crates/theme_importer/src/vscode.rs +++ b/crates/theme_importer/src/vscode.rs @@ -1,7 +1,7 @@ use anyhow::Result; use gpui::{Hsla, Rgba}; use serde::Deserialize; -use theme::{ThemeColorsRefinement, UserTheme, UserThemeStylesRefinement}; +use theme::{StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeStylesRefinement}; use crate::util::Traverse; use crate::ThemeMetadata; @@ -435,6 +435,33 @@ impl VsCodeThemeConverter { let vscode_colors = &self.theme.colors; + let status_color_refinements = StatusColorsRefinement { + // conflict: None, + // created: None, + deleted: vscode_colors + .error_foreground + .as_ref() + .traverse(|color| try_parse_color(&color))?, + error: vscode_colors + .error_foreground + .as_ref() + .traverse(|color| try_parse_color(&color))?, + hidden: vscode_colors + .tab_inactive_foreground + .as_ref() + .traverse(|color| try_parse_color(&color))?, + // ignored: None, + // info: None, + // modified: None, + // renamed: None, + // success: None, + warning: vscode_colors + .list_warning_foreground + .as_ref() + .traverse(|color| try_parse_color(&color))?, + ..Default::default() + }; + let theme_colors_refinements = ThemeColorsRefinement { border: vscode_colors .panel_border @@ -596,6 +623,7 @@ impl VsCodeThemeConverter { appearance, styles: UserThemeStylesRefinement { colors: theme_colors_refinements, + status: status_color_refinements, }, }) } From 9cb14c189b476f87cf1698d1b0eb085696de9ef0 Mon Sep 17 00:00:00 2001 From: Julia Date: Thu, 9 Nov 2023 11:43:40 -0500 Subject: [PATCH 13/76] zed2: Get tsserver running again --- crates/zed2/src/languages/typescript.rs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/crates/zed2/src/languages/typescript.rs b/crates/zed2/src/languages/typescript.rs index de0139b3b226def7fb9169107c282a258307aac3..1b96e7e7022d56cf8947906fda67df2604c07471 100644 --- a/crates/zed2/src/languages/typescript.rs +++ b/crates/zed2/src/languages/typescript.rs @@ -2,6 +2,7 @@ use anyhow::{anyhow, Result}; use async_compression::futures::bufread::GzipDecoder; use async_tar::Archive; use async_trait::async_trait; +use collections::HashMap; use futures::{future::BoxFuture, FutureExt}; use gpui::AppContext; use language::{LanguageServerName, LspAdapter, LspAdapterDelegate}; @@ -20,12 +21,7 @@ use util::{fs::remove_matching, github::latest_github_release}; use util::{github::GitHubLspBinaryVersion, ResultExt}; fn typescript_server_binary_arguments(server_path: &Path) -> Vec { - vec![ - server_path.into(), - "--stdio".into(), - "--tsserver-path".into(), - "node_modules/typescript/lib".into(), - ] + vec![server_path.into(), "--stdio".into()] } fn eslint_server_binary_arguments(server_path: &Path) -> Vec { @@ -158,9 +154,20 @@ impl LspAdapter for TypeScriptLspAdapter { async fn initialization_options(&self) -> Option { Some(json!({ - "provideFormatter": true + "provideFormatter": true, + "tsserver": { + "path": "node_modules/typescript/lib", + }, })) } + + async fn language_ids(&self) -> HashMap { + HashMap::from_iter([ + ("TypeScript".into(), "typescript".into()), + ("JavaScript".into(), "javascript".into()), + ("TSX".into(), "typescriptreact".into()), + ]) + } } async fn get_cached_ts_server_binary( From d184e0d4269fd8932ccff0ae2a77f315d8986ab0 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Thu, 9 Nov 2023 17:54:05 +0100 Subject: [PATCH 14/76] Start working on command_palette2 --- Cargo.lock | 34 ++ Cargo.toml | 4 +- assets/keymaps/default.json | 3 +- crates/command_palette2/Cargo.toml | 34 ++ .../command_palette2/src/command_palette.rs | 542 ++++++++++++++++++ crates/gpui2/src/action.rs | 7 +- crates/workspace2/src/workspace2.rs | 301 +++++----- crates/zed2/Cargo.toml | 4 +- crates/zed2/src/main.rs | 4 +- crates/zed_actions2/Cargo.toml | 11 + crates/zed_actions2/src/lib.rs | 34 ++ 11 files changed, 822 insertions(+), 156 deletions(-) create mode 100644 crates/command_palette2/Cargo.toml create mode 100644 crates/command_palette2/src/command_palette.rs create mode 100644 crates/zed_actions2/Cargo.toml create mode 100644 crates/zed_actions2/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index ded64052c8e165e4b4ca3955e3382a38874d88bf..4143cf8fa7f309e0497d2e633ec9f3a50670b56a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1880,6 +1880,30 @@ dependencies = [ "zed-actions", ] +[[package]] +name = "command_palette2" +version = "0.1.0" +dependencies = [ + "anyhow", + "collections", + "ctor", + "editor2", + "env_logger 0.9.3", + "fuzzy2", + "gpui2", + "language2", + "picker2", + "project2", + "serde", + "serde_json", + "settings2", + "theme2", + "ui2", + "util", + "workspace2", + "zed_actions2", +] + [[package]] name = "component_test" version = "0.1.0" @@ -11362,6 +11386,7 @@ dependencies = [ "cli", "client2", "collections", + "command_palette2", "copilot2", "ctor", "db2", @@ -11448,6 +11473,15 @@ dependencies = [ "util", "uuid 1.4.1", "workspace2", + "zed_actions2", +] + +[[package]] +name = "zed_actions2" +version = "0.1.0" +dependencies = [ + "gpui2", + "serde", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 1b8081d06639c8ff611e2b5228cbfee1e6005b4b..905750f8352b02422fa0815b7a51e17d74b0daff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,6 +20,7 @@ members = [ "crates/collab_ui", "crates/collections", "crates/command_palette", + "crates/command_palette2", "crates/component_test", "crates/context_menu", "crates/copilot", @@ -110,7 +111,8 @@ members = [ "crates/xtask", "crates/zed", "crates/zed2", - "crates/zed-actions" + "crates/zed-actions", + "crates/zed_actions2" ] default-members = ["crates/zed"] resolver = "2" diff --git a/assets/keymaps/default.json b/assets/keymaps/default.json index ef6a655bdcead3cd64f29e9aa25b90d0d4e4d626..b18cb4a7ae245f7906a7d1c50b097e90209a8911 100644 --- a/assets/keymaps/default.json +++ b/assets/keymaps/default.json @@ -387,7 +387,8 @@ } }, { - "context": "Workspace", + // todo!() fix context + // "context": "Workspace", "bindings": { "cmd-1": ["workspace::ActivatePane", 0], "cmd-2": ["workspace::ActivatePane", 1], diff --git a/crates/command_palette2/Cargo.toml b/crates/command_palette2/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..bcc0099c2086f03fac0f13cd6541071fe91fb8f8 --- /dev/null +++ b/crates/command_palette2/Cargo.toml @@ -0,0 +1,34 @@ +[package] +name = "command_palette2" +version = "0.1.0" +edition = "2021" +publish = false + +[lib] +path = "src/command_palette.rs" +doctest = false + +[dependencies] +collections = { path = "../collections" } +editor = { package = "editor2", path = "../editor2" } +fuzzy = { package = "fuzzy2", path = "../fuzzy2" } +gpui = { package = "gpui2", path = "../gpui2" } +picker = { package = "picker2", path = "../picker2" } +project = { package = "project2", path = "../project2" } +settings = { package = "settings2", path = "../settings2" } +ui = { package = "ui2", path = "../ui2" } +util = { path = "../util" } +theme = { package = "theme2", path = "../theme2" } +workspace = { package="workspace2", path = "../workspace2" } +zed_actions = { package = "zed_actions2", path = "../zed_actions2" } +anyhow.workspace = true +serde.workspace = true +[dev-dependencies] +gpui = { package = "gpui2", path = "../gpui2", features = ["test-support"] } +editor = { package = "editor2", path = "../editor2", features = ["test-support"] } +language = { package="language2", path = "../language2", features = ["test-support"] } +project = { package="project2", path = "../project2", features = ["test-support"] } +serde_json.workspace = true +workspace = { package="workspace2", path = "../workspace2", features = ["test-support"] } +ctor.workspace = true +env_logger.workspace = true diff --git a/crates/command_palette2/src/command_palette.rs b/crates/command_palette2/src/command_palette.rs new file mode 100644 index 0000000000000000000000000000000000000000..dd0490082ea04d450b86d93893c1754c2cd0e72d --- /dev/null +++ b/crates/command_palette2/src/command_palette.rs @@ -0,0 +1,542 @@ +use anyhow::anyhow; +use collections::{CommandPaletteFilter, HashMap}; +use fuzzy::{StringMatch, StringMatchCandidate}; +use gpui::{ + actions, div, Action, AnyElement, AnyWindowHandle, AppContext, BorrowWindow, Div, Element, + EventEmitter, FocusHandle, Keystroke, ParentElement, Render, View, ViewContext, VisualContext, + WeakView, +}; +use picker::{Picker, PickerDelegate}; +use std::cmp::{self, Reverse}; +use ui::modal; +use util::{ + channel::{parse_zed_link, ReleaseChannel, RELEASE_CHANNEL}, + ResultExt, +}; +use workspace::{ModalEvent, Workspace}; +use zed_actions::OpenZedURL; + +actions!(Toggle); + +pub fn init(cx: &mut AppContext) { + dbg!("init"); + cx.set_global(HitCounts::default()); + + cx.observe_new_views( + |workspace: &mut Workspace, _: &mut ViewContext| { + dbg!("new workspace found"); + workspace + .modal_layer() + .register_modal(Toggle, |workspace, cx| { + dbg!("hitting cmd-shift-p"); + let Some(focus_handle) = cx.focused() else { + return None; + }; + + Some(cx.build_view(|cx| { + let delegate = + CommandPaletteDelegate::new(cx.view().downgrade(), focus_handle); + CommandPalette::new(delegate, cx) + })) + }); + }, + ) + .detach(); +} + +pub struct CommandPalette { + picker: View>, +} + +impl CommandPalette { + fn new(delegate: CommandPaletteDelegate, cx: &mut ViewContext) -> Self { + let picker = cx.build_view(|cx| Picker::new(delegate, cx)); + Self { picker } + } +} +impl EventEmitter for CommandPalette {} + +impl Render for CommandPalette { + type Element = Div; + + fn render(&mut self, cx: &mut ViewContext) -> Self::Element { + dbg!("Rendering"); + modal(cx).w_96().child(self.picker.clone()) + } +} + +pub type CommandPaletteInterceptor = + Box Option>; + +pub struct CommandInterceptResult { + pub action: Box, + pub string: String, + pub positions: Vec, +} + +pub struct CommandPaletteDelegate { + command_palette: WeakView, + actions: Vec, + matches: Vec, + selected_ix: usize, + focus_handle: FocusHandle, +} + +pub enum Event { + Dismissed, + Confirmed { + window: AnyWindowHandle, + focused_view_id: usize, + action: Box, + }, +} + +struct Command { + name: String, + action: Box, + keystrokes: Vec, +} + +impl Clone for Command { + fn clone(&self) -> Self { + Self { + name: self.name.clone(), + action: self.action.boxed_clone(), + keystrokes: self.keystrokes.clone(), + } + } +} +/// Hit count for each command in the palette. +/// We only account for commands triggered directly via command palette and not by e.g. keystrokes because +/// if an user already knows a keystroke for a command, they are unlikely to use a command palette to look for it. +#[derive(Default)] +struct HitCounts(HashMap); + +impl CommandPaletteDelegate { + pub fn new(command_palette: WeakView, focus_handle: FocusHandle) -> Self { + Self { + command_palette, + actions: Default::default(), + matches: vec![StringMatch { + candidate_id: 0, + score: 0., + positions: vec![], + string: "Foo my bar".into(), + }], + selected_ix: 0, + focus_handle, + } + } +} + +impl PickerDelegate for CommandPaletteDelegate { + type ListItem = Div>; + + fn match_count(&self) -> usize { + self.matches.len() + } + + fn selected_index(&self) -> usize { + self.selected_ix + } + + fn set_selected_index(&mut self, ix: usize, _: &mut ViewContext>) { + self.selected_ix = ix; + } + + fn update_matches( + &mut self, + query: String, + cx: &mut ViewContext>, + ) -> gpui::Task<()> { + let view_id = &self.focus_handle; + let window = cx.window(); + cx.spawn(move |picker, mut cx| async move { + let mut actions = picker + .update(&mut cx, |this, _| this.delegate.actions.clone()) + .expect("todo: handle picker no longer being around"); + // _ = window + // .available_actions(view_id, &cx) + // .into_iter() + // .flatten() + // .filter_map(|(name, action, bindings)| { + // let filtered = cx.read(|cx| { + // if cx.has_global::() { + // let filter = cx.global::(); + // filter.filtered_namespaces.contains(action.namespace()) + // } else { + // false + // } + // }); + + // if filtered { + // None + // } else { + // Some(Command { + // name: humanize_action_name(name), + // action, + // keystrokes: bindings + // .iter() + // .map(|binding| binding.keystrokes()) + // .last() + // .map_or(Vec::new(), |keystrokes| keystrokes.to_vec()), + // }) + // } + // }) + // .collect::>(); + + cx.read_global::(|hit_counts, _| { + actions.sort_by_key(|action| { + ( + Reverse(hit_counts.0.get(&action.name).cloned()), + action.name.clone(), + ) + }); + }) + .ok(); + + let candidates = actions + .iter() + .enumerate() + .map(|(ix, command)| StringMatchCandidate { + id: ix, + string: command.name.to_string(), + char_bag: command.name.chars().collect(), + }) + .collect::>(); + let mut matches = if query.is_empty() { + candidates + .into_iter() + .enumerate() + .map(|(index, candidate)| StringMatch { + candidate_id: index, + string: candidate.string, + positions: Vec::new(), + score: 0.0, + }) + .collect() + } else { + fuzzy::match_strings( + &candidates, + &query, + true, + 10000, + &Default::default(), + cx.background_executor().clone(), + ) + .await + }; + let mut intercept_result = None; + // todo!() for vim mode + // cx.read(|cx| { + // if cx.has_global::() { + // cx.global::()(&query, cx) + // } else { + // None + // } + // }); + if *RELEASE_CHANNEL == ReleaseChannel::Dev { + if parse_zed_link(&query).is_some() { + intercept_result = Some(CommandInterceptResult { + action: OpenZedURL { url: query.clone() }.boxed_clone(), + string: query.clone(), + positions: vec![], + }) + } + } + if let Some(CommandInterceptResult { + action, + string, + positions, + }) = intercept_result + { + if let Some(idx) = matches + .iter() + .position(|m| actions[m.candidate_id].action.type_id() == action.type_id()) + { + matches.remove(idx); + } + actions.push(Command { + name: string.clone(), + action, + keystrokes: vec![], + }); + matches.insert( + 0, + StringMatch { + candidate_id: actions.len() - 1, + string, + positions, + score: 0.0, + }, + ) + } + picker + .update(&mut cx, |picker, _| { + let delegate = &mut picker.delegate; + delegate.actions = actions; + delegate.matches = matches; + if delegate.matches.is_empty() { + delegate.selected_ix = 0; + } else { + delegate.selected_ix = + cmp::min(delegate.selected_ix, delegate.matches.len() - 1); + } + }) + .log_err(); + }) + } + + fn dismissed(&mut self, cx: &mut ViewContext>) { + dbg!("dismissed"); + self.command_palette + .update(cx, |command_palette, cx| cx.emit(ModalEvent::Dismissed)) + .log_err(); + } + + fn confirm(&mut self, _: bool, cx: &mut ViewContext>) { + // if !self.matches.is_empty() { + // let window = cx.window(); + // let focused_view_id = self.focused_view_id; + // let action_ix = self.matches[self.selected_ix].candidate_id; + // let command = self.actions.remove(action_ix); + // cx.update_default_global(|hit_counts: &mut HitCounts, _| { + // *hit_counts.0.entry(command.name).or_default() += 1; + // }); + // let action = command.action; + + // cx.app_context() + // .spawn(move |mut cx| async move { + // window + // .dispatch_action(focused_view_id, action.as_ref(), &mut cx) + // .ok_or_else(|| anyhow!("window was closed")) + // }) + // .detach_and_log_err(cx); + // } + self.dismissed(cx) + } + + fn render_match( + &self, + ix: usize, + selected: bool, + cx: &mut ViewContext>, + ) -> Self::ListItem { + div().child("ooh yeah") + } + + // fn render_match( + // &self, + // ix: usize, + // mouse_state: &mut MouseState, + // selected: bool, + // cx: &gpui::AppContext, + // ) -> AnyElement> { + // let mat = &self.matches[ix]; + // let command = &self.actions[mat.candidate_id]; + // let theme = theme::current(cx); + // let style = theme.picker.item.in_state(selected).style_for(mouse_state); + // let key_style = &theme.command_palette.key.in_state(selected); + // let keystroke_spacing = theme.command_palette.keystroke_spacing; + + // Flex::row() + // .with_child( + // Label::new(mat.string.clone(), style.label.clone()) + // .with_highlights(mat.positions.clone()), + // ) + // .with_children(command.keystrokes.iter().map(|keystroke| { + // Flex::row() + // .with_children( + // [ + // (keystroke.ctrl, "^"), + // (keystroke.alt, "⌥"), + // (keystroke.cmd, "⌘"), + // (keystroke.shift, "⇧"), + // ] + // .into_iter() + // .filter_map(|(modifier, label)| { + // if modifier { + // Some( + // Label::new(label, key_style.label.clone()) + // .contained() + // .with_style(key_style.container), + // ) + // } else { + // None + // } + // }), + // ) + // .with_child( + // Label::new(keystroke.key.clone(), key_style.label.clone()) + // .contained() + // .with_style(key_style.container), + // ) + // .contained() + // .with_margin_left(keystroke_spacing) + // .flex_float() + // })) + // .contained() + // .with_style(style.container) + // .into_any() + // } +} + +fn humanize_action_name(name: &str) -> String { + let capacity = name.len() + name.chars().filter(|c| c.is_uppercase()).count(); + let mut result = String::with_capacity(capacity); + for char in name.chars() { + if char == ':' { + if result.ends_with(':') { + result.push(' '); + } else { + result.push(':'); + } + } else if char == '_' { + result.push(' '); + } else if char.is_uppercase() { + if !result.ends_with(' ') { + result.push(' '); + } + result.extend(char.to_lowercase()); + } else { + result.push(char); + } + } + result +} + +impl std::fmt::Debug for Command { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("Command") + .field("name", &self.name) + .field("keystrokes", &self.keystrokes) + .finish() + } +} + +#[cfg(test)] +mod tests { + use std::sync::Arc; + + use super::*; + use editor::Editor; + use gpui::{executor::Deterministic, TestAppContext}; + use project::Project; + use workspace::{AppState, Workspace}; + + #[test] + fn test_humanize_action_name() { + assert_eq!( + humanize_action_name("editor::GoToDefinition"), + "editor: go to definition" + ); + assert_eq!( + humanize_action_name("editor::Backspace"), + "editor: backspace" + ); + assert_eq!( + humanize_action_name("go_to_line::Deploy"), + "go to line: deploy" + ); + } + + #[gpui::test] + async fn test_command_palette(deterministic: Arc, cx: &mut TestAppContext) { + let app_state = init_test(cx); + + let project = Project::test(app_state.fs.clone(), [], cx).await; + let window = cx.add_window(|cx| Workspace::test_new(project.clone(), cx)); + let workspace = window.root(cx); + let editor = window.add_view(cx, |cx| { + let mut editor = Editor::single_line(None, cx); + editor.set_text("abc", cx); + editor + }); + + workspace.update(cx, |workspace, cx| { + cx.focus(&editor); + workspace.add_item(Box::new(editor.clone()), cx) + }); + + workspace.update(cx, |workspace, cx| { + toggle_command_palette(workspace, &Toggle, cx); + }); + + let palette = workspace.read_with(cx, |workspace, _| { + workspace.modal::().unwrap() + }); + + palette + .update(cx, |palette, cx| { + // Fill up palette's command list by running an empty query; + // we only need it to subsequently assert that the palette is initially + // sorted by command's name. + palette.delegate_mut().update_matches("".to_string(), cx) + }) + .await; + + palette.update(cx, |palette, _| { + let is_sorted = + |actions: &[Command]| actions.windows(2).all(|pair| pair[0].name <= pair[1].name); + assert!(is_sorted(&palette.delegate().actions)); + }); + + palette + .update(cx, |palette, cx| { + palette + .delegate_mut() + .update_matches("bcksp".to_string(), cx) + }) + .await; + + palette.update(cx, |palette, cx| { + assert_eq!(palette.delegate().matches[0].string, "editor: backspace"); + palette.confirm(&Default::default(), cx); + }); + deterministic.run_until_parked(); + editor.read_with(cx, |editor, cx| { + assert_eq!(editor.text(cx), "ab"); + }); + + // Add namespace filter, and redeploy the palette + cx.update(|cx| { + cx.update_default_global::(|filter, _| { + filter.filtered_namespaces.insert("editor"); + }) + }); + + workspace.update(cx, |workspace, cx| { + toggle_command_palette(workspace, &Toggle, cx); + }); + + // Assert editor command not present + let palette = workspace.read_with(cx, |workspace, _| { + workspace.modal::().unwrap() + }); + + palette + .update(cx, |palette, cx| { + palette + .delegate_mut() + .update_matches("bcksp".to_string(), cx) + }) + .await; + + palette.update(cx, |palette, _| { + assert!(palette.delegate().matches.is_empty()) + }); + } + + fn init_test(cx: &mut TestAppContext) -> Arc { + cx.update(|cx| { + let app_state = AppState::test(cx); + theme::init(cx); + language::init(cx); + editor::init(cx); + workspace::init(app_state.clone(), cx); + init(cx); + Project::init_settings(cx); + app_state + }) + } +} diff --git a/crates/gpui2/src/action.rs b/crates/gpui2/src/action.rs index 85149f5d55cc971844621e3acb3ba52d1d7c1a74..5cd5eb4cdbc11e9a63acf65ecfc4fc3db05bd70e 100644 --- a/crates/gpui2/src/action.rs +++ b/crates/gpui2/src/action.rs @@ -4,7 +4,7 @@ use collections::{HashMap, HashSet}; use lazy_static::lazy_static; use parking_lot::{MappedRwLockReadGuard, RwLock, RwLockReadGuard}; use serde::Deserialize; -use std::any::{type_name, Any}; +use std::any::{type_name, Any, TypeId}; /// Actions are used to implement keyboard-driven UI. /// When you declare an action, you can bind keys to the action in the keymap and @@ -100,6 +100,11 @@ where } } +impl dyn Action { + pub fn type_id(&self) -> TypeId { + self.as_any().type_id() + } +} type ActionBuilder = fn(json: Option) -> anyhow::Result>; lazy_static! { diff --git a/crates/workspace2/src/workspace2.rs b/crates/workspace2/src/workspace2.rs index 24ec810ac5be090cb4522d8f2d699c89b3928d1b..c91c388f2afb1b43a6e9f9cc10214d6795a9c70e 100644 --- a/crates/workspace2/src/workspace2.rs +++ b/crates/workspace2/src/workspace2.rs @@ -37,10 +37,10 @@ use futures::{ }; use gpui::{ actions, div, point, rems, size, AnyModel, AnyView, AnyWeakView, AppContext, AsyncAppContext, - AsyncWindowContext, Bounds, Component, Div, Entity, EntityId, EventEmitter, FocusHandle, - GlobalPixels, Model, ModelContext, ParentElement, Point, Render, Size, StatefulInteractive, - Styled, Subscription, Task, View, ViewContext, VisualContext, WeakView, WindowBounds, - WindowContext, WindowHandle, WindowOptions, + AsyncWindowContext, Bounds, Component, DispatchContext, Div, Entity, EntityId, EventEmitter, + FocusHandle, GlobalPixels, Model, ModelContext, ParentElement, Point, Render, Size, + StatefulInteractive, Styled, Subscription, Task, View, ViewContext, VisualContext, WeakView, + WindowBounds, WindowContext, WindowHandle, WindowOptions, }; use item::{FollowableItem, FollowableItemHandle, Item, ItemHandle, ItemSettings, ProjectItem}; use itertools::Itertools; @@ -3709,157 +3709,160 @@ impl Render for Workspace { type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { - div() - .relative() - .size_full() - .flex() - .flex_col() - .font("Zed Sans") - .gap_0() - .justify_start() - .items_start() - .text_color(cx.theme().colors().text) - .bg(cx.theme().colors().background) - .child(self.render_titlebar(cx)) - .child( - // todo! should this be a component a view? - self.modal_layer - .wrapper_element(cx) - .relative() - .flex_1() - .w_full() - .flex() - .overflow_hidden() - .border_t() - .border_b() - .border_color(cx.theme().colors().border) - // .children( - // Some( - // Panel::new("project-panel-outer", cx) - // .side(PanelSide::Left) - // .child(ProjectPanel::new("project-panel-inner")), - // ) - // .filter(|_| self.is_project_panel_open()), - // ) - // .children( - // Some( - // Panel::new("collab-panel-outer", cx) - // .child(CollabPanel::new("collab-panel-inner")) - // .side(PanelSide::Left), - // ) - // .filter(|_| self.is_collab_panel_open()), - // ) - // .child(NotificationToast::new( - // "maxbrunsfeld has requested to add you as a contact.".into(), - // )) - .child( - div().flex().flex_col().flex_1().h_full().child( - div().flex().flex_1().child(self.center.render( - &self.project, - &self.follower_states, - self.active_call(), - &self.active_pane, - self.zoomed.as_ref(), - &self.app_state, - cx, - )), + let mut context = DispatchContext::default(); + context.insert("Workspace"); + cx.with_key_dispatch_context(context, |cx| { + div() + .relative() + .size_full() + .flex() + .flex_col() + .font("Zed Sans") + .gap_0() + .justify_start() + .items_start() + .text_color(cx.theme().colors().text) + .bg(cx.theme().colors().background) + .child(self.render_titlebar(cx)) + .child( + // todo! should this be a component a view? + self.modal_layer + .wrapper_element(cx) + .relative() + .flex_1() + .w_full() + .flex() + .overflow_hidden() + .border_t() + .border_b() + .border_color(cx.theme().colors().border) + // .children( + // Some( + // Panel::new("project-panel-outer", cx) + // .side(PanelSide::Left) + // .child(ProjectPanel::new("project-panel-inner")), + // ) + // .filter(|_| self.is_project_panel_open()), + // ) + // .children( + // Some( + // Panel::new("collab-panel-outer", cx) + // .child(CollabPanel::new("collab-panel-inner")) + // .side(PanelSide::Left), + // ) + // .filter(|_| self.is_collab_panel_open()), + // ) + // .child(NotificationToast::new( + // "maxbrunsfeld has requested to add you as a contact.".into(), + // )) + .child( + div().flex().flex_col().flex_1().h_full().child( + div().flex().flex_1().child(self.center.render( + &self.project, + &self.follower_states, + self.active_call(), + &self.active_pane, + self.zoomed.as_ref(), + &self.app_state, + cx, + )), + ), // .children( + // Some( + // Panel::new("terminal-panel", cx) + // .child(Terminal::new()) + // .allowed_sides(PanelAllowedSides::BottomOnly) + // .side(PanelSide::Bottom), + // ) + // .filter(|_| self.is_terminal_open()), + // ), ), // .children( // Some( - // Panel::new("terminal-panel", cx) - // .child(Terminal::new()) - // .allowed_sides(PanelAllowedSides::BottomOnly) - // .side(PanelSide::Bottom), + // Panel::new("chat-panel-outer", cx) + // .side(PanelSide::Right) + // .child(ChatPanel::new("chat-panel-inner").messages(vec![ + // ChatMessage::new( + // "osiewicz".to_string(), + // "is this thing on?".to_string(), + // DateTime::parse_from_rfc3339("2023-09-27T15:40:52.707Z") + // .unwrap() + // .naive_local(), + // ), + // ChatMessage::new( + // "maxdeviant".to_string(), + // "Reading you loud and clear!".to_string(), + // DateTime::parse_from_rfc3339("2023-09-28T15:40:52.707Z") + // .unwrap() + // .naive_local(), + // ), + // ])), // ) - // .filter(|_| self.is_terminal_open()), + // .filter(|_| self.is_chat_panel_open()), + // ) + // .children( + // Some( + // Panel::new("notifications-panel-outer", cx) + // .side(PanelSide::Right) + // .child(NotificationsPanel::new("notifications-panel-inner")), + // ) + // .filter(|_| self.is_notifications_panel_open()), + // ) + // .children( + // Some( + // Panel::new("assistant-panel-outer", cx) + // .child(AssistantPanel::new("assistant-panel-inner")), + // ) + // .filter(|_| self.is_assistant_panel_open()), // ), - ), // .children( - // Some( - // Panel::new("chat-panel-outer", cx) - // .side(PanelSide::Right) - // .child(ChatPanel::new("chat-panel-inner").messages(vec![ - // ChatMessage::new( - // "osiewicz".to_string(), - // "is this thing on?".to_string(), - // DateTime::parse_from_rfc3339("2023-09-27T15:40:52.707Z") - // .unwrap() - // .naive_local(), - // ), - // ChatMessage::new( - // "maxdeviant".to_string(), - // "Reading you loud and clear!".to_string(), - // DateTime::parse_from_rfc3339("2023-09-28T15:40:52.707Z") - // .unwrap() - // .naive_local(), - // ), - // ])), - // ) - // .filter(|_| self.is_chat_panel_open()), - // ) - // .children( - // Some( - // Panel::new("notifications-panel-outer", cx) - // .side(PanelSide::Right) - // .child(NotificationsPanel::new("notifications-panel-inner")), - // ) - // .filter(|_| self.is_notifications_panel_open()), - // ) - // .children( - // Some( - // Panel::new("assistant-panel-outer", cx) - // .child(AssistantPanel::new("assistant-panel-inner")), - // ) - // .filter(|_| self.is_assistant_panel_open()), - // ), - ) - .child(self.status_bar.clone()) - // .when(self.debug.show_toast, |this| { - // this.child(Toast::new(ToastOrigin::Bottom).child(Label::new("A toast"))) - // }) - // .children( - // Some( - // div() - // .absolute() - // .top(px(50.)) - // .left(px(640.)) - // .z_index(8) - // .child(LanguageSelector::new("language-selector")), - // ) - // .filter(|_| self.is_language_selector_open()), - // ) - .z_index(8) - // Debug - .child( - div() - .flex() - .flex_col() - .z_index(9) - .absolute() - .top_20() - .left_1_4() - .w_40() - .gap_2(), // .when(self.show_debug, |this| { - // this.child(Button::::new("Toggle User Settings").on_click( - // Arc::new(|workspace, cx| workspace.debug_toggle_user_settings(cx)), - // )) - // .child( - // Button::::new("Toggle Toasts").on_click(Arc::new( - // |workspace, cx| workspace.debug_toggle_toast(cx), - // )), - // ) - // .child( - // Button::::new("Toggle Livestream").on_click(Arc::new( - // |workspace, cx| workspace.debug_toggle_livestream(cx), - // )), - // ) - // }) - // .child( - // Button::::new("Toggle Debug") - // .on_click(Arc::new(|workspace, cx| workspace.toggle_debug(cx))), - // ), - ) + ) + .child(self.status_bar.clone()) + // .when(self.debug.show_toast, |this| { + // this.child(Toast::new(ToastOrigin::Bottom).child(Label::new("A toast"))) + // }) + // .children( + // Some( + // div() + // .absolute() + // .top(px(50.)) + // .left(px(640.)) + // .z_index(8) + // .child(LanguageSelector::new("language-selector")), + // ) + // .filter(|_| self.is_language_selector_open()), + // ) + .z_index(8) + // Debug + .child( + div() + .flex() + .flex_col() + .z_index(9) + .absolute() + .top_20() + .left_1_4() + .w_40() + .gap_2(), // .when(self.show_debug, |this| { + // this.child(Button::::new("Toggle User Settings").on_click( + // Arc::new(|workspace, cx| workspace.debug_toggle_user_settings(cx)), + // )) + // .child( + // Button::::new("Toggle Toasts").on_click(Arc::new( + // |workspace, cx| workspace.debug_toggle_toast(cx), + // )), + // ) + // .child( + // Button::::new("Toggle Livestream").on_click(Arc::new( + // |workspace, cx| workspace.debug_toggle_livestream(cx), + // )), + // ) + // }) + // .child( + // Button::::new("Toggle Debug") + // .on_click(Arc::new(|workspace, cx| workspace.toggle_debug(cx))), + // ), + ) + }) } } - // todo!() // impl Entity for Workspace { // type Event = Event; diff --git a/crates/zed2/Cargo.toml b/crates/zed2/Cargo.toml index 661ab0c2934b4b3d34ed1547d3861e64ece37737..570912abc579a7aad2461c4fe081354c97fcc478 100644 --- a/crates/zed2/Cargo.toml +++ b/crates/zed2/Cargo.toml @@ -25,7 +25,7 @@ call = { package = "call2", path = "../call2" } cli = { path = "../cli" } # collab_ui = { path = "../collab_ui" } collections = { path = "../collections" } -# command_palette = { path = "../command_palette" } +command_palette = { package="command_palette2", path = "../command_palette2" } # component_test = { path = "../component_test" } # context_menu = { path = "../context_menu" } client = { package = "client2", path = "../client2" } @@ -74,7 +74,7 @@ util = { path = "../util" } # vim = { path = "../vim" } workspace = { package = "workspace2", path = "../workspace2" } # welcome = { path = "../welcome" } -# zed-actions = {path = "../zed-actions"} +zed_actions = {package = "zed_actions2", path = "../zed_actions2"} anyhow.workspace = true async-compression = { version = "0.3", features = ["gzip", "futures-bufread"] } async-tar = "0.4.2" diff --git a/crates/zed2/src/main.rs b/crates/zed2/src/main.rs index cd0f8e5fbf7333d7849de040e7dee211f6738549..c9e7ee8c580eb4f4b694855376d3b632c4fb22a8 100644 --- a/crates/zed2/src/main.rs +++ b/crates/zed2/src/main.rs @@ -142,7 +142,7 @@ fn main() { // context_menu::init(cx); project::Project::init(&client, cx); client::init(&client, cx); - // command_palette::init(cx); + command_palette::init(cx); language::init(cx); editor::init(cx); copilot::init( @@ -761,7 +761,7 @@ fn load_embedded_fonts(cx: &AppContext) { // #[cfg(not(debug_assertions))] // async fn watch_languages(_: Arc, _: Arc) -> Option<()> { // None -// } +// // #[cfg(not(debug_assertions))] // fn watch_file_types(_fs: Arc, _cx: &mut AppContext) {} diff --git a/crates/zed_actions2/Cargo.toml b/crates/zed_actions2/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..b3b5b4ce578dbe69ffe0e7998c1089d5e4e6ac3a --- /dev/null +++ b/crates/zed_actions2/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "zed_actions2" +version = "0.1.0" +edition = "2021" +publish = false + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +gpui = { package = "gpui2", path = "../gpui2" } +serde.workspace = true diff --git a/crates/zed_actions2/src/lib.rs b/crates/zed_actions2/src/lib.rs new file mode 100644 index 0000000000000000000000000000000000000000..090352b2ccada82e4e5675384ac5b8a9bad8c90b --- /dev/null +++ b/crates/zed_actions2/src/lib.rs @@ -0,0 +1,34 @@ +use gpui::{action, actions}; + +actions!( + About, + DebugElements, + DecreaseBufferFontSize, + Hide, + HideOthers, + IncreaseBufferFontSize, + Minimize, + OpenDefaultKeymap, + OpenDefaultSettings, + OpenKeymap, + OpenLicenses, + OpenLocalSettings, + OpenLog, + OpenSettings, + OpenTelemetryLog, + Quit, + ResetBufferFontSize, + ResetDatabase, + ShowAll, + ToggleFullScreen, + Zoom, +); + +#[action] +pub struct OpenBrowser { + pub url: String, +} +#[action] +pub struct OpenZedURL { + pub url: String, +} From efd1db1b09ef8bd938bbeccde4f1dcd34b2e159b Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Thu, 9 Nov 2023 12:30:53 -0500 Subject: [PATCH 15/76] =?UTF-8?q?WIP=20=E2=80=93=20Add=20Syntax=20themes?= =?UTF-8?q?=20to=20importer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com> --- crates/theme2/src/registry.rs | 2 +- crates/theme2/src/theme2.rs | 4 +- crates/theme2/src/themes/andromeda.rs | 22 + crates/theme2/src/themes/ayu.rs | 51 ++ crates/theme2/src/themes/dracula.rs | 80 +-- crates/theme2/src/themes/gruvbox.rs | 334 +---------- crates/theme2/src/themes/mod.rs | 56 +- crates/theme2/src/themes/night_owl.rs | 133 +---- crates/theme2/src/themes/nord.rs | 80 +-- crates/theme2/src/themes/notctis.rs | 622 +-------------------- crates/theme2/src/themes/palenight.rs | 184 +----- crates/theme2/src/themes/rose_pine.rs | 187 +------ crates/theme2/src/themes/solarized.rs | 121 +--- crates/theme2/src/themes/synthwave_84.rs | 65 +-- crates/theme2/src/user_theme.rs | 18 + crates/theme_importer/src/main.rs | 1 + crates/theme_importer/src/theme_printer.rs | 31 +- crates/theme_importer/src/vscode.rs | 21 +- crates/theme_importer/src/vscode_syntax.rs | 261 +++++++++ 19 files changed, 551 insertions(+), 1722 deletions(-) create mode 100644 crates/theme_importer/src/vscode_syntax.rs diff --git a/crates/theme2/src/registry.rs b/crates/theme2/src/registry.rs index decec8b5dada0ef19250f15de5de100ce57d47c2..d95283fc122da532b2139129e536fe66b3196b28 100644 --- a/crates/theme2/src/registry.rs +++ b/crates/theme2/src/registry.rs @@ -83,7 +83,7 @@ impl Default for ThemeRegistry { }; this.insert_theme_families([zed_pro_family()]); - this.insert_user_theme_familes(crate::all_user_themes()); + // this.insert_user_theme_familes(crate::all_user_themes()); this } diff --git a/crates/theme2/src/theme2.rs b/crates/theme2/src/theme2.rs index 74b5a4269ec3432e165d76105197e788595b365e..16e0db09faec0281e44859a74e392e01fb8ecd24 100644 --- a/crates/theme2/src/theme2.rs +++ b/crates/theme2/src/theme2.rs @@ -6,7 +6,7 @@ mod registry; mod scale; mod settings; mod syntax; -mod themes; +// mod themes; mod user_theme; use std::sync::Arc; @@ -20,7 +20,7 @@ pub use registry::*; pub use scale::*; pub use settings::*; pub use syntax::*; -pub use themes::*; +// pub use themes::*; pub use user_theme::*; use gpui::{AppContext, Hsla, SharedString}; diff --git a/crates/theme2/src/themes/andromeda.rs b/crates/theme2/src/themes/andromeda.rs index 6afff66df1012d2c34489cea22530f99de993513..6e2b2989f7ebc0fcde31700afd8273c276ffd6ae 100644 --- a/crates/theme2/src/themes/andromeda.rs +++ b/crates/theme2/src/themes/andromeda.rs @@ -59,6 +59,17 @@ pub fn andromeda() -> UserThemeFamily { hidden: Some(rgba(0x746f77ff).into()), ..Default::default() }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("comment".into(), rgba(0x9fa0a6cc).into()), + ("something".into(), rgba(0x00e8c6ff).into()), + ("punctuation".into(), rgba(0xf92571ff).into()), + ("something".into(), rgba(0xc64dedff).into()), + ("something".into(), rgba(0xee5d42ff).into()), + ("something".into(), rgba(0x95e072ff).into()), + ("punctuation".into(), rgba(0x95e072ff).into()), + ], + }), }, }, UserTheme { @@ -107,6 +118,17 @@ pub fn andromeda() -> UserThemeFamily { hidden: Some(rgba(0x746f77ff).into()), ..Default::default() }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("comment".into(), rgba(0x9fa0a6cc).into()), + ("something".into(), rgba(0x00e8c6ff).into()), + ("punctuation".into(), rgba(0xf92571ff).into()), + ("something".into(), rgba(0xc64dedff).into()), + ("something".into(), rgba(0xee5d42ff).into()), + ("something".into(), rgba(0x95e072ff).into()), + ("punctuation".into(), rgba(0x95e072ff).into()), + ], + }), }, }, ], diff --git a/crates/theme2/src/themes/ayu.rs b/crates/theme2/src/themes/ayu.rs index 8454c0af463527bd62e23decf08e6f9e3dbe0dea..3aa1e0a7c32b95bd9a498ff60e6fec1d342516d2 100644 --- a/crates/theme2/src/themes/ayu.rs +++ b/crates/theme2/src/themes/ayu.rs @@ -63,6 +63,23 @@ pub fn ayu() -> UserThemeFamily { hidden: Some(rgba(0x8a9199ff).into()), ..Default::default() }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("comment".into(), rgba(0x787b8099).into()), + ("something".into(), rgba(0x86b300ff).into()), + ("something".into(), rgba(0x5c6166ff).into()), + ("something".into(), rgba(0xfa8d3eff).into()), + ("punctuation".into(), rgba(0x5c6166b3).into()), + ("punctuation".into(), rgba(0x5c6166ff).into()), + ("punctuation".into(), rgba(0xed9365ff).into()), + ("punctuation".into(), rgba(0xfa8d3eff).into()), + ("punctuation".into(), rgba(0xfa8d3eff).into()), + ("punctuation".into(), rgba(0x55b4d380).into()), + ("punctuation".into(), rgba(0x55b4d380).into()), + ("punctuation".into(), rgba(0x55b4d380).into()), + ("punctuation".into(), rgba(0x787b8099).into()), + ], + }), }, }, UserTheme { @@ -115,6 +132,23 @@ pub fn ayu() -> UserThemeFamily { hidden: Some(rgba(0x707a8cff).into()), ..Default::default() }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("comment".into(), rgba(0xb8cfe680).into()), + ("something".into(), rgba(0xd4fe7fff).into()), + ("something".into(), rgba(0xcccac2ff).into()), + ("something".into(), rgba(0xffad65ff).into()), + ("punctuation".into(), rgba(0xcccac2b3).into()), + ("punctuation".into(), rgba(0xcccac2ff).into()), + ("punctuation".into(), rgba(0xf29e74ff).into()), + ("punctuation".into(), rgba(0xffad65ff).into()), + ("punctuation".into(), rgba(0xffad65ff).into()), + ("punctuation".into(), rgba(0x5ccfe680).into()), + ("punctuation".into(), rgba(0x5ccfe680).into()), + ("punctuation".into(), rgba(0x5ccfe680).into()), + ("punctuation".into(), rgba(0xb8cfe680).into()), + ], + }), }, }, UserTheme { @@ -167,6 +201,23 @@ pub fn ayu() -> UserThemeFamily { hidden: Some(rgba(0x565b66ff).into()), ..Default::default() }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("comment".into(), rgba(0xabb5be8c).into()), + ("something".into(), rgba(0xa9d94bff).into()), + ("something".into(), rgba(0xbfbdb6ff).into()), + ("something".into(), rgba(0xff8f3fff).into()), + ("punctuation".into(), rgba(0xbfbdb6b3).into()), + ("punctuation".into(), rgba(0xbfbdb6ff).into()), + ("punctuation".into(), rgba(0xf29668ff).into()), + ("punctuation".into(), rgba(0xff8f3fff).into()), + ("punctuation".into(), rgba(0xff8f3fff).into()), + ("punctuation".into(), rgba(0x38b9e680).into()), + ("punctuation".into(), rgba(0x38b9e680).into()), + ("punctuation".into(), rgba(0x38b9e680).into()), + ("punctuation".into(), rgba(0xabb5be8c).into()), + ], + }), }, }, ], diff --git a/crates/theme2/src/themes/dracula.rs b/crates/theme2/src/themes/dracula.rs index 2a30f5a0c03e7894d6bfb9a6cdf9b4c5652c6461..757f5d5a18f1d5222685aa75f952aeacd9b8ec2d 100644 --- a/crates/theme2/src/themes/dracula.rs +++ b/crates/theme2/src/themes/dracula.rs @@ -1,70 +1,18 @@ -// This file was generated by the `theme_importer`. -// Be careful when modifying it by hand. -use gpui::rgba; + // This file was generated by the `theme_importer`. + // Be careful when modifying it by hand. -use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, - UserThemeStylesRefinement, -}; + use gpui::rgba; -pub fn dracula() -> UserThemeFamily { - UserThemeFamily { - name: "Dracula".into(), - author: "Zeno Rocha".into(), - themes: vec![UserTheme { - name: "Dracula".into(), - appearance: Appearance::Dark, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0xbd93f9ff).into()), - border_variant: Some(rgba(0xbd93f9ff).into()), - border_focused: Some(rgba(0x6272a4ff).into()), - border_selected: Some(rgba(0xbd93f9ff).into()), - border_transparent: Some(rgba(0xbd93f9ff).into()), - border_disabled: Some(rgba(0xbd93f9ff).into()), - elevated_surface_background: Some(rgba(0x282a35ff).into()), - surface_background: Some(rgba(0x282a35ff).into()), - background: Some(rgba(0x282a35ff).into()), - element_background: Some(rgba(0x44475aff).into()), - element_hover: Some(rgba(0x44475a75).into()), - element_selected: Some(rgba(0x44475aff).into()), - drop_target_background: Some(rgba(0x44475aff).into()), - ghost_element_hover: Some(rgba(0x44475a75).into()), - text: Some(rgba(0xf8f8f2ff).into()), - tab_inactive_background: Some(rgba(0x21222cff).into()), - tab_active_background: Some(rgba(0x282a35ff).into()), - editor_background: Some(rgba(0x282a35ff).into()), - editor_gutter_background: Some(rgba(0x282a35ff).into()), - editor_line_number: Some(rgba(0x6272a4ff).into()), - editor_active_line_number: Some(rgba(0xf8f8f2ff).into()), - terminal_background: Some(rgba(0x282a35ff).into()), - terminal_ansi_bright_black: Some(rgba(0x6272a4ff).into()), - terminal_ansi_bright_red: Some(rgba(0xff6d6dff).into()), - terminal_ansi_bright_green: Some(rgba(0x69ff94ff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xffffa5ff).into()), - terminal_ansi_bright_blue: Some(rgba(0xd6abfeff).into()), - terminal_ansi_bright_magenta: Some(rgba(0xff92dfff).into()), - terminal_ansi_bright_cyan: Some(rgba(0xa3fefeff).into()), - terminal_ansi_bright_white: Some(rgba(0xffffffff).into()), - terminal_ansi_black: Some(rgba(0x21222cff).into()), - terminal_ansi_red: Some(rgba(0xff5555ff).into()), - terminal_ansi_green: Some(rgba(0x50fa7bff).into()), - terminal_ansi_yellow: Some(rgba(0xf1fa8cff).into()), - terminal_ansi_blue: Some(rgba(0xbd93f9ff).into()), - terminal_ansi_magenta: Some(rgba(0xff79c6ff).into()), - terminal_ansi_cyan: Some(rgba(0x8be9fdff).into()), - terminal_ansi_white: Some(rgba(0xf8f8f2ff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xff5555ff).into()), - error: Some(rgba(0xff5555ff).into()), - hidden: Some(rgba(0x6272a4ff).into()), - warning: Some(rgba(0xffb76bff).into()), - ..Default::default() - }, - }, - }], - } + use crate::{ + Appearance, ThemeColorsRefinement, StatusColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + }; + + pub fn dracula() -> UserThemeFamily { + UserThemeFamily { + name: "Dracula".into(), + author: "Zeno Rocha".into(), + themes: vec![UserTheme { name: "Dracula".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0xbd93f9ff).into()),border_variant: Some(rgba(0xbd93f9ff).into()),border_focused: Some(rgba(0x6272a4ff).into()),border_selected: Some(rgba(0xbd93f9ff).into()),border_transparent: Some(rgba(0xbd93f9ff).into()),border_disabled: Some(rgba(0xbd93f9ff).into()),elevated_surface_background: Some(rgba(0x282a35ff).into()),surface_background: Some(rgba(0x282a35ff).into()),background: Some(rgba(0x282a35ff).into()),element_background: Some(rgba(0x44475aff).into()),element_hover: Some(rgba(0x44475a75).into()),element_selected: Some(rgba(0x44475aff).into()),drop_target_background: Some(rgba(0x44475aff).into()),ghost_element_hover: Some(rgba(0x44475a75).into()),text: Some(rgba(0xf8f8f2ff).into()),tab_inactive_background: Some(rgba(0x21222cff).into()),tab_active_background: Some(rgba(0x282a35ff).into()),editor_background: Some(rgba(0x282a35ff).into()),editor_gutter_background: Some(rgba(0x282a35ff).into()),editor_line_number: Some(rgba(0x6272a4ff).into()),editor_active_line_number: Some(rgba(0xf8f8f2ff).into()),terminal_background: Some(rgba(0x282a35ff).into()),terminal_ansi_bright_black: Some(rgba(0x6272a4ff).into()),terminal_ansi_bright_red: Some(rgba(0xff6d6dff).into()),terminal_ansi_bright_green: Some(rgba(0x69ff94ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xffffa5ff).into()),terminal_ansi_bright_blue: Some(rgba(0xd6abfeff).into()),terminal_ansi_bright_magenta: Some(rgba(0xff92dfff).into()),terminal_ansi_bright_cyan: Some(rgba(0xa3fefeff).into()),terminal_ansi_bright_white: Some(rgba(0xffffffff).into()),terminal_ansi_black: Some(rgba(0x21222cff).into()),terminal_ansi_red: Some(rgba(0xff5555ff).into()),terminal_ansi_green: Some(rgba(0x50fa7bff).into()),terminal_ansi_yellow: Some(rgba(0xf1fa8cff).into()),terminal_ansi_blue: Some(rgba(0xbd93f9ff).into()),terminal_ansi_magenta: Some(rgba(0xff79c6ff).into()),terminal_ansi_cyan: Some(rgba(0x8be9fdff).into()),terminal_ansi_white: Some(rgba(0xf8f8f2ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xff5555ff).into()),error: Some(rgba(0xff5555ff).into()),hidden: Some(rgba(0x6272a4ff).into()),warning: Some(rgba(0xffb76bff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x6272a4ff).into()), ("something".into(), rgba(0xbd93f9ff).into()), ("something".into(), rgba(0x8be9fdff).into()), ("punctuation".into(), rgba(0xff79c6ff).into()), ("punctuation".into(), rgba(0xff79c6ff).into()), ("something".into(), rgba(0xff79c6ff).into()), ("something".into(), rgba(0xf1fa8cff).into()), ("something".into(), rgba(0xf8f8f2ff).into())] }) } }], } + } + \ No newline at end of file diff --git a/crates/theme2/src/themes/gruvbox.rs b/crates/theme2/src/themes/gruvbox.rs index 33bb90d8e811ca3f5a5d6ebbe4725531d9689944..71be1ec98bfb3396bcadcf63281b29264759e916 100644 --- a/crates/theme2/src/themes/gruvbox.rs +++ b/crates/theme2/src/themes/gruvbox.rs @@ -1,324 +1,18 @@ -// This file was generated by the `theme_importer`. -// Be careful when modifying it by hand. -use gpui::rgba; + // This file was generated by the `theme_importer`. + // Be careful when modifying it by hand. -use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, - UserThemeStylesRefinement, -}; + use gpui::rgba; -pub fn gruvbox() -> UserThemeFamily { - UserThemeFamily { - name: "Gruvbox".into(), - author: "morhetz".into(), - themes: vec![ - UserTheme { - name: "Gruvbox Dark Hard".into(), - appearance: Appearance::Dark, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0x3c3836ff).into()), - border_variant: Some(rgba(0x3c3836ff).into()), - border_focused: Some(rgba(0x3c3836ff).into()), - border_selected: Some(rgba(0x3c3836ff).into()), - border_transparent: Some(rgba(0x3c3836ff).into()), - border_disabled: Some(rgba(0x3c3836ff).into()), - background: Some(rgba(0x1d2021ff).into()), - element_background: Some(rgba(0x44858780).into()), - element_hover: Some(rgba(0x3c383680).into()), - element_selected: Some(rgba(0x3c383680).into()), - drop_target_background: Some(rgba(0x3c3836ff).into()), - ghost_element_hover: Some(rgba(0x3c383680).into()), - text: Some(rgba(0xebdbb2ff).into()), - tab_inactive_background: Some(rgba(0x1d2021ff).into()), - tab_active_background: Some(rgba(0x32302fff).into()), - editor_background: Some(rgba(0x1d2021ff).into()), - editor_gutter_background: Some(rgba(0x1d2021ff).into()), - editor_line_number: Some(rgba(0x665c54ff).into()), - editor_active_line_number: Some(rgba(0xebdbb2ff).into()), - terminal_background: Some(rgba(0x1d2021ff).into()), - terminal_ansi_bright_black: Some(rgba(0x928374ff).into()), - terminal_ansi_bright_red: Some(rgba(0xfb4833ff).into()), - terminal_ansi_bright_green: Some(rgba(0xb8bb25ff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xfabd2eff).into()), - terminal_ansi_bright_blue: Some(rgba(0x83a598ff).into()), - terminal_ansi_bright_magenta: Some(rgba(0xd3869bff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x8ec07cff).into()), - terminal_ansi_bright_white: Some(rgba(0xebdbb2ff).into()), - terminal_ansi_black: Some(rgba(0x3c3836ff).into()), - terminal_ansi_red: Some(rgba(0xcc241cff).into()), - terminal_ansi_green: Some(rgba(0x989719ff).into()), - terminal_ansi_yellow: Some(rgba(0xd79920ff).into()), - terminal_ansi_blue: Some(rgba(0x448587ff).into()), - terminal_ansi_magenta: Some(rgba(0xb16185ff).into()), - terminal_ansi_cyan: Some(rgba(0x679d6aff).into()), - terminal_ansi_white: Some(rgba(0xa89984ff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xfb4833ff).into()), - error: Some(rgba(0xfb4833ff).into()), - hidden: Some(rgba(0xa89984ff).into()), - ..Default::default() - }, - }, - }, - UserTheme { - name: "Gruvbox Dark Medium".into(), - appearance: Appearance::Dark, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0x3c3836ff).into()), - border_variant: Some(rgba(0x3c3836ff).into()), - border_focused: Some(rgba(0x3c3836ff).into()), - border_selected: Some(rgba(0x3c3836ff).into()), - border_transparent: Some(rgba(0x3c3836ff).into()), - border_disabled: Some(rgba(0x3c3836ff).into()), - background: Some(rgba(0x282828ff).into()), - element_background: Some(rgba(0x44858780).into()), - element_hover: Some(rgba(0x3c383680).into()), - element_selected: Some(rgba(0x3c383680).into()), - drop_target_background: Some(rgba(0x3c3836ff).into()), - ghost_element_hover: Some(rgba(0x3c383680).into()), - text: Some(rgba(0xebdbb2ff).into()), - tab_inactive_background: Some(rgba(0x282828ff).into()), - tab_active_background: Some(rgba(0x3c3836ff).into()), - editor_background: Some(rgba(0x282828ff).into()), - editor_gutter_background: Some(rgba(0x282828ff).into()), - editor_line_number: Some(rgba(0x665c54ff).into()), - editor_active_line_number: Some(rgba(0xebdbb2ff).into()), - terminal_background: Some(rgba(0x282828ff).into()), - terminal_ansi_bright_black: Some(rgba(0x928374ff).into()), - terminal_ansi_bright_red: Some(rgba(0xfb4833ff).into()), - terminal_ansi_bright_green: Some(rgba(0xb8bb25ff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xfabd2eff).into()), - terminal_ansi_bright_blue: Some(rgba(0x83a598ff).into()), - terminal_ansi_bright_magenta: Some(rgba(0xd3869bff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x8ec07cff).into()), - terminal_ansi_bright_white: Some(rgba(0xebdbb2ff).into()), - terminal_ansi_black: Some(rgba(0x3c3836ff).into()), - terminal_ansi_red: Some(rgba(0xcc241cff).into()), - terminal_ansi_green: Some(rgba(0x989719ff).into()), - terminal_ansi_yellow: Some(rgba(0xd79920ff).into()), - terminal_ansi_blue: Some(rgba(0x448587ff).into()), - terminal_ansi_magenta: Some(rgba(0xb16185ff).into()), - terminal_ansi_cyan: Some(rgba(0x679d6aff).into()), - terminal_ansi_white: Some(rgba(0xa89984ff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xfb4833ff).into()), - error: Some(rgba(0xfb4833ff).into()), - hidden: Some(rgba(0xa89984ff).into()), - ..Default::default() - }, - }, - }, - UserTheme { - name: "Gruvbox Dark Soft".into(), - appearance: Appearance::Dark, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0x3c3836ff).into()), - border_variant: Some(rgba(0x3c3836ff).into()), - border_focused: Some(rgba(0x3c3836ff).into()), - border_selected: Some(rgba(0x3c3836ff).into()), - border_transparent: Some(rgba(0x3c3836ff).into()), - border_disabled: Some(rgba(0x3c3836ff).into()), - background: Some(rgba(0x32302fff).into()), - element_background: Some(rgba(0x44858780).into()), - element_hover: Some(rgba(0x3c383680).into()), - element_selected: Some(rgba(0x3c383680).into()), - drop_target_background: Some(rgba(0x3c3836ff).into()), - ghost_element_hover: Some(rgba(0x3c383680).into()), - text: Some(rgba(0xebdbb2ff).into()), - tab_inactive_background: Some(rgba(0x32302fff).into()), - tab_active_background: Some(rgba(0x504945ff).into()), - editor_background: Some(rgba(0x32302fff).into()), - editor_gutter_background: Some(rgba(0x32302fff).into()), - editor_line_number: Some(rgba(0x665c54ff).into()), - editor_active_line_number: Some(rgba(0xebdbb2ff).into()), - terminal_background: Some(rgba(0x32302fff).into()), - terminal_ansi_bright_black: Some(rgba(0x928374ff).into()), - terminal_ansi_bright_red: Some(rgba(0xfb4833ff).into()), - terminal_ansi_bright_green: Some(rgba(0xb8bb25ff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xfabd2eff).into()), - terminal_ansi_bright_blue: Some(rgba(0x83a598ff).into()), - terminal_ansi_bright_magenta: Some(rgba(0xd3869bff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x8ec07cff).into()), - terminal_ansi_bright_white: Some(rgba(0xebdbb2ff).into()), - terminal_ansi_black: Some(rgba(0x3c3836ff).into()), - terminal_ansi_red: Some(rgba(0xcc241cff).into()), - terminal_ansi_green: Some(rgba(0x989719ff).into()), - terminal_ansi_yellow: Some(rgba(0xd79920ff).into()), - terminal_ansi_blue: Some(rgba(0x448587ff).into()), - terminal_ansi_magenta: Some(rgba(0xb16185ff).into()), - terminal_ansi_cyan: Some(rgba(0x679d6aff).into()), - terminal_ansi_white: Some(rgba(0xa89984ff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xfb4833ff).into()), - error: Some(rgba(0xfb4833ff).into()), - hidden: Some(rgba(0xa89984ff).into()), - ..Default::default() - }, - }, - }, - UserTheme { - name: "Gruvbox Light Hard".into(), - appearance: Appearance::Light, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0xebdbb2ff).into()), - border_variant: Some(rgba(0xebdbb2ff).into()), - border_focused: Some(rgba(0xebdbb2ff).into()), - border_selected: Some(rgba(0xebdbb2ff).into()), - border_transparent: Some(rgba(0xebdbb2ff).into()), - border_disabled: Some(rgba(0xebdbb2ff).into()), - background: Some(rgba(0xf9f5d7ff).into()), - element_background: Some(rgba(0x44858780).into()), - element_hover: Some(rgba(0xebdbb280).into()), - element_selected: Some(rgba(0xebdbb280).into()), - drop_target_background: Some(rgba(0xebdbb2ff).into()), - ghost_element_hover: Some(rgba(0xebdbb280).into()), - text: Some(rgba(0x3c3836ff).into()), - tab_inactive_background: Some(rgba(0xf9f5d7ff).into()), - tab_active_background: Some(rgba(0xf2e5bcff).into()), - editor_background: Some(rgba(0xf9f5d7ff).into()), - editor_gutter_background: Some(rgba(0xf9f5d7ff).into()), - editor_line_number: Some(rgba(0xbdae93ff).into()), - editor_active_line_number: Some(rgba(0x3c3836ff).into()), - terminal_background: Some(rgba(0xf9f5d7ff).into()), - terminal_ansi_bright_black: Some(rgba(0x928374ff).into()), - terminal_ansi_bright_red: Some(rgba(0x9d0006ff).into()), - terminal_ansi_bright_green: Some(rgba(0x79740eff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xb57613ff).into()), - terminal_ansi_bright_blue: Some(rgba(0x066578ff).into()), - terminal_ansi_bright_magenta: Some(rgba(0x8f3e71ff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x427b58ff).into()), - terminal_ansi_bright_white: Some(rgba(0x3c3836ff).into()), - terminal_ansi_black: Some(rgba(0xebdbb2ff).into()), - terminal_ansi_red: Some(rgba(0xcc241cff).into()), - terminal_ansi_green: Some(rgba(0x989719ff).into()), - terminal_ansi_yellow: Some(rgba(0xd79920ff).into()), - terminal_ansi_blue: Some(rgba(0x448587ff).into()), - terminal_ansi_magenta: Some(rgba(0xb16185ff).into()), - terminal_ansi_cyan: Some(rgba(0x679d6aff).into()), - terminal_ansi_white: Some(rgba(0x7c6f64ff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0x9d0006ff).into()), - error: Some(rgba(0x9d0006ff).into()), - hidden: Some(rgba(0x7c6f64ff).into()), - ..Default::default() - }, - }, - }, - UserTheme { - name: "Gruvbox Light Medium".into(), - appearance: Appearance::Light, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0xebdbb2ff).into()), - border_variant: Some(rgba(0xebdbb2ff).into()), - border_focused: Some(rgba(0xebdbb2ff).into()), - border_selected: Some(rgba(0xebdbb2ff).into()), - border_transparent: Some(rgba(0xebdbb2ff).into()), - border_disabled: Some(rgba(0xebdbb2ff).into()), - background: Some(rgba(0xfbf1c7ff).into()), - element_background: Some(rgba(0x44858780).into()), - element_hover: Some(rgba(0xebdbb280).into()), - element_selected: Some(rgba(0xebdbb280).into()), - drop_target_background: Some(rgba(0xebdbb2ff).into()), - ghost_element_hover: Some(rgba(0xebdbb280).into()), - text: Some(rgba(0x3c3836ff).into()), - tab_inactive_background: Some(rgba(0xfbf1c7ff).into()), - tab_active_background: Some(rgba(0xebdbb2ff).into()), - editor_background: Some(rgba(0xfbf1c7ff).into()), - editor_gutter_background: Some(rgba(0xfbf1c7ff).into()), - editor_line_number: Some(rgba(0xbdae93ff).into()), - editor_active_line_number: Some(rgba(0x3c3836ff).into()), - terminal_background: Some(rgba(0xfbf1c7ff).into()), - terminal_ansi_bright_black: Some(rgba(0x928374ff).into()), - terminal_ansi_bright_red: Some(rgba(0x9d0006ff).into()), - terminal_ansi_bright_green: Some(rgba(0x79740eff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xb57613ff).into()), - terminal_ansi_bright_blue: Some(rgba(0x066578ff).into()), - terminal_ansi_bright_magenta: Some(rgba(0x8f3e71ff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x427b58ff).into()), - terminal_ansi_bright_white: Some(rgba(0x3c3836ff).into()), - terminal_ansi_black: Some(rgba(0xebdbb2ff).into()), - terminal_ansi_red: Some(rgba(0xcc241cff).into()), - terminal_ansi_green: Some(rgba(0x989719ff).into()), - terminal_ansi_yellow: Some(rgba(0xd79920ff).into()), - terminal_ansi_blue: Some(rgba(0x448587ff).into()), - terminal_ansi_magenta: Some(rgba(0xb16185ff).into()), - terminal_ansi_cyan: Some(rgba(0x679d6aff).into()), - terminal_ansi_white: Some(rgba(0x7c6f64ff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0x9d0006ff).into()), - error: Some(rgba(0x9d0006ff).into()), - hidden: Some(rgba(0x7c6f64ff).into()), - ..Default::default() - }, - }, - }, - UserTheme { - name: "Gruvbox Light Soft".into(), - appearance: Appearance::Light, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0xebdbb2ff).into()), - border_variant: Some(rgba(0xebdbb2ff).into()), - border_focused: Some(rgba(0xebdbb2ff).into()), - border_selected: Some(rgba(0xebdbb2ff).into()), - border_transparent: Some(rgba(0xebdbb2ff).into()), - border_disabled: Some(rgba(0xebdbb2ff).into()), - background: Some(rgba(0xf2e5bcff).into()), - element_background: Some(rgba(0x44858780).into()), - element_hover: Some(rgba(0xebdbb280).into()), - element_selected: Some(rgba(0xebdbb280).into()), - drop_target_background: Some(rgba(0xebdbb2ff).into()), - ghost_element_hover: Some(rgba(0xebdbb280).into()), - text: Some(rgba(0x3c3836ff).into()), - tab_inactive_background: Some(rgba(0xf2e5bcff).into()), - tab_active_background: Some(rgba(0xd5c4a1ff).into()), - editor_background: Some(rgba(0xf2e5bcff).into()), - editor_gutter_background: Some(rgba(0xf2e5bcff).into()), - editor_line_number: Some(rgba(0xbdae93ff).into()), - editor_active_line_number: Some(rgba(0x3c3836ff).into()), - terminal_background: Some(rgba(0xf2e5bcff).into()), - terminal_ansi_bright_black: Some(rgba(0x928374ff).into()), - terminal_ansi_bright_red: Some(rgba(0x9d0006ff).into()), - terminal_ansi_bright_green: Some(rgba(0x79740eff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xb57613ff).into()), - terminal_ansi_bright_blue: Some(rgba(0x066578ff).into()), - terminal_ansi_bright_magenta: Some(rgba(0x8f3e71ff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x427b58ff).into()), - terminal_ansi_bright_white: Some(rgba(0x3c3836ff).into()), - terminal_ansi_black: Some(rgba(0xebdbb2ff).into()), - terminal_ansi_red: Some(rgba(0xcc241cff).into()), - terminal_ansi_green: Some(rgba(0x989719ff).into()), - terminal_ansi_yellow: Some(rgba(0xd79920ff).into()), - terminal_ansi_blue: Some(rgba(0x448587ff).into()), - terminal_ansi_magenta: Some(rgba(0xb16185ff).into()), - terminal_ansi_cyan: Some(rgba(0x679d6aff).into()), - terminal_ansi_white: Some(rgba(0x7c6f64ff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0x9d0006ff).into()), - error: Some(rgba(0x9d0006ff).into()), - hidden: Some(rgba(0x7c6f64ff).into()), - ..Default::default() - }, - }, - }, - ], - } + use crate::{ + Appearance, ThemeColorsRefinement, StatusColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + }; + + pub fn gruvbox() -> UserThemeFamily { + UserThemeFamily { + name: "Gruvbox".into(), + author: "morhetz".into(), + themes: vec![UserTheme { name: "Gruvbox Dark Hard".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x3c3836ff).into()),border_variant: Some(rgba(0x3c3836ff).into()),border_focused: Some(rgba(0x3c3836ff).into()),border_selected: Some(rgba(0x3c3836ff).into()),border_transparent: Some(rgba(0x3c3836ff).into()),border_disabled: Some(rgba(0x3c3836ff).into()),background: Some(rgba(0x1d2021ff).into()),element_background: Some(rgba(0x44858780).into()),element_hover: Some(rgba(0x3c383680).into()),element_selected: Some(rgba(0x3c383680).into()),drop_target_background: Some(rgba(0x3c3836ff).into()),ghost_element_hover: Some(rgba(0x3c383680).into()),text: Some(rgba(0xebdbb2ff).into()),tab_inactive_background: Some(rgba(0x1d2021ff).into()),tab_active_background: Some(rgba(0x32302fff).into()),editor_background: Some(rgba(0x1d2021ff).into()),editor_gutter_background: Some(rgba(0x1d2021ff).into()),editor_line_number: Some(rgba(0x665c54ff).into()),editor_active_line_number: Some(rgba(0xebdbb2ff).into()),terminal_background: Some(rgba(0x1d2021ff).into()),terminal_ansi_bright_black: Some(rgba(0x928374ff).into()),terminal_ansi_bright_red: Some(rgba(0xfb4833ff).into()),terminal_ansi_bright_green: Some(rgba(0xb8bb25ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xfabd2eff).into()),terminal_ansi_bright_blue: Some(rgba(0x83a598ff).into()),terminal_ansi_bright_magenta: Some(rgba(0xd3869bff).into()),terminal_ansi_bright_cyan: Some(rgba(0x8ec07cff).into()),terminal_ansi_bright_white: Some(rgba(0xebdbb2ff).into()),terminal_ansi_black: Some(rgba(0x3c3836ff).into()),terminal_ansi_red: Some(rgba(0xcc241cff).into()),terminal_ansi_green: Some(rgba(0x989719ff).into()),terminal_ansi_yellow: Some(rgba(0xd79920ff).into()),terminal_ansi_blue: Some(rgba(0x448587ff).into()),terminal_ansi_magenta: Some(rgba(0xb16185ff).into()),terminal_ansi_cyan: Some(rgba(0x679d6aff).into()),terminal_ansi_white: Some(rgba(0xa89984ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xfb4833ff).into()),error: Some(rgba(0xfb4833ff).into()),hidden: Some(rgba(0xa89984ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x928374ff).into()), ("something".into(), rgba(0xd3869bff).into()), ("something".into(), rgba(0xfb4833ff).into()), ("something".into(), rgba(0xb8bb25ff).into()), ("something".into(), rgba(0x83a598ff).into()), ("punctuation".into(), rgba(0xa89984ff).into()), ("punctuation".into(), rgba(0x83a598ff).into())] }) } }, UserTheme { name: "Gruvbox Dark Medium".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x3c3836ff).into()),border_variant: Some(rgba(0x3c3836ff).into()),border_focused: Some(rgba(0x3c3836ff).into()),border_selected: Some(rgba(0x3c3836ff).into()),border_transparent: Some(rgba(0x3c3836ff).into()),border_disabled: Some(rgba(0x3c3836ff).into()),background: Some(rgba(0x282828ff).into()),element_background: Some(rgba(0x44858780).into()),element_hover: Some(rgba(0x3c383680).into()),element_selected: Some(rgba(0x3c383680).into()),drop_target_background: Some(rgba(0x3c3836ff).into()),ghost_element_hover: Some(rgba(0x3c383680).into()),text: Some(rgba(0xebdbb2ff).into()),tab_inactive_background: Some(rgba(0x282828ff).into()),tab_active_background: Some(rgba(0x3c3836ff).into()),editor_background: Some(rgba(0x282828ff).into()),editor_gutter_background: Some(rgba(0x282828ff).into()),editor_line_number: Some(rgba(0x665c54ff).into()),editor_active_line_number: Some(rgba(0xebdbb2ff).into()),terminal_background: Some(rgba(0x282828ff).into()),terminal_ansi_bright_black: Some(rgba(0x928374ff).into()),terminal_ansi_bright_red: Some(rgba(0xfb4833ff).into()),terminal_ansi_bright_green: Some(rgba(0xb8bb25ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xfabd2eff).into()),terminal_ansi_bright_blue: Some(rgba(0x83a598ff).into()),terminal_ansi_bright_magenta: Some(rgba(0xd3869bff).into()),terminal_ansi_bright_cyan: Some(rgba(0x8ec07cff).into()),terminal_ansi_bright_white: Some(rgba(0xebdbb2ff).into()),terminal_ansi_black: Some(rgba(0x3c3836ff).into()),terminal_ansi_red: Some(rgba(0xcc241cff).into()),terminal_ansi_green: Some(rgba(0x989719ff).into()),terminal_ansi_yellow: Some(rgba(0xd79920ff).into()),terminal_ansi_blue: Some(rgba(0x448587ff).into()),terminal_ansi_magenta: Some(rgba(0xb16185ff).into()),terminal_ansi_cyan: Some(rgba(0x679d6aff).into()),terminal_ansi_white: Some(rgba(0xa89984ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xfb4833ff).into()),error: Some(rgba(0xfb4833ff).into()),hidden: Some(rgba(0xa89984ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x928374ff).into()), ("something".into(), rgba(0xd3869bff).into()), ("something".into(), rgba(0xfb4833ff).into()), ("something".into(), rgba(0xb8bb25ff).into()), ("something".into(), rgba(0x83a598ff).into()), ("punctuation".into(), rgba(0xa89984ff).into()), ("punctuation".into(), rgba(0x83a598ff).into())] }) } }, UserTheme { name: "Gruvbox Dark Soft".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x3c3836ff).into()),border_variant: Some(rgba(0x3c3836ff).into()),border_focused: Some(rgba(0x3c3836ff).into()),border_selected: Some(rgba(0x3c3836ff).into()),border_transparent: Some(rgba(0x3c3836ff).into()),border_disabled: Some(rgba(0x3c3836ff).into()),background: Some(rgba(0x32302fff).into()),element_background: Some(rgba(0x44858780).into()),element_hover: Some(rgba(0x3c383680).into()),element_selected: Some(rgba(0x3c383680).into()),drop_target_background: Some(rgba(0x3c3836ff).into()),ghost_element_hover: Some(rgba(0x3c383680).into()),text: Some(rgba(0xebdbb2ff).into()),tab_inactive_background: Some(rgba(0x32302fff).into()),tab_active_background: Some(rgba(0x504945ff).into()),editor_background: Some(rgba(0x32302fff).into()),editor_gutter_background: Some(rgba(0x32302fff).into()),editor_line_number: Some(rgba(0x665c54ff).into()),editor_active_line_number: Some(rgba(0xebdbb2ff).into()),terminal_background: Some(rgba(0x32302fff).into()),terminal_ansi_bright_black: Some(rgba(0x928374ff).into()),terminal_ansi_bright_red: Some(rgba(0xfb4833ff).into()),terminal_ansi_bright_green: Some(rgba(0xb8bb25ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xfabd2eff).into()),terminal_ansi_bright_blue: Some(rgba(0x83a598ff).into()),terminal_ansi_bright_magenta: Some(rgba(0xd3869bff).into()),terminal_ansi_bright_cyan: Some(rgba(0x8ec07cff).into()),terminal_ansi_bright_white: Some(rgba(0xebdbb2ff).into()),terminal_ansi_black: Some(rgba(0x3c3836ff).into()),terminal_ansi_red: Some(rgba(0xcc241cff).into()),terminal_ansi_green: Some(rgba(0x989719ff).into()),terminal_ansi_yellow: Some(rgba(0xd79920ff).into()),terminal_ansi_blue: Some(rgba(0x448587ff).into()),terminal_ansi_magenta: Some(rgba(0xb16185ff).into()),terminal_ansi_cyan: Some(rgba(0x679d6aff).into()),terminal_ansi_white: Some(rgba(0xa89984ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xfb4833ff).into()),error: Some(rgba(0xfb4833ff).into()),hidden: Some(rgba(0xa89984ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x928374ff).into()), ("something".into(), rgba(0xd3869bff).into()), ("something".into(), rgba(0xfb4833ff).into()), ("something".into(), rgba(0xb8bb25ff).into()), ("something".into(), rgba(0x83a598ff).into()), ("punctuation".into(), rgba(0xa89984ff).into()), ("punctuation".into(), rgba(0x83a598ff).into())] }) } }, UserTheme { name: "Gruvbox Light Hard".into(), appearance: Appearance::Light, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0xebdbb2ff).into()),border_variant: Some(rgba(0xebdbb2ff).into()),border_focused: Some(rgba(0xebdbb2ff).into()),border_selected: Some(rgba(0xebdbb2ff).into()),border_transparent: Some(rgba(0xebdbb2ff).into()),border_disabled: Some(rgba(0xebdbb2ff).into()),background: Some(rgba(0xf9f5d7ff).into()),element_background: Some(rgba(0x44858780).into()),element_hover: Some(rgba(0xebdbb280).into()),element_selected: Some(rgba(0xebdbb280).into()),drop_target_background: Some(rgba(0xebdbb2ff).into()),ghost_element_hover: Some(rgba(0xebdbb280).into()),text: Some(rgba(0x3c3836ff).into()),tab_inactive_background: Some(rgba(0xf9f5d7ff).into()),tab_active_background: Some(rgba(0xf2e5bcff).into()),editor_background: Some(rgba(0xf9f5d7ff).into()),editor_gutter_background: Some(rgba(0xf9f5d7ff).into()),editor_line_number: Some(rgba(0xbdae93ff).into()),editor_active_line_number: Some(rgba(0x3c3836ff).into()),terminal_background: Some(rgba(0xf9f5d7ff).into()),terminal_ansi_bright_black: Some(rgba(0x928374ff).into()),terminal_ansi_bright_red: Some(rgba(0x9d0006ff).into()),terminal_ansi_bright_green: Some(rgba(0x79740eff).into()),terminal_ansi_bright_yellow: Some(rgba(0xb57613ff).into()),terminal_ansi_bright_blue: Some(rgba(0x066578ff).into()),terminal_ansi_bright_magenta: Some(rgba(0x8f3e71ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x427b58ff).into()),terminal_ansi_bright_white: Some(rgba(0x3c3836ff).into()),terminal_ansi_black: Some(rgba(0xebdbb2ff).into()),terminal_ansi_red: Some(rgba(0xcc241cff).into()),terminal_ansi_green: Some(rgba(0x989719ff).into()),terminal_ansi_yellow: Some(rgba(0xd79920ff).into()),terminal_ansi_blue: Some(rgba(0x448587ff).into()),terminal_ansi_magenta: Some(rgba(0xb16185ff).into()),terminal_ansi_cyan: Some(rgba(0x679d6aff).into()),terminal_ansi_white: Some(rgba(0x7c6f64ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0x9d0006ff).into()),error: Some(rgba(0x9d0006ff).into()),hidden: Some(rgba(0x7c6f64ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x928374ff).into()), ("something".into(), rgba(0x8f3e71ff).into()), ("something".into(), rgba(0x9d0006ff).into()), ("something".into(), rgba(0x79740eff).into()), ("something".into(), rgba(0x066578ff).into()), ("punctuation".into(), rgba(0x7c6f64ff).into()), ("punctuation".into(), rgba(0x066578ff).into())] }) } }, UserTheme { name: "Gruvbox Light Medium".into(), appearance: Appearance::Light, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0xebdbb2ff).into()),border_variant: Some(rgba(0xebdbb2ff).into()),border_focused: Some(rgba(0xebdbb2ff).into()),border_selected: Some(rgba(0xebdbb2ff).into()),border_transparent: Some(rgba(0xebdbb2ff).into()),border_disabled: Some(rgba(0xebdbb2ff).into()),background: Some(rgba(0xfbf1c7ff).into()),element_background: Some(rgba(0x44858780).into()),element_hover: Some(rgba(0xebdbb280).into()),element_selected: Some(rgba(0xebdbb280).into()),drop_target_background: Some(rgba(0xebdbb2ff).into()),ghost_element_hover: Some(rgba(0xebdbb280).into()),text: Some(rgba(0x3c3836ff).into()),tab_inactive_background: Some(rgba(0xfbf1c7ff).into()),tab_active_background: Some(rgba(0xebdbb2ff).into()),editor_background: Some(rgba(0xfbf1c7ff).into()),editor_gutter_background: Some(rgba(0xfbf1c7ff).into()),editor_line_number: Some(rgba(0xbdae93ff).into()),editor_active_line_number: Some(rgba(0x3c3836ff).into()),terminal_background: Some(rgba(0xfbf1c7ff).into()),terminal_ansi_bright_black: Some(rgba(0x928374ff).into()),terminal_ansi_bright_red: Some(rgba(0x9d0006ff).into()),terminal_ansi_bright_green: Some(rgba(0x79740eff).into()),terminal_ansi_bright_yellow: Some(rgba(0xb57613ff).into()),terminal_ansi_bright_blue: Some(rgba(0x066578ff).into()),terminal_ansi_bright_magenta: Some(rgba(0x8f3e71ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x427b58ff).into()),terminal_ansi_bright_white: Some(rgba(0x3c3836ff).into()),terminal_ansi_black: Some(rgba(0xebdbb2ff).into()),terminal_ansi_red: Some(rgba(0xcc241cff).into()),terminal_ansi_green: Some(rgba(0x989719ff).into()),terminal_ansi_yellow: Some(rgba(0xd79920ff).into()),terminal_ansi_blue: Some(rgba(0x448587ff).into()),terminal_ansi_magenta: Some(rgba(0xb16185ff).into()),terminal_ansi_cyan: Some(rgba(0x679d6aff).into()),terminal_ansi_white: Some(rgba(0x7c6f64ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0x9d0006ff).into()),error: Some(rgba(0x9d0006ff).into()),hidden: Some(rgba(0x7c6f64ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x928374ff).into()), ("something".into(), rgba(0x8f3e71ff).into()), ("something".into(), rgba(0x9d0006ff).into()), ("something".into(), rgba(0x79740eff).into()), ("something".into(), rgba(0x066578ff).into()), ("punctuation".into(), rgba(0x7c6f64ff).into()), ("punctuation".into(), rgba(0x066578ff).into())] }) } }, UserTheme { name: "Gruvbox Light Soft".into(), appearance: Appearance::Light, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0xebdbb2ff).into()),border_variant: Some(rgba(0xebdbb2ff).into()),border_focused: Some(rgba(0xebdbb2ff).into()),border_selected: Some(rgba(0xebdbb2ff).into()),border_transparent: Some(rgba(0xebdbb2ff).into()),border_disabled: Some(rgba(0xebdbb2ff).into()),background: Some(rgba(0xf2e5bcff).into()),element_background: Some(rgba(0x44858780).into()),element_hover: Some(rgba(0xebdbb280).into()),element_selected: Some(rgba(0xebdbb280).into()),drop_target_background: Some(rgba(0xebdbb2ff).into()),ghost_element_hover: Some(rgba(0xebdbb280).into()),text: Some(rgba(0x3c3836ff).into()),tab_inactive_background: Some(rgba(0xf2e5bcff).into()),tab_active_background: Some(rgba(0xd5c4a1ff).into()),editor_background: Some(rgba(0xf2e5bcff).into()),editor_gutter_background: Some(rgba(0xf2e5bcff).into()),editor_line_number: Some(rgba(0xbdae93ff).into()),editor_active_line_number: Some(rgba(0x3c3836ff).into()),terminal_background: Some(rgba(0xf2e5bcff).into()),terminal_ansi_bright_black: Some(rgba(0x928374ff).into()),terminal_ansi_bright_red: Some(rgba(0x9d0006ff).into()),terminal_ansi_bright_green: Some(rgba(0x79740eff).into()),terminal_ansi_bright_yellow: Some(rgba(0xb57613ff).into()),terminal_ansi_bright_blue: Some(rgba(0x066578ff).into()),terminal_ansi_bright_magenta: Some(rgba(0x8f3e71ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x427b58ff).into()),terminal_ansi_bright_white: Some(rgba(0x3c3836ff).into()),terminal_ansi_black: Some(rgba(0xebdbb2ff).into()),terminal_ansi_red: Some(rgba(0xcc241cff).into()),terminal_ansi_green: Some(rgba(0x989719ff).into()),terminal_ansi_yellow: Some(rgba(0xd79920ff).into()),terminal_ansi_blue: Some(rgba(0x448587ff).into()),terminal_ansi_magenta: Some(rgba(0xb16185ff).into()),terminal_ansi_cyan: Some(rgba(0x679d6aff).into()),terminal_ansi_white: Some(rgba(0x7c6f64ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0x9d0006ff).into()),error: Some(rgba(0x9d0006ff).into()),hidden: Some(rgba(0x7c6f64ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x928374ff).into()), ("something".into(), rgba(0x8f3e71ff).into()), ("something".into(), rgba(0x9d0006ff).into()), ("something".into(), rgba(0x79740eff).into()), ("something".into(), rgba(0x066578ff).into()), ("punctuation".into(), rgba(0x7c6f64ff).into()), ("punctuation".into(), rgba(0x066578ff).into())] }) } }], } + } + \ No newline at end of file diff --git a/crates/theme2/src/themes/mod.rs b/crates/theme2/src/themes/mod.rs index c48338b184ac8678f8af3f13a274757435cdbca9..13397105e292a6a11025cff255a2446ad9b39ce8 100644 --- a/crates/theme2/src/themes/mod.rs +++ b/crates/theme2/src/themes/mod.rs @@ -1,44 +1,36 @@ -// This file was generated by the `theme_importer`. -// Be careful when modifying it by hand. + // This file was generated by the `theme_importer`. + // Be careful when modifying it by hand. + + mod rose_pine; +mod night_owl; mod andromeda; -mod ayu; +mod synthwave_84; +mod palenight; mod dracula; -mod gruvbox; -mod night_owl; +mod solarized; mod nord; mod notctis; -mod palenight; -mod rose_pine; -mod solarized; -mod synthwave_84; +mod ayu; +mod gruvbox; + pub use rose_pine::*; +pub use night_owl::*; pub use andromeda::*; -pub use ayu::*; +pub use synthwave_84::*; +pub use palenight::*; pub use dracula::*; -pub use gruvbox::*; -pub use night_owl::*; +pub use solarized::*; pub use nord::*; pub use notctis::*; -pub use palenight::*; -pub use rose_pine::*; -pub use solarized::*; -pub use synthwave_84::*; +pub use ayu::*; +pub use gruvbox::*; -use crate::UserThemeFamily; + + use crate::UserThemeFamily; -pub(crate) fn all_user_themes() -> Vec { - vec![ - rose_pine(), - night_owl(), - andromeda(), - synthwave_84(), - palenight(), - dracula(), - solarized(), - nord(), - notctis(), - ayu(), - gruvbox(), - ] -} + pub(crate) fn all_user_themes() -> Vec { + vec![rose_pine(), night_owl(), andromeda(), synthwave_84(), palenight(), dracula(), solarized(), nord(), notctis(), ayu(), gruvbox()] + } + + \ No newline at end of file diff --git a/crates/theme2/src/themes/night_owl.rs b/crates/theme2/src/themes/night_owl.rs index d406ab79db8794afff4b5f2593a7f2a2c3c99096..20619cbdb4cf3f252cbbe16a0ebcda61bceab7f9 100644 --- a/crates/theme2/src/themes/night_owl.rs +++ b/crates/theme2/src/themes/night_owl.rs @@ -1,123 +1,18 @@ -// This file was generated by the `theme_importer`. -// Be careful when modifying it by hand. -use gpui::rgba; + // This file was generated by the `theme_importer`. + // Be careful when modifying it by hand. -use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, - UserThemeStylesRefinement, -}; + use gpui::rgba; -pub fn night_owl() -> UserThemeFamily { - UserThemeFamily { - name: "Night Owl".into(), - author: "Sarah Drasner (sdras)".into(), - themes: vec![ - UserTheme { - name: "Night Owl".into(), - appearance: Appearance::Dark, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0x5f7e97ff).into()), - border_variant: Some(rgba(0x5f7e97ff).into()), - border_focused: Some(rgba(0x122d42ff).into()), - border_selected: Some(rgba(0x5f7e97ff).into()), - border_transparent: Some(rgba(0x5f7e97ff).into()), - border_disabled: Some(rgba(0x5f7e97ff).into()), - elevated_surface_background: Some(rgba(0x011526ff).into()), - surface_background: Some(rgba(0x011526ff).into()), - background: Some(rgba(0x011526ff).into()), - element_background: Some(rgba(0x7d56c1cc).into()), - element_hover: Some(rgba(0x011526ff).into()), - element_selected: Some(rgba(0x234c708c).into()), - drop_target_background: Some(rgba(0x011526ff).into()), - ghost_element_hover: Some(rgba(0x011526ff).into()), - text: Some(rgba(0xd6deebff).into()), - tab_inactive_background: Some(rgba(0x01101cff).into()), - tab_active_background: Some(rgba(0x0a2842ff).into()), - editor_background: Some(rgba(0x011526ff).into()), - editor_gutter_background: Some(rgba(0x011526ff).into()), - editor_line_number: Some(rgba(0x4b6479ff).into()), - editor_active_line_number: Some(rgba(0xd6deebff).into()), - terminal_ansi_bright_black: Some(rgba(0x575656ff).into()), - terminal_ansi_bright_red: Some(rgba(0xef524fff).into()), - terminal_ansi_bright_green: Some(rgba(0x21da6eff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xffeb95ff).into()), - terminal_ansi_bright_blue: Some(rgba(0x82aaffff).into()), - terminal_ansi_bright_magenta: Some(rgba(0xc792eaff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x7fdbcaff).into()), - terminal_ansi_bright_white: Some(rgba(0xffffffff).into()), - terminal_ansi_black: Some(rgba(0x011526ff).into()), - terminal_ansi_red: Some(rgba(0xef524fff).into()), - terminal_ansi_green: Some(rgba(0x21da6eff).into()), - terminal_ansi_yellow: Some(rgba(0xc5e478ff).into()), - terminal_ansi_blue: Some(rgba(0x82aaffff).into()), - terminal_ansi_magenta: Some(rgba(0xc792eaff).into()), - terminal_ansi_cyan: Some(rgba(0x20c7a7ff).into()), - terminal_ansi_white: Some(rgba(0xffffffff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xef524fff).into()), - error: Some(rgba(0xef524fff).into()), - hidden: Some(rgba(0x5f7e97ff).into()), - ..Default::default() - }, - }, - }, - UserTheme { - name: "Night Owl Light".into(), - appearance: Appearance::Light, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0xd9d9d9ff).into()), - border_variant: Some(rgba(0xd9d9d9ff).into()), - border_focused: Some(rgba(0x93a1a1ff).into()), - border_selected: Some(rgba(0xd9d9d9ff).into()), - border_transparent: Some(rgba(0xd9d9d9ff).into()), - border_disabled: Some(rgba(0xd9d9d9ff).into()), - elevated_surface_background: Some(rgba(0xf0f0f0ff).into()), - surface_background: Some(rgba(0xf0f0f0ff).into()), - background: Some(rgba(0xfbfbfbff).into()), - element_background: Some(rgba(0x29a298ff).into()), - element_hover: Some(rgba(0xd3e7f8ff).into()), - element_selected: Some(rgba(0xd3e7f8ff).into()), - ghost_element_hover: Some(rgba(0xd3e7f8ff).into()), - text: Some(rgba(0x403f53ff).into()), - tab_inactive_background: Some(rgba(0xf0f0f0ff).into()), - tab_active_background: Some(rgba(0xf6f6f6ff).into()), - editor_background: Some(rgba(0xfbfbfbff).into()), - editor_gutter_background: Some(rgba(0xfbfbfbff).into()), - editor_line_number: Some(rgba(0x90a7b2ff).into()), - editor_active_line_number: Some(rgba(0x403f53ff).into()), - terminal_background: Some(rgba(0xf6f6f6ff).into()), - terminal_ansi_bright_black: Some(rgba(0x403f53ff).into()), - terminal_ansi_bright_red: Some(rgba(0xde3c3aff).into()), - terminal_ansi_bright_green: Some(rgba(0x07916aff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xdaa900ff).into()), - terminal_ansi_bright_blue: Some(rgba(0x278dd7ff).into()), - terminal_ansi_bright_magenta: Some(rgba(0xd64289ff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x29a298ff).into()), - terminal_ansi_bright_white: Some(rgba(0xf0f0f0ff).into()), - terminal_ansi_black: Some(rgba(0x403f53ff).into()), - terminal_ansi_red: Some(rgba(0xde3c3aff).into()), - terminal_ansi_green: Some(rgba(0x07916aff).into()), - terminal_ansi_yellow: Some(rgba(0xe0ae01ff).into()), - terminal_ansi_blue: Some(rgba(0x278dd7ff).into()), - terminal_ansi_magenta: Some(rgba(0xd64289ff).into()), - terminal_ansi_cyan: Some(rgba(0x29a298ff).into()), - terminal_ansi_white: Some(rgba(0xf0f0f0ff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0x403f53ff).into()), - error: Some(rgba(0x403f53ff).into()), - hidden: Some(rgba(0x403f53ff).into()), - warning: Some(rgba(0xdaa900ff).into()), - ..Default::default() - }, - }, - }, - ], - } + use crate::{ + Appearance, ThemeColorsRefinement, StatusColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + }; + + pub fn night_owl() -> UserThemeFamily { + UserThemeFamily { + name: "Night Owl".into(), + author: "Sarah Drasner (sdras)".into(), + themes: vec![UserTheme { name: "Night Owl".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x5f7e97ff).into()),border_variant: Some(rgba(0x5f7e97ff).into()),border_focused: Some(rgba(0x122d42ff).into()),border_selected: Some(rgba(0x5f7e97ff).into()),border_transparent: Some(rgba(0x5f7e97ff).into()),border_disabled: Some(rgba(0x5f7e97ff).into()),elevated_surface_background: Some(rgba(0x011526ff).into()),surface_background: Some(rgba(0x011526ff).into()),background: Some(rgba(0x011526ff).into()),element_background: Some(rgba(0x7d56c1cc).into()),element_hover: Some(rgba(0x011526ff).into()),element_selected: Some(rgba(0x234c708c).into()),drop_target_background: Some(rgba(0x011526ff).into()),ghost_element_hover: Some(rgba(0x011526ff).into()),text: Some(rgba(0xd6deebff).into()),tab_inactive_background: Some(rgba(0x01101cff).into()),tab_active_background: Some(rgba(0x0a2842ff).into()),editor_background: Some(rgba(0x011526ff).into()),editor_gutter_background: Some(rgba(0x011526ff).into()),editor_line_number: Some(rgba(0x4b6479ff).into()),editor_active_line_number: Some(rgba(0xd6deebff).into()),terminal_ansi_bright_black: Some(rgba(0x575656ff).into()),terminal_ansi_bright_red: Some(rgba(0xef524fff).into()),terminal_ansi_bright_green: Some(rgba(0x21da6eff).into()),terminal_ansi_bright_yellow: Some(rgba(0xffeb95ff).into()),terminal_ansi_bright_blue: Some(rgba(0x82aaffff).into()),terminal_ansi_bright_magenta: Some(rgba(0xc792eaff).into()),terminal_ansi_bright_cyan: Some(rgba(0x7fdbcaff).into()),terminal_ansi_bright_white: Some(rgba(0xffffffff).into()),terminal_ansi_black: Some(rgba(0x011526ff).into()),terminal_ansi_red: Some(rgba(0xef524fff).into()),terminal_ansi_green: Some(rgba(0x21da6eff).into()),terminal_ansi_yellow: Some(rgba(0xc5e478ff).into()),terminal_ansi_blue: Some(rgba(0x82aaffff).into()),terminal_ansi_magenta: Some(rgba(0xc792eaff).into()),terminal_ansi_cyan: Some(rgba(0x20c7a7ff).into()),terminal_ansi_white: Some(rgba(0xffffffff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xef524fff).into()),error: Some(rgba(0xef524fff).into()),hidden: Some(rgba(0x5f7e97ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x637777ff).into()), ("something".into(), rgba(0xecc48dff).into()), ("something".into(), rgba(0xc5e478ff).into()), ("punctuation".into(), rgba(0xc792eaff).into()), ("something".into(), rgba(0xc792eaff).into()), ("punctuation".into(), rgba(0x7fdbcaff).into()), ("punctuation".into(), rgba(0xd3413dff).into()), ("something".into(), rgba(0xc792eaff).into()), ("something".into(), rgba(0xc5e478ff).into()), ("something".into(), rgba(0x687097ff).into()), ("something".into(), rgba(0x7fcac3ff).into())] }) } }, UserTheme { name: "Night Owl Light".into(), appearance: Appearance::Light, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0xd9d9d9ff).into()),border_variant: Some(rgba(0xd9d9d9ff).into()),border_focused: Some(rgba(0x93a1a1ff).into()),border_selected: Some(rgba(0xd9d9d9ff).into()),border_transparent: Some(rgba(0xd9d9d9ff).into()),border_disabled: Some(rgba(0xd9d9d9ff).into()),elevated_surface_background: Some(rgba(0xf0f0f0ff).into()),surface_background: Some(rgba(0xf0f0f0ff).into()),background: Some(rgba(0xfbfbfbff).into()),element_background: Some(rgba(0x29a298ff).into()),element_hover: Some(rgba(0xd3e7f8ff).into()),element_selected: Some(rgba(0xd3e7f8ff).into()),ghost_element_hover: Some(rgba(0xd3e7f8ff).into()),text: Some(rgba(0x403f53ff).into()),tab_inactive_background: Some(rgba(0xf0f0f0ff).into()),tab_active_background: Some(rgba(0xf6f6f6ff).into()),editor_background: Some(rgba(0xfbfbfbff).into()),editor_gutter_background: Some(rgba(0xfbfbfbff).into()),editor_line_number: Some(rgba(0x90a7b2ff).into()),editor_active_line_number: Some(rgba(0x403f53ff).into()),terminal_background: Some(rgba(0xf6f6f6ff).into()),terminal_ansi_bright_black: Some(rgba(0x403f53ff).into()),terminal_ansi_bright_red: Some(rgba(0xde3c3aff).into()),terminal_ansi_bright_green: Some(rgba(0x07916aff).into()),terminal_ansi_bright_yellow: Some(rgba(0xdaa900ff).into()),terminal_ansi_bright_blue: Some(rgba(0x278dd7ff).into()),terminal_ansi_bright_magenta: Some(rgba(0xd64289ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x29a298ff).into()),terminal_ansi_bright_white: Some(rgba(0xf0f0f0ff).into()),terminal_ansi_black: Some(rgba(0x403f53ff).into()),terminal_ansi_red: Some(rgba(0xde3c3aff).into()),terminal_ansi_green: Some(rgba(0x07916aff).into()),terminal_ansi_yellow: Some(rgba(0xe0ae01ff).into()),terminal_ansi_blue: Some(rgba(0x278dd7ff).into()),terminal_ansi_magenta: Some(rgba(0xd64289ff).into()),terminal_ansi_cyan: Some(rgba(0x29a298ff).into()),terminal_ansi_white: Some(rgba(0xf0f0f0ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0x403f53ff).into()),error: Some(rgba(0x403f53ff).into()),hidden: Some(rgba(0x403f53ff).into()),warning: Some(rgba(0xdaa900ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x989fb1ff).into()), ("something".into(), rgba(0x4876d6ff).into()), ("something".into(), rgba(0x4876d6ff).into()), ("punctuation".into(), rgba(0x994bc3ff).into()), ("something".into(), rgba(0x994bc3ff).into()), ("punctuation".into(), rgba(0x994bc3ff).into()), ("punctuation".into(), rgba(0xd3413dff).into()), ("something".into(), rgba(0x994bc3ff).into()), ("something".into(), rgba(0x4876d6ff).into()), ("something".into(), rgba(0x687097ff).into()), ("something".into(), rgba(0x0b969bff).into())] }) } }], } + } + \ No newline at end of file diff --git a/crates/theme2/src/themes/nord.rs b/crates/theme2/src/themes/nord.rs index 11335476dd61ebf3972c40e7a20855c65f3adc23..2bbdab069db5a819dc75150d55aa46cfc0e2f9ea 100644 --- a/crates/theme2/src/themes/nord.rs +++ b/crates/theme2/src/themes/nord.rs @@ -1,70 +1,18 @@ -// This file was generated by the `theme_importer`. -// Be careful when modifying it by hand. -use gpui::rgba; + // This file was generated by the `theme_importer`. + // Be careful when modifying it by hand. -use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, - UserThemeStylesRefinement, -}; + use gpui::rgba; -pub fn nord() -> UserThemeFamily { - UserThemeFamily { - name: "Nord".into(), - author: "Sven Greb (svengreb)".into(), - themes: vec![UserTheme { - name: "Nord".into(), - appearance: Appearance::Dark, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0x3b4252ff).into()), - border_variant: Some(rgba(0x3b4252ff).into()), - border_focused: Some(rgba(0x3b4252ff).into()), - border_selected: Some(rgba(0x3b4252ff).into()), - border_transparent: Some(rgba(0x3b4252ff).into()), - border_disabled: Some(rgba(0x3b4252ff).into()), - elevated_surface_background: Some(rgba(0x2e3440ff).into()), - surface_background: Some(rgba(0x2e3440ff).into()), - background: Some(rgba(0x2e3440ff).into()), - element_background: Some(rgba(0x88bfd0ee).into()), - element_hover: Some(rgba(0x3b4252ff).into()), - element_selected: Some(rgba(0x88bfd0ff).into()), - drop_target_background: Some(rgba(0x88bfd099).into()), - ghost_element_hover: Some(rgba(0x3b4252ff).into()), - text: Some(rgba(0xd8dee9ff).into()), - tab_inactive_background: Some(rgba(0x2e3440ff).into()), - tab_active_background: Some(rgba(0x3b4252ff).into()), - editor_background: Some(rgba(0x2e3440ff).into()), - editor_gutter_background: Some(rgba(0x2e3440ff).into()), - editor_line_number: Some(rgba(0x4c566aff).into()), - editor_active_line_number: Some(rgba(0xd8dee9ff).into()), - terminal_background: Some(rgba(0x2e3440ff).into()), - terminal_ansi_bright_black: Some(rgba(0x4c566aff).into()), - terminal_ansi_bright_red: Some(rgba(0xbf616aff).into()), - terminal_ansi_bright_green: Some(rgba(0xa3be8cff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xebcb8bff).into()), - terminal_ansi_bright_blue: Some(rgba(0x81a1c1ff).into()), - terminal_ansi_bright_magenta: Some(rgba(0xb48eacff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x8fbcbbff).into()), - terminal_ansi_bright_white: Some(rgba(0xeceff4ff).into()), - terminal_ansi_black: Some(rgba(0x3b4252ff).into()), - terminal_ansi_red: Some(rgba(0xbf616aff).into()), - terminal_ansi_green: Some(rgba(0xa3be8cff).into()), - terminal_ansi_yellow: Some(rgba(0xebcb8bff).into()), - terminal_ansi_blue: Some(rgba(0x81a1c1ff).into()), - terminal_ansi_magenta: Some(rgba(0xb48eacff).into()), - terminal_ansi_cyan: Some(rgba(0x88bfd0ff).into()), - terminal_ansi_white: Some(rgba(0xe5e9f0ff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xbf616aff).into()), - error: Some(rgba(0xbf616aff).into()), - hidden: Some(rgba(0xd8dee966).into()), - warning: Some(rgba(0xebcb8bff).into()), - ..Default::default() - }, - }, - }], - } + use crate::{ + Appearance, ThemeColorsRefinement, StatusColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + }; + + pub fn nord() -> UserThemeFamily { + UserThemeFamily { + name: "Nord".into(), + author: "Sven Greb (svengreb)".into(), + themes: vec![UserTheme { name: "Nord".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x3b4252ff).into()),border_variant: Some(rgba(0x3b4252ff).into()),border_focused: Some(rgba(0x3b4252ff).into()),border_selected: Some(rgba(0x3b4252ff).into()),border_transparent: Some(rgba(0x3b4252ff).into()),border_disabled: Some(rgba(0x3b4252ff).into()),elevated_surface_background: Some(rgba(0x2e3440ff).into()),surface_background: Some(rgba(0x2e3440ff).into()),background: Some(rgba(0x2e3440ff).into()),element_background: Some(rgba(0x88bfd0ee).into()),element_hover: Some(rgba(0x3b4252ff).into()),element_selected: Some(rgba(0x88bfd0ff).into()),drop_target_background: Some(rgba(0x88bfd099).into()),ghost_element_hover: Some(rgba(0x3b4252ff).into()),text: Some(rgba(0xd8dee9ff).into()),tab_inactive_background: Some(rgba(0x2e3440ff).into()),tab_active_background: Some(rgba(0x3b4252ff).into()),editor_background: Some(rgba(0x2e3440ff).into()),editor_gutter_background: Some(rgba(0x2e3440ff).into()),editor_line_number: Some(rgba(0x4c566aff).into()),editor_active_line_number: Some(rgba(0xd8dee9ff).into()),terminal_background: Some(rgba(0x2e3440ff).into()),terminal_ansi_bright_black: Some(rgba(0x4c566aff).into()),terminal_ansi_bright_red: Some(rgba(0xbf616aff).into()),terminal_ansi_bright_green: Some(rgba(0xa3be8cff).into()),terminal_ansi_bright_yellow: Some(rgba(0xebcb8bff).into()),terminal_ansi_bright_blue: Some(rgba(0x81a1c1ff).into()),terminal_ansi_bright_magenta: Some(rgba(0xb48eacff).into()),terminal_ansi_bright_cyan: Some(rgba(0x8fbcbbff).into()),terminal_ansi_bright_white: Some(rgba(0xeceff4ff).into()),terminal_ansi_black: Some(rgba(0x3b4252ff).into()),terminal_ansi_red: Some(rgba(0xbf616aff).into()),terminal_ansi_green: Some(rgba(0xa3be8cff).into()),terminal_ansi_yellow: Some(rgba(0xebcb8bff).into()),terminal_ansi_blue: Some(rgba(0x81a1c1ff).into()),terminal_ansi_magenta: Some(rgba(0xb48eacff).into()),terminal_ansi_cyan: Some(rgba(0x88bfd0ff).into()),terminal_ansi_white: Some(rgba(0xe5e9f0ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xbf616aff).into()),error: Some(rgba(0xbf616aff).into()),hidden: Some(rgba(0xd8dee966).into()),warning: Some(rgba(0xebcb8bff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x606e87ff).into()), ("punctuation".into(), rgba(0xeceff4ff).into()), ("punctuation".into(), rgba(0x81a1c1ff).into()), ("punctuation".into(), rgba(0xeceff4ff).into()), ("punctuation".into(), rgba(0x81a1c1ff).into()), ("punctuation".into(), rgba(0x81a1c1ff).into()), ("punctuation".into(), rgba(0x81a1c1ff).into()), ("something".into(), rgba(0x81a1c1ff).into()), ("something".into(), rgba(0xa3be8cff).into())] }) } }], } + } + \ No newline at end of file diff --git a/crates/theme2/src/themes/notctis.rs b/crates/theme2/src/themes/notctis.rs index e590615cfd650e87fd40af2a2f0fb2af7b341c14..8ac36cad64b7e618bdcd93f7da18acd43289631e 100644 --- a/crates/theme2/src/themes/notctis.rs +++ b/crates/theme2/src/themes/notctis.rs @@ -1,612 +1,18 @@ -// This file was generated by the `theme_importer`. -// Be careful when modifying it by hand. -use gpui::rgba; + // This file was generated by the `theme_importer`. + // Be careful when modifying it by hand. -use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, - UserThemeStylesRefinement, -}; + use gpui::rgba; -pub fn notctis() -> UserThemeFamily { - UserThemeFamily { - name: "Notctis".into(), - author: "Liviu Schera (liviuschera)".into(), - themes: vec![ - UserTheme { - name: "Noctis Azureus".into(), - appearance: Appearance::Dark, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0x1579b6ff).into()), - border_variant: Some(rgba(0x1579b6ff).into()), - border_focused: Some(rgba(0x08324eff).into()), - border_selected: Some(rgba(0x1579b6ff).into()), - border_transparent: Some(rgba(0x1579b6ff).into()), - border_disabled: Some(rgba(0x1579b6ff).into()), - elevated_surface_background: Some(rgba(0x051b28ff).into()), - surface_background: Some(rgba(0x051b28ff).into()), - background: Some(rgba(0x07263aff).into()), - element_background: Some(rgba(0x007e99ff).into()), - element_hover: Some(rgba(0x00558a65).into()), - element_selected: Some(rgba(0x0b3f5fff).into()), - drop_target_background: Some(rgba(0x00294dff).into()), - ghost_element_hover: Some(rgba(0x00558a65).into()), - text: Some(rgba(0xbecfdaff).into()), - tab_inactive_background: Some(rgba(0x08324eff).into()), - tab_active_background: Some(rgba(0x07263aff).into()), - editor_background: Some(rgba(0x07263aff).into()), - editor_gutter_background: Some(rgba(0x07263aff).into()), - editor_line_number: Some(rgba(0x4c6b7fff).into()), - editor_active_line_number: Some(rgba(0xbecfdaff).into()), - terminal_background: Some(rgba(0x051b28ff).into()), - terminal_ansi_bright_black: Some(rgba(0x475e6cff).into()), - terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()), - terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()), - terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()), - terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()), - terminal_ansi_bright_white: Some(rgba(0xbecfdaff).into()), - terminal_ansi_black: Some(rgba(0x28343dff).into()), - terminal_ansi_red: Some(rgba(0xe66432ff).into()), - terminal_ansi_green: Some(rgba(0x49e9a6ff).into()), - terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()), - terminal_ansi_blue: Some(rgba(0x49ace9ff).into()), - terminal_ansi_magenta: Some(rgba(0xdf759aff).into()), - terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()), - terminal_ansi_white: Some(rgba(0xaec3d0ff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xe34d1bff).into()), - error: Some(rgba(0xe34d1bff).into()), - hidden: Some(rgba(0x9fb6c6ff).into()), - warning: Some(rgba(0xffa857ff).into()), - ..Default::default() - }, - }, - }, - UserTheme { - name: "Noctis Bordo".into(), - appearance: Appearance::Dark, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0x997582ff).into()), - border_variant: Some(rgba(0x997582ff).into()), - border_focused: Some(rgba(0x413036ff).into()), - border_selected: Some(rgba(0x997582ff).into()), - border_transparent: Some(rgba(0x997582ff).into()), - border_disabled: Some(rgba(0x997582ff).into()), - elevated_surface_background: Some(rgba(0x272022ff).into()), - surface_background: Some(rgba(0x272022ff).into()), - background: Some(rgba(0x322a2dff).into()), - element_background: Some(rgba(0x007e99ff).into()), - element_hover: Some(rgba(0x533641ff).into()), - element_selected: Some(rgba(0x5c2e3e99).into()), - drop_target_background: Some(rgba(0x38292eff).into()), - ghost_element_hover: Some(rgba(0x533641ff).into()), - text: Some(rgba(0xcbbec2ff).into()), - tab_inactive_background: Some(rgba(0x413036ff).into()), - tab_active_background: Some(rgba(0x322a2dff).into()), - editor_background: Some(rgba(0x322a2dff).into()), - editor_gutter_background: Some(rgba(0x322a2dff).into()), - editor_line_number: Some(rgba(0x715b63ff).into()), - editor_active_line_number: Some(rgba(0xcbbec2ff).into()), - terminal_background: Some(rgba(0x272022ff).into()), - terminal_ansi_bright_black: Some(rgba(0x69545bff).into()), - terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()), - terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()), - terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()), - terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()), - terminal_ansi_bright_white: Some(rgba(0xcbbec2ff).into()), - terminal_ansi_black: Some(rgba(0x47393eff).into()), - terminal_ansi_red: Some(rgba(0xe66432ff).into()), - terminal_ansi_green: Some(rgba(0x49e9a6ff).into()), - terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()), - terminal_ansi_blue: Some(rgba(0x49ace9ff).into()), - terminal_ansi_magenta: Some(rgba(0xdf759aff).into()), - terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()), - terminal_ansi_white: Some(rgba(0xb9acb0ff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xe34d1bff).into()), - error: Some(rgba(0xe34d1bff).into()), - hidden: Some(rgba(0xbbaab0ff).into()), - warning: Some(rgba(0xffa857ff).into()), - ..Default::default() - }, - }, - }, - UserTheme { - name: "Noctus Hibernus".into(), - appearance: Appearance::Light, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0x00c6e0ff).into()), - border_variant: Some(rgba(0x00c6e0ff).into()), - border_focused: Some(rgba(0xe0eff1ff).into()), - border_selected: Some(rgba(0x00c6e0ff).into()), - border_transparent: Some(rgba(0x00c6e0ff).into()), - border_disabled: Some(rgba(0x00c6e0ff).into()), - elevated_surface_background: Some(rgba(0xe1eeefff).into()), - surface_background: Some(rgba(0xe1eeefff).into()), - background: Some(rgba(0xf4f6f6ff).into()), - element_background: Some(rgba(0x089099ff).into()), - element_hover: Some(rgba(0xd1eafaff).into()), - element_selected: Some(rgba(0xb6e1e7ff).into()), - drop_target_background: Some(rgba(0xb1c9ccff).into()), - ghost_element_hover: Some(rgba(0xd1eafaff).into()), - text: Some(rgba(0x005661ff).into()), - tab_inactive_background: Some(rgba(0xcaedf2ff).into()), - tab_active_background: Some(rgba(0xf4f6f6ff).into()), - editor_background: Some(rgba(0xf4f6f6ff).into()), - editor_gutter_background: Some(rgba(0xf4f6f6ff).into()), - editor_line_number: Some(rgba(0xa0abacff).into()), - editor_active_line_number: Some(rgba(0x005661ff).into()), - terminal_background: Some(rgba(0xe1eeefff).into()), - terminal_ansi_bright_black: Some(rgba(0x004d57ff).into()), - terminal_ansi_bright_red: Some(rgba(0xff3f00ff).into()), - terminal_ansi_bright_green: Some(rgba(0x00d17aff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xff8c00ff).into()), - terminal_ansi_bright_blue: Some(rgba(0x0ea3ffff).into()), - terminal_ansi_bright_magenta: Some(rgba(0xff6b9eff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x00cae6ff).into()), - terminal_ansi_bright_white: Some(rgba(0xbbc3c4ff).into()), - terminal_ansi_black: Some(rgba(0x003b41ff).into()), - terminal_ansi_red: Some(rgba(0xe34d1bff).into()), - terminal_ansi_green: Some(rgba(0x00b368ff).into()), - terminal_ansi_yellow: Some(rgba(0xf49724ff).into()), - terminal_ansi_blue: Some(rgba(0x0094f0ff).into()), - terminal_ansi_magenta: Some(rgba(0xff5792ff).into()), - terminal_ansi_cyan: Some(rgba(0x00bdd6ff).into()), - terminal_ansi_white: Some(rgba(0x8ca6a6ff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xff3f00ff).into()), - error: Some(rgba(0xff3f00ff).into()), - hidden: Some(rgba(0x70838dff).into()), - warning: Some(rgba(0xe07a52ff).into()), - ..Default::default() - }, - }, - }, - UserTheme { - name: "Noctis Lilac".into(), - appearance: Appearance::Dark, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0xaea4f4ff).into()), - border_variant: Some(rgba(0xaea4f4ff).into()), - border_focused: Some(rgba(0xdedbf5ff).into()), - border_selected: Some(rgba(0xaea4f4ff).into()), - border_transparent: Some(rgba(0xaea4f4ff).into()), - border_disabled: Some(rgba(0xaea4f4ff).into()), - elevated_surface_background: Some(rgba(0xe9e7f3ff).into()), - surface_background: Some(rgba(0xe9e7f3ff).into()), - background: Some(rgba(0xf2f1f8ff).into()), - element_background: Some(rgba(0x8d7ffeff).into()), - element_hover: Some(rgba(0xd1cbfeff).into()), - element_selected: Some(rgba(0xbcb6e7ff).into()), - drop_target_background: Some(rgba(0xafaad4aa).into()), - ghost_element_hover: Some(rgba(0xd1cbfeff).into()), - text: Some(rgba(0x0c006bff).into()), - tab_inactive_background: Some(rgba(0xe2dff6ff).into()), - tab_active_background: Some(rgba(0xf2f1f8ff).into()), - editor_background: Some(rgba(0xf2f1f8ff).into()), - editor_gutter_background: Some(rgba(0xf2f1f8ff).into()), - editor_line_number: Some(rgba(0x9c99b0ff).into()), - editor_active_line_number: Some(rgba(0x0c006bff).into()), - terminal_background: Some(rgba(0xe9e7f3ff).into()), - terminal_ansi_bright_black: Some(rgba(0x0f0080ff).into()), - terminal_ansi_bright_red: Some(rgba(0xff3f00ff).into()), - terminal_ansi_bright_green: Some(rgba(0x00d17aff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xff8c00ff).into()), - terminal_ansi_bright_blue: Some(rgba(0x0ea3ffff).into()), - terminal_ansi_bright_magenta: Some(rgba(0xff6b9eff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x00cae6ff).into()), - terminal_ansi_bright_white: Some(rgba(0xbbc3c4ff).into()), - terminal_ansi_black: Some(rgba(0x0c006bff).into()), - terminal_ansi_red: Some(rgba(0xe34d1bff).into()), - terminal_ansi_green: Some(rgba(0x00b368ff).into()), - terminal_ansi_yellow: Some(rgba(0xf49724ff).into()), - terminal_ansi_blue: Some(rgba(0x0094f0ff).into()), - terminal_ansi_magenta: Some(rgba(0xff5792ff).into()), - terminal_ansi_cyan: Some(rgba(0x00bdd6ff).into()), - terminal_ansi_white: Some(rgba(0x8ca6a6ff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xff3f00ff).into()), - error: Some(rgba(0xff3f00ff).into()), - hidden: Some(rgba(0x74708dff).into()), - warning: Some(rgba(0xe07a52ff).into()), - ..Default::default() - }, - }, - }, - UserTheme { - name: "Noctis Lux".into(), - appearance: Appearance::Light, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0x00c6e0ff).into()), - border_variant: Some(rgba(0x00c6e0ff).into()), - border_focused: Some(rgba(0xf2eddeff).into()), - border_selected: Some(rgba(0x00c6e0ff).into()), - border_transparent: Some(rgba(0x00c6e0ff).into()), - border_disabled: Some(rgba(0x00c6e0ff).into()), - elevated_surface_background: Some(rgba(0xf6eddaff).into()), - surface_background: Some(rgba(0xf6eddaff).into()), - background: Some(rgba(0xfef8ecff).into()), - element_background: Some(rgba(0x089099ff).into()), - element_hover: Some(rgba(0xd1f2f8ff).into()), - element_selected: Some(rgba(0xb6e1e7ff).into()), - drop_target_background: Some(rgba(0xcccab1ff).into()), - ghost_element_hover: Some(rgba(0xd1f2f8ff).into()), - text: Some(rgba(0x005661ff).into()), - tab_inactive_background: Some(rgba(0xf0e9d6ff).into()), - tab_active_background: Some(rgba(0xfef8ecff).into()), - editor_background: Some(rgba(0xfef8ecff).into()), - editor_gutter_background: Some(rgba(0xfef8ecff).into()), - editor_line_number: Some(rgba(0xa0abacff).into()), - editor_active_line_number: Some(rgba(0x005661ff).into()), - terminal_background: Some(rgba(0xf6eddaff).into()), - terminal_ansi_bright_black: Some(rgba(0x004d57ff).into()), - terminal_ansi_bright_red: Some(rgba(0xff3f00ff).into()), - terminal_ansi_bright_green: Some(rgba(0x00d17aff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xff8c00ff).into()), - terminal_ansi_bright_blue: Some(rgba(0x0ea3ffff).into()), - terminal_ansi_bright_magenta: Some(rgba(0xff6b9eff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x00cae6ff).into()), - terminal_ansi_bright_white: Some(rgba(0xbbc3c4ff).into()), - terminal_ansi_black: Some(rgba(0x003b41ff).into()), - terminal_ansi_red: Some(rgba(0xe34d1bff).into()), - terminal_ansi_green: Some(rgba(0x00b368ff).into()), - terminal_ansi_yellow: Some(rgba(0xf49724ff).into()), - terminal_ansi_blue: Some(rgba(0x0094f0ff).into()), - terminal_ansi_magenta: Some(rgba(0xff5792ff).into()), - terminal_ansi_cyan: Some(rgba(0x00bdd6ff).into()), - terminal_ansi_white: Some(rgba(0x8ca6a6ff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xff3f00ff).into()), - error: Some(rgba(0xff3f00ff).into()), - hidden: Some(rgba(0x878476ff).into()), - warning: Some(rgba(0xe07a52ff).into()), - ..Default::default() - }, - }, - }, - UserTheme { - name: "Noctis Minimus".into(), - appearance: Appearance::Dark, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0x496c83ff).into()), - border_variant: Some(rgba(0x496c83ff).into()), - border_focused: Some(rgba(0x202d37ff).into()), - border_selected: Some(rgba(0x496c83ff).into()), - border_transparent: Some(rgba(0x496c83ff).into()), - border_disabled: Some(rgba(0x496c83ff).into()), - elevated_surface_background: Some(rgba(0x0e1920ff).into()), - surface_background: Some(rgba(0x0e1920ff).into()), - background: Some(rgba(0x1b2932ff).into()), - element_background: Some(rgba(0x2e616bff).into()), - element_hover: Some(rgba(0x00558aff).into()), - element_selected: Some(rgba(0x2c414eff).into()), - drop_target_background: Some(rgba(0x152836ff).into()), - ghost_element_hover: Some(rgba(0x00558aff).into()), - text: Some(rgba(0xc5cdd3ff).into()), - tab_inactive_background: Some(rgba(0x202d37ff).into()), - tab_active_background: Some(rgba(0x1b2932ff).into()), - editor_background: Some(rgba(0x1b2932ff).into()), - editor_gutter_background: Some(rgba(0x1b2932ff).into()), - editor_line_number: Some(rgba(0x5d6e79ff).into()), - editor_active_line_number: Some(rgba(0xc5cdd3ff).into()), - terminal_background: Some(rgba(0x0e1920ff).into()), - terminal_ansi_bright_black: Some(rgba(0x425866ff).into()), - terminal_ansi_bright_red: Some(rgba(0xca8468ff).into()), - terminal_ansi_bright_green: Some(rgba(0x84c8abff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xd1aa7bff).into()), - terminal_ansi_bright_blue: Some(rgba(0x68a4caff).into()), - terminal_ansi_bright_magenta: Some(rgba(0xc88da2ff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x84bfc8ff).into()), - terminal_ansi_bright_white: Some(rgba(0xc5d1d3ff).into()), - terminal_ansi_black: Some(rgba(0x182935ff).into()), - terminal_ansi_red: Some(rgba(0xc08872ff).into()), - terminal_ansi_green: Some(rgba(0x72c09fff).into()), - terminal_ansi_yellow: Some(rgba(0xc8a984ff).into()), - terminal_ansi_blue: Some(rgba(0x6095b7ff).into()), - terminal_ansi_magenta: Some(rgba(0xc28097ff).into()), - terminal_ansi_cyan: Some(rgba(0x72b7c0ff).into()), - terminal_ansi_white: Some(rgba(0xc5cdd3ff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xb96245ff).into()), - error: Some(rgba(0xb96245ff).into()), - hidden: Some(rgba(0x96a8b6ff).into()), - warning: Some(rgba(0xffa857ff).into()), - ..Default::default() - }, - }, - }, - UserTheme { - name: "Noctis".into(), - appearance: Appearance::Dark, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0x0d6571ff).into()), - border_variant: Some(rgba(0x0d6571ff).into()), - border_focused: Some(rgba(0x063940ff).into()), - border_selected: Some(rgba(0x0d6571ff).into()), - border_transparent: Some(rgba(0x0d6571ff).into()), - border_disabled: Some(rgba(0x0d6571ff).into()), - elevated_surface_background: Some(rgba(0x03181aff).into()), - surface_background: Some(rgba(0x03181aff).into()), - background: Some(rgba(0x052428ff).into()), - element_background: Some(rgba(0x089099ff).into()), - element_hover: Some(rgba(0x0b505aff).into()), - element_selected: Some(rgba(0x0d6571ff).into()), - drop_target_background: Some(rgba(0x00404dff).into()), - ghost_element_hover: Some(rgba(0x0b505aff).into()), - text: Some(rgba(0xb1c9ccff).into()), - tab_inactive_background: Some(rgba(0x052e32ff).into()), - tab_active_background: Some(rgba(0x052428ff).into()), - editor_background: Some(rgba(0x052428ff).into()), - editor_gutter_background: Some(rgba(0x052428ff).into()), - editor_line_number: Some(rgba(0x4e6b6eff).into()), - editor_active_line_number: Some(rgba(0xb1c9ccff).into()), - terminal_background: Some(rgba(0x03181aff).into()), - terminal_ansi_bright_black: Some(rgba(0x47686cff).into()), - terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()), - terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()), - terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()), - terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()), - terminal_ansi_bright_white: Some(rgba(0xc1d4d7ff).into()), - terminal_ansi_black: Some(rgba(0x324a4dff).into()), - terminal_ansi_red: Some(rgba(0xe66432ff).into()), - terminal_ansi_green: Some(rgba(0x49e9a6ff).into()), - terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()), - terminal_ansi_blue: Some(rgba(0x49ace9ff).into()), - terminal_ansi_magenta: Some(rgba(0xdf759aff).into()), - terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()), - terminal_ansi_white: Some(rgba(0xb1c9ccff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xe34d1bff).into()), - error: Some(rgba(0xe34d1bff).into()), - hidden: Some(rgba(0x87a7abff).into()), - warning: Some(rgba(0xffa487ff).into()), - ..Default::default() - }, - }, - }, - UserTheme { - name: "Noctis Obscuro".into(), - appearance: Appearance::Dark, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0x0d6571ff).into()), - border_variant: Some(rgba(0x0d6571ff).into()), - border_focused: Some(rgba(0x052e32ff).into()), - border_selected: Some(rgba(0x0d6571ff).into()), - border_transparent: Some(rgba(0x0d6571ff).into()), - border_disabled: Some(rgba(0x0d6571ff).into()), - elevated_surface_background: Some(rgba(0x020c0eff).into()), - surface_background: Some(rgba(0x020c0eff).into()), - background: Some(rgba(0x031316ff).into()), - element_background: Some(rgba(0x089099ff).into()), - element_hover: Some(rgba(0x0b505aff).into()), - element_selected: Some(rgba(0x0d6571ff).into()), - drop_target_background: Some(rgba(0x00404dff).into()), - ghost_element_hover: Some(rgba(0x0b505aff).into()), - text: Some(rgba(0xb1c9ccff).into()), - tab_inactive_background: Some(rgba(0x052e32ff).into()), - tab_active_background: Some(rgba(0x031316ff).into()), - editor_background: Some(rgba(0x031316ff).into()), - editor_gutter_background: Some(rgba(0x031316ff).into()), - editor_line_number: Some(rgba(0x4e6b6eff).into()), - editor_active_line_number: Some(rgba(0xb1c9ccff).into()), - terminal_background: Some(rgba(0x020c0eff).into()), - terminal_ansi_bright_black: Some(rgba(0x47686cff).into()), - terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()), - terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()), - terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()), - terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()), - terminal_ansi_bright_white: Some(rgba(0xc1d4d7ff).into()), - terminal_ansi_black: Some(rgba(0x324a4dff).into()), - terminal_ansi_red: Some(rgba(0xe66432ff).into()), - terminal_ansi_green: Some(rgba(0x49e9a6ff).into()), - terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()), - terminal_ansi_blue: Some(rgba(0x49ace9ff).into()), - terminal_ansi_magenta: Some(rgba(0xdf759aff).into()), - terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()), - terminal_ansi_white: Some(rgba(0xb1c9ccff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xe34d1bff).into()), - error: Some(rgba(0xe34d1bff).into()), - hidden: Some(rgba(0x87a7abff).into()), - warning: Some(rgba(0xffa487ff).into()), - ..Default::default() - }, - }, - }, - UserTheme { - name: "Noctis Sereno".into(), - appearance: Appearance::Dark, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0x0d6571ff).into()), - border_variant: Some(rgba(0x0d6571ff).into()), - border_focused: Some(rgba(0x052e32ff).into()), - border_selected: Some(rgba(0x0d6571ff).into()), - border_transparent: Some(rgba(0x0d6571ff).into()), - border_disabled: Some(rgba(0x0d6571ff).into()), - elevated_surface_background: Some(rgba(0x020c0eff).into()), - surface_background: Some(rgba(0x020c0eff).into()), - background: Some(rgba(0x031316ff).into()), - element_background: Some(rgba(0x089099ff).into()), - element_hover: Some(rgba(0x0b505aff).into()), - element_selected: Some(rgba(0x0d6571ff).into()), - drop_target_background: Some(rgba(0x00404dff).into()), - ghost_element_hover: Some(rgba(0x0b505aff).into()), - text: Some(rgba(0xb1c9ccff).into()), - tab_inactive_background: Some(rgba(0x052e32ff).into()), - tab_active_background: Some(rgba(0x031316ff).into()), - editor_background: Some(rgba(0x031316ff).into()), - editor_gutter_background: Some(rgba(0x031316ff).into()), - editor_line_number: Some(rgba(0x4e6b6eff).into()), - editor_active_line_number: Some(rgba(0xb1c9ccff).into()), - terminal_background: Some(rgba(0x020c0eff).into()), - terminal_ansi_bright_black: Some(rgba(0x47686cff).into()), - terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()), - terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()), - terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()), - terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()), - terminal_ansi_bright_white: Some(rgba(0xc1d4d7ff).into()), - terminal_ansi_black: Some(rgba(0x324a4dff).into()), - terminal_ansi_red: Some(rgba(0xe66432ff).into()), - terminal_ansi_green: Some(rgba(0x49e9a6ff).into()), - terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()), - terminal_ansi_blue: Some(rgba(0x49ace9ff).into()), - terminal_ansi_magenta: Some(rgba(0xdf759aff).into()), - terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()), - terminal_ansi_white: Some(rgba(0xb1c9ccff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xe34d1bff).into()), - error: Some(rgba(0xe34d1bff).into()), - hidden: Some(rgba(0x87a7abff).into()), - warning: Some(rgba(0xffa487ff).into()), - ..Default::default() - }, - }, - }, - UserTheme { - name: "Noctis Uva".into(), - appearance: Appearance::Dark, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0x6d66a7ff).into()), - border_variant: Some(rgba(0x6d66a7ff).into()), - border_focused: Some(rgba(0x2f2c49ff).into()), - border_selected: Some(rgba(0x6d66a7ff).into()), - border_transparent: Some(rgba(0x6d66a7ff).into()), - border_disabled: Some(rgba(0x6d66a7ff).into()), - elevated_surface_background: Some(rgba(0x1f1d30ff).into()), - surface_background: Some(rgba(0x1f1d30ff).into()), - background: Some(rgba(0x292640ff).into()), - element_background: Some(rgba(0x007e99ff).into()), - element_hover: Some(rgba(0x383866ff).into()), - element_selected: Some(rgba(0x322e5cff).into()), - drop_target_background: Some(rgba(0x202040ff).into()), - ghost_element_hover: Some(rgba(0x383866ff).into()), - text: Some(rgba(0xc5c2d6ff).into()), - tab_inactive_background: Some(rgba(0x2f2c49ff).into()), - tab_active_background: Some(rgba(0x292640ff).into()), - editor_background: Some(rgba(0x292640ff).into()), - editor_gutter_background: Some(rgba(0x292640ff).into()), - editor_line_number: Some(rgba(0x5c5973ff).into()), - editor_active_line_number: Some(rgba(0xc5c2d6ff).into()), - terminal_background: Some(rgba(0x1f1d30ff).into()), - terminal_ansi_bright_black: Some(rgba(0x504e65ff).into()), - terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()), - terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()), - terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()), - terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()), - terminal_ansi_bright_white: Some(rgba(0xc5c2d6ff).into()), - terminal_ansi_black: Some(rgba(0x302f3dff).into()), - terminal_ansi_red: Some(rgba(0xe66432ff).into()), - terminal_ansi_green: Some(rgba(0x49e9a6ff).into()), - terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()), - terminal_ansi_blue: Some(rgba(0x49ace9ff).into()), - terminal_ansi_magenta: Some(rgba(0xdf759aff).into()), - terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()), - terminal_ansi_white: Some(rgba(0xb6b3ccff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xe34d1bff).into()), - error: Some(rgba(0xe34d1bff).into()), - hidden: Some(rgba(0xa9a5c0ff).into()), - warning: Some(rgba(0xffa857ff).into()), - ..Default::default() - }, - }, - }, - UserTheme { - name: "Noctis Viola".into(), - appearance: Appearance::Dark, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0x8666a7ff).into()), - border_variant: Some(rgba(0x8666a7ff).into()), - border_focused: Some(rgba(0x3d2e4dff).into()), - border_selected: Some(rgba(0x8666a7ff).into()), - border_transparent: Some(rgba(0x8666a7ff).into()), - border_disabled: Some(rgba(0x8666a7ff).into()), - elevated_surface_background: Some(rgba(0x291d35ff).into()), - surface_background: Some(rgba(0x291d35ff).into()), - background: Some(rgba(0x30243dff).into()), - element_background: Some(rgba(0x007e99ff).into()), - element_hover: Some(rgba(0x69438dff).into()), - element_selected: Some(rgba(0x472e60ff).into()), - drop_target_background: Some(rgba(0x302040ff).into()), - ghost_element_hover: Some(rgba(0x69438dff).into()), - text: Some(rgba(0xccbfd9ff).into()), - tab_inactive_background: Some(rgba(0x3d2e4dff).into()), - tab_active_background: Some(rgba(0x30243dff).into()), - editor_background: Some(rgba(0x30243dff).into()), - editor_gutter_background: Some(rgba(0x30243dff).into()), - editor_line_number: Some(rgba(0x665973ff).into()), - editor_active_line_number: Some(rgba(0xccbfd9ff).into()), - terminal_background: Some(rgba(0x291d35ff).into()), - terminal_ansi_bright_black: Some(rgba(0x594e65ff).into()), - terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()), - terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()), - terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()), - terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()), - terminal_ansi_bright_white: Some(rgba(0xccbfd9ff).into()), - terminal_ansi_black: Some(rgba(0x362f3dff).into()), - terminal_ansi_red: Some(rgba(0xe66432ff).into()), - terminal_ansi_green: Some(rgba(0x49e9a6ff).into()), - terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()), - terminal_ansi_blue: Some(rgba(0x49ace9ff).into()), - terminal_ansi_magenta: Some(rgba(0xdf759aff).into()), - terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()), - terminal_ansi_white: Some(rgba(0xbfafcfff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xe34d1bff).into()), - error: Some(rgba(0xe34d1bff).into()), - hidden: Some(rgba(0xb3a5c0ff).into()), - warning: Some(rgba(0xffa857ff).into()), - ..Default::default() - }, - }, - }, - ], - } + use crate::{ + Appearance, ThemeColorsRefinement, StatusColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + }; + + pub fn notctis() -> UserThemeFamily { + UserThemeFamily { + name: "Notctis".into(), + author: "Liviu Schera (liviuschera)".into(), + themes: vec![UserTheme { name: "Noctis Azureus".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x1579b6ff).into()),border_variant: Some(rgba(0x1579b6ff).into()),border_focused: Some(rgba(0x08324eff).into()),border_selected: Some(rgba(0x1579b6ff).into()),border_transparent: Some(rgba(0x1579b6ff).into()),border_disabled: Some(rgba(0x1579b6ff).into()),elevated_surface_background: Some(rgba(0x051b28ff).into()),surface_background: Some(rgba(0x051b28ff).into()),background: Some(rgba(0x07263aff).into()),element_background: Some(rgba(0x007e99ff).into()),element_hover: Some(rgba(0x00558a65).into()),element_selected: Some(rgba(0x0b3f5fff).into()),drop_target_background: Some(rgba(0x00294dff).into()),ghost_element_hover: Some(rgba(0x00558a65).into()),text: Some(rgba(0xbecfdaff).into()),tab_inactive_background: Some(rgba(0x08324eff).into()),tab_active_background: Some(rgba(0x07263aff).into()),editor_background: Some(rgba(0x07263aff).into()),editor_gutter_background: Some(rgba(0x07263aff).into()),editor_line_number: Some(rgba(0x4c6b7fff).into()),editor_active_line_number: Some(rgba(0xbecfdaff).into()),terminal_background: Some(rgba(0x051b28ff).into()),terminal_ansi_bright_black: Some(rgba(0x475e6cff).into()),terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()),terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()),terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()),terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()),terminal_ansi_bright_white: Some(rgba(0xbecfdaff).into()),terminal_ansi_black: Some(rgba(0x28343dff).into()),terminal_ansi_red: Some(rgba(0xe66432ff).into()),terminal_ansi_green: Some(rgba(0x49e9a6ff).into()),terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()),terminal_ansi_blue: Some(rgba(0x49ace9ff).into()),terminal_ansi_magenta: Some(rgba(0xdf759aff).into()),terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()),terminal_ansi_white: Some(rgba(0xaec3d0ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xe34d1bff).into()),error: Some(rgba(0xe34d1bff).into()),hidden: Some(rgba(0x9fb6c6ff).into()),warning: Some(rgba(0xffa857ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x5888a5ff).into()), ("punctuation".into(), rgba(0x5888a5ff).into()), ("punctuation".into(), rgba(0xbecfdaff).into()), ("punctuation".into(), rgba(0xbecfdaff).into()), ("punctuation".into(), rgba(0xdf759aff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("punctuation".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xd59719ff).into()), ("something".into(), rgba(0x49e9a6ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into())] }) } }, UserTheme { name: "Noctis Bordo".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x997582ff).into()),border_variant: Some(rgba(0x997582ff).into()),border_focused: Some(rgba(0x413036ff).into()),border_selected: Some(rgba(0x997582ff).into()),border_transparent: Some(rgba(0x997582ff).into()),border_disabled: Some(rgba(0x997582ff).into()),elevated_surface_background: Some(rgba(0x272022ff).into()),surface_background: Some(rgba(0x272022ff).into()),background: Some(rgba(0x322a2dff).into()),element_background: Some(rgba(0x007e99ff).into()),element_hover: Some(rgba(0x533641ff).into()),element_selected: Some(rgba(0x5c2e3e99).into()),drop_target_background: Some(rgba(0x38292eff).into()),ghost_element_hover: Some(rgba(0x533641ff).into()),text: Some(rgba(0xcbbec2ff).into()),tab_inactive_background: Some(rgba(0x413036ff).into()),tab_active_background: Some(rgba(0x322a2dff).into()),editor_background: Some(rgba(0x322a2dff).into()),editor_gutter_background: Some(rgba(0x322a2dff).into()),editor_line_number: Some(rgba(0x715b63ff).into()),editor_active_line_number: Some(rgba(0xcbbec2ff).into()),terminal_background: Some(rgba(0x272022ff).into()),terminal_ansi_bright_black: Some(rgba(0x69545bff).into()),terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()),terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()),terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()),terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()),terminal_ansi_bright_white: Some(rgba(0xcbbec2ff).into()),terminal_ansi_black: Some(rgba(0x47393eff).into()),terminal_ansi_red: Some(rgba(0xe66432ff).into()),terminal_ansi_green: Some(rgba(0x49e9a6ff).into()),terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()),terminal_ansi_blue: Some(rgba(0x49ace9ff).into()),terminal_ansi_magenta: Some(rgba(0xdf759aff).into()),terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()),terminal_ansi_white: Some(rgba(0xb9acb0ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xe34d1bff).into()),error: Some(rgba(0xe34d1bff).into()),hidden: Some(rgba(0xbbaab0ff).into()),warning: Some(rgba(0xffa857ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x8b737bff).into()), ("punctuation".into(), rgba(0x8b737bff).into()), ("punctuation".into(), rgba(0xcbbec2ff).into()), ("punctuation".into(), rgba(0xcbbec2ff).into()), ("punctuation".into(), rgba(0xdf759aff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("punctuation".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xd59719ff).into()), ("something".into(), rgba(0x49e9a6ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into())] }) } }, UserTheme { name: "Noctus Hibernus".into(), appearance: Appearance::Light, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x00c6e0ff).into()),border_variant: Some(rgba(0x00c6e0ff).into()),border_focused: Some(rgba(0xe0eff1ff).into()),border_selected: Some(rgba(0x00c6e0ff).into()),border_transparent: Some(rgba(0x00c6e0ff).into()),border_disabled: Some(rgba(0x00c6e0ff).into()),elevated_surface_background: Some(rgba(0xe1eeefff).into()),surface_background: Some(rgba(0xe1eeefff).into()),background: Some(rgba(0xf4f6f6ff).into()),element_background: Some(rgba(0x089099ff).into()),element_hover: Some(rgba(0xd1eafaff).into()),element_selected: Some(rgba(0xb6e1e7ff).into()),drop_target_background: Some(rgba(0xb1c9ccff).into()),ghost_element_hover: Some(rgba(0xd1eafaff).into()),text: Some(rgba(0x005661ff).into()),tab_inactive_background: Some(rgba(0xcaedf2ff).into()),tab_active_background: Some(rgba(0xf4f6f6ff).into()),editor_background: Some(rgba(0xf4f6f6ff).into()),editor_gutter_background: Some(rgba(0xf4f6f6ff).into()),editor_line_number: Some(rgba(0xa0abacff).into()),editor_active_line_number: Some(rgba(0x005661ff).into()),terminal_background: Some(rgba(0xe1eeefff).into()),terminal_ansi_bright_black: Some(rgba(0x004d57ff).into()),terminal_ansi_bright_red: Some(rgba(0xff3f00ff).into()),terminal_ansi_bright_green: Some(rgba(0x00d17aff).into()),terminal_ansi_bright_yellow: Some(rgba(0xff8c00ff).into()),terminal_ansi_bright_blue: Some(rgba(0x0ea3ffff).into()),terminal_ansi_bright_magenta: Some(rgba(0xff6b9eff).into()),terminal_ansi_bright_cyan: Some(rgba(0x00cae6ff).into()),terminal_ansi_bright_white: Some(rgba(0xbbc3c4ff).into()),terminal_ansi_black: Some(rgba(0x003b41ff).into()),terminal_ansi_red: Some(rgba(0xe34d1bff).into()),terminal_ansi_green: Some(rgba(0x00b368ff).into()),terminal_ansi_yellow: Some(rgba(0xf49724ff).into()),terminal_ansi_blue: Some(rgba(0x0094f0ff).into()),terminal_ansi_magenta: Some(rgba(0xff5792ff).into()),terminal_ansi_cyan: Some(rgba(0x00bdd6ff).into()),terminal_ansi_white: Some(rgba(0x8ca6a6ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xff3f00ff).into()),error: Some(rgba(0xff3f00ff).into()),hidden: Some(rgba(0x70838dff).into()),warning: Some(rgba(0xe07a52ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x8ca6a6ff).into()), ("punctuation".into(), rgba(0x8ca6a6ff).into()), ("punctuation".into(), rgba(0x004d57ff).into()), ("punctuation".into(), rgba(0x004d57ff).into()), ("punctuation".into(), rgba(0xff5792ff).into()), ("something".into(), rgba(0xfa8900ff).into()), ("something".into(), rgba(0xfa8900ff).into()), ("punctuation".into(), rgba(0xfa8900ff).into()), ("something".into(), rgba(0xa88c00ff).into()), ("something".into(), rgba(0x00b368ff).into()), ("punctuation".into(), rgba(0x0094f0ff).into()), ("punctuation".into(), rgba(0x0094f0ff).into())] }) } }, UserTheme { name: "Noctis Lilac".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0xaea4f4ff).into()),border_variant: Some(rgba(0xaea4f4ff).into()),border_focused: Some(rgba(0xdedbf5ff).into()),border_selected: Some(rgba(0xaea4f4ff).into()),border_transparent: Some(rgba(0xaea4f4ff).into()),border_disabled: Some(rgba(0xaea4f4ff).into()),elevated_surface_background: Some(rgba(0xe9e7f3ff).into()),surface_background: Some(rgba(0xe9e7f3ff).into()),background: Some(rgba(0xf2f1f8ff).into()),element_background: Some(rgba(0x8d7ffeff).into()),element_hover: Some(rgba(0xd1cbfeff).into()),element_selected: Some(rgba(0xbcb6e7ff).into()),drop_target_background: Some(rgba(0xafaad4aa).into()),ghost_element_hover: Some(rgba(0xd1cbfeff).into()),text: Some(rgba(0x0c006bff).into()),tab_inactive_background: Some(rgba(0xe2dff6ff).into()),tab_active_background: Some(rgba(0xf2f1f8ff).into()),editor_background: Some(rgba(0xf2f1f8ff).into()),editor_gutter_background: Some(rgba(0xf2f1f8ff).into()),editor_line_number: Some(rgba(0x9c99b0ff).into()),editor_active_line_number: Some(rgba(0x0c006bff).into()),terminal_background: Some(rgba(0xe9e7f3ff).into()),terminal_ansi_bright_black: Some(rgba(0x0f0080ff).into()),terminal_ansi_bright_red: Some(rgba(0xff3f00ff).into()),terminal_ansi_bright_green: Some(rgba(0x00d17aff).into()),terminal_ansi_bright_yellow: Some(rgba(0xff8c00ff).into()),terminal_ansi_bright_blue: Some(rgba(0x0ea3ffff).into()),terminal_ansi_bright_magenta: Some(rgba(0xff6b9eff).into()),terminal_ansi_bright_cyan: Some(rgba(0x00cae6ff).into()),terminal_ansi_bright_white: Some(rgba(0xbbc3c4ff).into()),terminal_ansi_black: Some(rgba(0x0c006bff).into()),terminal_ansi_red: Some(rgba(0xe34d1bff).into()),terminal_ansi_green: Some(rgba(0x00b368ff).into()),terminal_ansi_yellow: Some(rgba(0xf49724ff).into()),terminal_ansi_blue: Some(rgba(0x0094f0ff).into()),terminal_ansi_magenta: Some(rgba(0xff5792ff).into()),terminal_ansi_cyan: Some(rgba(0x00bdd6ff).into()),terminal_ansi_white: Some(rgba(0x8ca6a6ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xff3f00ff).into()),error: Some(rgba(0xff3f00ff).into()),hidden: Some(rgba(0x74708dff).into()),warning: Some(rgba(0xe07a52ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x9995b7ff).into()), ("punctuation".into(), rgba(0x9995b7ff).into()), ("punctuation".into(), rgba(0x0c006bff).into()), ("punctuation".into(), rgba(0x0c006bff).into()), ("punctuation".into(), rgba(0xff5792ff).into()), ("something".into(), rgba(0xfa8900ff).into()), ("something".into(), rgba(0xfa8900ff).into()), ("punctuation".into(), rgba(0xfa8900ff).into()), ("something".into(), rgba(0xa88c00ff).into()), ("something".into(), rgba(0x00b368ff).into()), ("punctuation".into(), rgba(0x0094f0ff).into()), ("punctuation".into(), rgba(0x0094f0ff).into())] }) } }, UserTheme { name: "Noctis Lux".into(), appearance: Appearance::Light, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x00c6e0ff).into()),border_variant: Some(rgba(0x00c6e0ff).into()),border_focused: Some(rgba(0xf2eddeff).into()),border_selected: Some(rgba(0x00c6e0ff).into()),border_transparent: Some(rgba(0x00c6e0ff).into()),border_disabled: Some(rgba(0x00c6e0ff).into()),elevated_surface_background: Some(rgba(0xf6eddaff).into()),surface_background: Some(rgba(0xf6eddaff).into()),background: Some(rgba(0xfef8ecff).into()),element_background: Some(rgba(0x089099ff).into()),element_hover: Some(rgba(0xd1f2f8ff).into()),element_selected: Some(rgba(0xb6e1e7ff).into()),drop_target_background: Some(rgba(0xcccab1ff).into()),ghost_element_hover: Some(rgba(0xd1f2f8ff).into()),text: Some(rgba(0x005661ff).into()),tab_inactive_background: Some(rgba(0xf0e9d6ff).into()),tab_active_background: Some(rgba(0xfef8ecff).into()),editor_background: Some(rgba(0xfef8ecff).into()),editor_gutter_background: Some(rgba(0xfef8ecff).into()),editor_line_number: Some(rgba(0xa0abacff).into()),editor_active_line_number: Some(rgba(0x005661ff).into()),terminal_background: Some(rgba(0xf6eddaff).into()),terminal_ansi_bright_black: Some(rgba(0x004d57ff).into()),terminal_ansi_bright_red: Some(rgba(0xff3f00ff).into()),terminal_ansi_bright_green: Some(rgba(0x00d17aff).into()),terminal_ansi_bright_yellow: Some(rgba(0xff8c00ff).into()),terminal_ansi_bright_blue: Some(rgba(0x0ea3ffff).into()),terminal_ansi_bright_magenta: Some(rgba(0xff6b9eff).into()),terminal_ansi_bright_cyan: Some(rgba(0x00cae6ff).into()),terminal_ansi_bright_white: Some(rgba(0xbbc3c4ff).into()),terminal_ansi_black: Some(rgba(0x003b41ff).into()),terminal_ansi_red: Some(rgba(0xe34d1bff).into()),terminal_ansi_green: Some(rgba(0x00b368ff).into()),terminal_ansi_yellow: Some(rgba(0xf49724ff).into()),terminal_ansi_blue: Some(rgba(0x0094f0ff).into()),terminal_ansi_magenta: Some(rgba(0xff5792ff).into()),terminal_ansi_cyan: Some(rgba(0x00bdd6ff).into()),terminal_ansi_white: Some(rgba(0x8ca6a6ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xff3f00ff).into()),error: Some(rgba(0xff3f00ff).into()),hidden: Some(rgba(0x878476ff).into()),warning: Some(rgba(0xe07a52ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x8ca6a6ff).into()), ("punctuation".into(), rgba(0x8ca6a6ff).into()), ("punctuation".into(), rgba(0x004d57ff).into()), ("punctuation".into(), rgba(0x004d57ff).into()), ("punctuation".into(), rgba(0xff5792ff).into()), ("something".into(), rgba(0xfa8900ff).into()), ("something".into(), rgba(0xfa8900ff).into()), ("punctuation".into(), rgba(0xfa8900ff).into()), ("something".into(), rgba(0xa88c00ff).into()), ("something".into(), rgba(0x00b368ff).into()), ("punctuation".into(), rgba(0x0094f0ff).into()), ("punctuation".into(), rgba(0x0094f0ff).into())] }) } }, UserTheme { name: "Noctis Minimus".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x496c83ff).into()),border_variant: Some(rgba(0x496c83ff).into()),border_focused: Some(rgba(0x202d37ff).into()),border_selected: Some(rgba(0x496c83ff).into()),border_transparent: Some(rgba(0x496c83ff).into()),border_disabled: Some(rgba(0x496c83ff).into()),elevated_surface_background: Some(rgba(0x0e1920ff).into()),surface_background: Some(rgba(0x0e1920ff).into()),background: Some(rgba(0x1b2932ff).into()),element_background: Some(rgba(0x2e616bff).into()),element_hover: Some(rgba(0x00558aff).into()),element_selected: Some(rgba(0x2c414eff).into()),drop_target_background: Some(rgba(0x152836ff).into()),ghost_element_hover: Some(rgba(0x00558aff).into()),text: Some(rgba(0xc5cdd3ff).into()),tab_inactive_background: Some(rgba(0x202d37ff).into()),tab_active_background: Some(rgba(0x1b2932ff).into()),editor_background: Some(rgba(0x1b2932ff).into()),editor_gutter_background: Some(rgba(0x1b2932ff).into()),editor_line_number: Some(rgba(0x5d6e79ff).into()),editor_active_line_number: Some(rgba(0xc5cdd3ff).into()),terminal_background: Some(rgba(0x0e1920ff).into()),terminal_ansi_bright_black: Some(rgba(0x425866ff).into()),terminal_ansi_bright_red: Some(rgba(0xca8468ff).into()),terminal_ansi_bright_green: Some(rgba(0x84c8abff).into()),terminal_ansi_bright_yellow: Some(rgba(0xd1aa7bff).into()),terminal_ansi_bright_blue: Some(rgba(0x68a4caff).into()),terminal_ansi_bright_magenta: Some(rgba(0xc88da2ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x84bfc8ff).into()),terminal_ansi_bright_white: Some(rgba(0xc5d1d3ff).into()),terminal_ansi_black: Some(rgba(0x182935ff).into()),terminal_ansi_red: Some(rgba(0xc08872ff).into()),terminal_ansi_green: Some(rgba(0x72c09fff).into()),terminal_ansi_yellow: Some(rgba(0xc8a984ff).into()),terminal_ansi_blue: Some(rgba(0x6095b7ff).into()),terminal_ansi_magenta: Some(rgba(0xc28097ff).into()),terminal_ansi_cyan: Some(rgba(0x72b7c0ff).into()),terminal_ansi_white: Some(rgba(0xc5cdd3ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xb96245ff).into()),error: Some(rgba(0xb96245ff).into()),hidden: Some(rgba(0x96a8b6ff).into()),warning: Some(rgba(0xffa857ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x5d7787ff).into()), ("punctuation".into(), rgba(0x5d7787ff).into()), ("punctuation".into(), rgba(0xc5cdd3ff).into()), ("punctuation".into(), rgba(0xc5cdd3ff).into()), ("punctuation".into(), rgba(0xc88da2ff).into()), ("something".into(), rgba(0xd3b692ff).into()), ("something".into(), rgba(0xd3b692ff).into()), ("punctuation".into(), rgba(0xd3b692ff).into()), ("something".into(), rgba(0xa88c00ff).into()), ("something".into(), rgba(0x72c09fff).into()), ("punctuation".into(), rgba(0x5897bfff).into()), ("punctuation".into(), rgba(0x5897bfff).into())] }) } }, UserTheme { name: "Noctis".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x0d6571ff).into()),border_variant: Some(rgba(0x0d6571ff).into()),border_focused: Some(rgba(0x063940ff).into()),border_selected: Some(rgba(0x0d6571ff).into()),border_transparent: Some(rgba(0x0d6571ff).into()),border_disabled: Some(rgba(0x0d6571ff).into()),elevated_surface_background: Some(rgba(0x03181aff).into()),surface_background: Some(rgba(0x03181aff).into()),background: Some(rgba(0x052428ff).into()),element_background: Some(rgba(0x089099ff).into()),element_hover: Some(rgba(0x0b505aff).into()),element_selected: Some(rgba(0x0d6571ff).into()),drop_target_background: Some(rgba(0x00404dff).into()),ghost_element_hover: Some(rgba(0x0b505aff).into()),text: Some(rgba(0xb1c9ccff).into()),tab_inactive_background: Some(rgba(0x052e32ff).into()),tab_active_background: Some(rgba(0x052428ff).into()),editor_background: Some(rgba(0x052428ff).into()),editor_gutter_background: Some(rgba(0x052428ff).into()),editor_line_number: Some(rgba(0x4e6b6eff).into()),editor_active_line_number: Some(rgba(0xb1c9ccff).into()),terminal_background: Some(rgba(0x03181aff).into()),terminal_ansi_bright_black: Some(rgba(0x47686cff).into()),terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()),terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()),terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()),terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()),terminal_ansi_bright_white: Some(rgba(0xc1d4d7ff).into()),terminal_ansi_black: Some(rgba(0x324a4dff).into()),terminal_ansi_red: Some(rgba(0xe66432ff).into()),terminal_ansi_green: Some(rgba(0x49e9a6ff).into()),terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()),terminal_ansi_blue: Some(rgba(0x49ace9ff).into()),terminal_ansi_magenta: Some(rgba(0xdf759aff).into()),terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()),terminal_ansi_white: Some(rgba(0xb1c9ccff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xe34d1bff).into()),error: Some(rgba(0xe34d1bff).into()),hidden: Some(rgba(0x87a7abff).into()),warning: Some(rgba(0xffa487ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x5b858bff).into()), ("punctuation".into(), rgba(0x5b858bff).into()), ("punctuation".into(), rgba(0xb1c9ccff).into()), ("punctuation".into(), rgba(0xb1c9ccff).into()), ("punctuation".into(), rgba(0xdf759aff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("punctuation".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xd59719ff).into()), ("something".into(), rgba(0x49e9a6ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into())] }) } }, UserTheme { name: "Noctis Obscuro".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x0d6571ff).into()),border_variant: Some(rgba(0x0d6571ff).into()),border_focused: Some(rgba(0x052e32ff).into()),border_selected: Some(rgba(0x0d6571ff).into()),border_transparent: Some(rgba(0x0d6571ff).into()),border_disabled: Some(rgba(0x0d6571ff).into()),elevated_surface_background: Some(rgba(0x020c0eff).into()),surface_background: Some(rgba(0x020c0eff).into()),background: Some(rgba(0x031316ff).into()),element_background: Some(rgba(0x089099ff).into()),element_hover: Some(rgba(0x0b505aff).into()),element_selected: Some(rgba(0x0d6571ff).into()),drop_target_background: Some(rgba(0x00404dff).into()),ghost_element_hover: Some(rgba(0x0b505aff).into()),text: Some(rgba(0xb1c9ccff).into()),tab_inactive_background: Some(rgba(0x052e32ff).into()),tab_active_background: Some(rgba(0x031316ff).into()),editor_background: Some(rgba(0x031316ff).into()),editor_gutter_background: Some(rgba(0x031316ff).into()),editor_line_number: Some(rgba(0x4e6b6eff).into()),editor_active_line_number: Some(rgba(0xb1c9ccff).into()),terminal_background: Some(rgba(0x020c0eff).into()),terminal_ansi_bright_black: Some(rgba(0x47686cff).into()),terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()),terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()),terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()),terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()),terminal_ansi_bright_white: Some(rgba(0xc1d4d7ff).into()),terminal_ansi_black: Some(rgba(0x324a4dff).into()),terminal_ansi_red: Some(rgba(0xe66432ff).into()),terminal_ansi_green: Some(rgba(0x49e9a6ff).into()),terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()),terminal_ansi_blue: Some(rgba(0x49ace9ff).into()),terminal_ansi_magenta: Some(rgba(0xdf759aff).into()),terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()),terminal_ansi_white: Some(rgba(0xb1c9ccff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xe34d1bff).into()),error: Some(rgba(0xe34d1bff).into()),hidden: Some(rgba(0x87a7abff).into()),warning: Some(rgba(0xffa487ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x5b858bff).into()), ("punctuation".into(), rgba(0x5b858bff).into()), ("punctuation".into(), rgba(0xb1c9ccff).into()), ("punctuation".into(), rgba(0xb1c9ccff).into()), ("punctuation".into(), rgba(0xdf759aff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("punctuation".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xd59719ff).into()), ("something".into(), rgba(0x49e9a6ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into())] }) } }, UserTheme { name: "Noctis Sereno".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x0d6571ff).into()),border_variant: Some(rgba(0x0d6571ff).into()),border_focused: Some(rgba(0x052e32ff).into()),border_selected: Some(rgba(0x0d6571ff).into()),border_transparent: Some(rgba(0x0d6571ff).into()),border_disabled: Some(rgba(0x0d6571ff).into()),elevated_surface_background: Some(rgba(0x020c0eff).into()),surface_background: Some(rgba(0x020c0eff).into()),background: Some(rgba(0x031316ff).into()),element_background: Some(rgba(0x089099ff).into()),element_hover: Some(rgba(0x0b505aff).into()),element_selected: Some(rgba(0x0d6571ff).into()),drop_target_background: Some(rgba(0x00404dff).into()),ghost_element_hover: Some(rgba(0x0b505aff).into()),text: Some(rgba(0xb1c9ccff).into()),tab_inactive_background: Some(rgba(0x052e32ff).into()),tab_active_background: Some(rgba(0x031316ff).into()),editor_background: Some(rgba(0x031316ff).into()),editor_gutter_background: Some(rgba(0x031316ff).into()),editor_line_number: Some(rgba(0x4e6b6eff).into()),editor_active_line_number: Some(rgba(0xb1c9ccff).into()),terminal_background: Some(rgba(0x020c0eff).into()),terminal_ansi_bright_black: Some(rgba(0x47686cff).into()),terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()),terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()),terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()),terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()),terminal_ansi_bright_white: Some(rgba(0xc1d4d7ff).into()),terminal_ansi_black: Some(rgba(0x324a4dff).into()),terminal_ansi_red: Some(rgba(0xe66432ff).into()),terminal_ansi_green: Some(rgba(0x49e9a6ff).into()),terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()),terminal_ansi_blue: Some(rgba(0x49ace9ff).into()),terminal_ansi_magenta: Some(rgba(0xdf759aff).into()),terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()),terminal_ansi_white: Some(rgba(0xb1c9ccff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xe34d1bff).into()),error: Some(rgba(0xe34d1bff).into()),hidden: Some(rgba(0x87a7abff).into()),warning: Some(rgba(0xffa487ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x5b858bff).into()), ("punctuation".into(), rgba(0x5b858bff).into()), ("punctuation".into(), rgba(0xb1c9ccff).into()), ("punctuation".into(), rgba(0xb1c9ccff).into()), ("punctuation".into(), rgba(0xdf759aff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("punctuation".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xd59719ff).into()), ("something".into(), rgba(0x49e9a6ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into())] }) } }, UserTheme { name: "Noctis Uva".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x6d66a7ff).into()),border_variant: Some(rgba(0x6d66a7ff).into()),border_focused: Some(rgba(0x2f2c49ff).into()),border_selected: Some(rgba(0x6d66a7ff).into()),border_transparent: Some(rgba(0x6d66a7ff).into()),border_disabled: Some(rgba(0x6d66a7ff).into()),elevated_surface_background: Some(rgba(0x1f1d30ff).into()),surface_background: Some(rgba(0x1f1d30ff).into()),background: Some(rgba(0x292640ff).into()),element_background: Some(rgba(0x007e99ff).into()),element_hover: Some(rgba(0x383866ff).into()),element_selected: Some(rgba(0x322e5cff).into()),drop_target_background: Some(rgba(0x202040ff).into()),ghost_element_hover: Some(rgba(0x383866ff).into()),text: Some(rgba(0xc5c2d6ff).into()),tab_inactive_background: Some(rgba(0x2f2c49ff).into()),tab_active_background: Some(rgba(0x292640ff).into()),editor_background: Some(rgba(0x292640ff).into()),editor_gutter_background: Some(rgba(0x292640ff).into()),editor_line_number: Some(rgba(0x5c5973ff).into()),editor_active_line_number: Some(rgba(0xc5c2d6ff).into()),terminal_background: Some(rgba(0x1f1d30ff).into()),terminal_ansi_bright_black: Some(rgba(0x504e65ff).into()),terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()),terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()),terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()),terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()),terminal_ansi_bright_white: Some(rgba(0xc5c2d6ff).into()),terminal_ansi_black: Some(rgba(0x302f3dff).into()),terminal_ansi_red: Some(rgba(0xe66432ff).into()),terminal_ansi_green: Some(rgba(0x49e9a6ff).into()),terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()),terminal_ansi_blue: Some(rgba(0x49ace9ff).into()),terminal_ansi_magenta: Some(rgba(0xdf759aff).into()),terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()),terminal_ansi_white: Some(rgba(0xb6b3ccff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xe34d1bff).into()),error: Some(rgba(0xe34d1bff).into()),hidden: Some(rgba(0xa9a5c0ff).into()),warning: Some(rgba(0xffa857ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x716b93ff).into()), ("punctuation".into(), rgba(0x716b93ff).into()), ("punctuation".into(), rgba(0xc5c2d6ff).into()), ("punctuation".into(), rgba(0xc5c2d6ff).into()), ("punctuation".into(), rgba(0xdf759aff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("punctuation".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xd59719ff).into()), ("something".into(), rgba(0x49e9a6ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into())] }) } }, UserTheme { name: "Noctis Viola".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x8666a7ff).into()),border_variant: Some(rgba(0x8666a7ff).into()),border_focused: Some(rgba(0x3d2e4dff).into()),border_selected: Some(rgba(0x8666a7ff).into()),border_transparent: Some(rgba(0x8666a7ff).into()),border_disabled: Some(rgba(0x8666a7ff).into()),elevated_surface_background: Some(rgba(0x291d35ff).into()),surface_background: Some(rgba(0x291d35ff).into()),background: Some(rgba(0x30243dff).into()),element_background: Some(rgba(0x007e99ff).into()),element_hover: Some(rgba(0x69438dff).into()),element_selected: Some(rgba(0x472e60ff).into()),drop_target_background: Some(rgba(0x302040ff).into()),ghost_element_hover: Some(rgba(0x69438dff).into()),text: Some(rgba(0xccbfd9ff).into()),tab_inactive_background: Some(rgba(0x3d2e4dff).into()),tab_active_background: Some(rgba(0x30243dff).into()),editor_background: Some(rgba(0x30243dff).into()),editor_gutter_background: Some(rgba(0x30243dff).into()),editor_line_number: Some(rgba(0x665973ff).into()),editor_active_line_number: Some(rgba(0xccbfd9ff).into()),terminal_background: Some(rgba(0x291d35ff).into()),terminal_ansi_bright_black: Some(rgba(0x594e65ff).into()),terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()),terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()),terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()),terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()),terminal_ansi_bright_white: Some(rgba(0xccbfd9ff).into()),terminal_ansi_black: Some(rgba(0x362f3dff).into()),terminal_ansi_red: Some(rgba(0xe66432ff).into()),terminal_ansi_green: Some(rgba(0x49e9a6ff).into()),terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()),terminal_ansi_blue: Some(rgba(0x49ace9ff).into()),terminal_ansi_magenta: Some(rgba(0xdf759aff).into()),terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()),terminal_ansi_white: Some(rgba(0xbfafcfff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xe34d1bff).into()),error: Some(rgba(0xe34d1bff).into()),hidden: Some(rgba(0xb3a5c0ff).into()),warning: Some(rgba(0xffa857ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x7e6499ff).into()), ("punctuation".into(), rgba(0x7e6499ff).into()), ("punctuation".into(), rgba(0xccbfd9ff).into()), ("punctuation".into(), rgba(0xccbfd9ff).into()), ("punctuation".into(), rgba(0xdf759aff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("punctuation".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xd59719ff).into()), ("something".into(), rgba(0x49e9a6ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into())] }) } }], } + } + \ No newline at end of file diff --git a/crates/theme2/src/themes/palenight.rs b/crates/theme2/src/themes/palenight.rs index 35d1aa7505b460297cc798ceb2172815dd58c7af..a516aa4f58a455bd4872cb7c1b9a4f1267a6beba 100644 --- a/crates/theme2/src/themes/palenight.rs +++ b/crates/theme2/src/themes/palenight.rs @@ -1,174 +1,18 @@ -// This file was generated by the `theme_importer`. -// Be careful when modifying it by hand. -use gpui::rgba; + // This file was generated by the `theme_importer`. + // Be careful when modifying it by hand. -use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, - UserThemeStylesRefinement, -}; + use gpui::rgba; -pub fn palenight() -> UserThemeFamily { - UserThemeFamily { - name: "Palenight".into(), - author: "Olaolu Olawuyi (whizkydee)".into(), - themes: vec![ - UserTheme { - name: "Palenight".into(), - appearance: Appearance::Dark, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0x282b3bff).into()), - border_variant: Some(rgba(0x282b3bff).into()), - border_focused: Some(rgba(0x282b3bff).into()), - border_selected: Some(rgba(0x282b3bff).into()), - border_transparent: Some(rgba(0x282b3bff).into()), - border_disabled: Some(rgba(0x282b3bff).into()), - elevated_surface_background: Some(rgba(0x292c3eff).into()), - surface_background: Some(rgba(0x292c3eff).into()), - background: Some(rgba(0x292c3eff).into()), - element_background: Some(rgba(0x7d56c1cc).into()), - element_hover: Some(rgba(0x0000001a).into()), - element_selected: Some(rgba(0x7d56c1ff).into()), - drop_target_background: Some(rgba(0x2e3245ff).into()), - ghost_element_hover: Some(rgba(0x0000001a).into()), - text: Some(rgba(0xffffffff).into()), - tab_inactive_background: Some(rgba(0x31364aff).into()), - tab_active_background: Some(rgba(0x292c3eff).into()), - editor_background: Some(rgba(0x292c3eff).into()), - editor_gutter_background: Some(rgba(0x292c3eff).into()), - editor_line_number: Some(rgba(0x4c5374ff).into()), - editor_active_line_number: Some(rgba(0xbfc7d5ff).into()), - terminal_ansi_bright_black: Some(rgba(0x676e95ff).into()), - terminal_ansi_bright_red: Some(rgba(0xff5571ff).into()), - terminal_ansi_bright_green: Some(rgba(0xc3e88dff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xffcb6bff).into()), - terminal_ansi_bright_blue: Some(rgba(0x82aaffff).into()), - terminal_ansi_bright_magenta: Some(rgba(0xc792eaff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x89ddffff).into()), - terminal_ansi_bright_white: Some(rgba(0xffffffff).into()), - terminal_ansi_black: Some(rgba(0x676e95ff).into()), - terminal_ansi_red: Some(rgba(0xff5571ff).into()), - terminal_ansi_green: Some(rgba(0xa9c77dff).into()), - terminal_ansi_yellow: Some(rgba(0xffcb6bff).into()), - terminal_ansi_blue: Some(rgba(0x82aaffff).into()), - terminal_ansi_magenta: Some(rgba(0xc792eaff).into()), - terminal_ansi_cyan: Some(rgba(0x89ddffff).into()), - terminal_ansi_white: Some(rgba(0xffffffff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xef524fff).into()), - error: Some(rgba(0xef524fff).into()), - hidden: Some(rgba(0x9199c8ff).into()), - ..Default::default() - }, - }, - }, - UserTheme { - name: "Palenight Operator".into(), - appearance: Appearance::Dark, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0x282b3bff).into()), - border_variant: Some(rgba(0x282b3bff).into()), - border_focused: Some(rgba(0x282b3bff).into()), - border_selected: Some(rgba(0x282b3bff).into()), - border_transparent: Some(rgba(0x282b3bff).into()), - border_disabled: Some(rgba(0x282b3bff).into()), - elevated_surface_background: Some(rgba(0x292c3eff).into()), - surface_background: Some(rgba(0x292c3eff).into()), - background: Some(rgba(0x292c3eff).into()), - element_background: Some(rgba(0x7d56c1cc).into()), - element_hover: Some(rgba(0x0000001a).into()), - element_selected: Some(rgba(0x7d56c1ff).into()), - drop_target_background: Some(rgba(0x2e3245ff).into()), - ghost_element_hover: Some(rgba(0x0000001a).into()), - text: Some(rgba(0xffffffff).into()), - tab_inactive_background: Some(rgba(0x31364aff).into()), - tab_active_background: Some(rgba(0x292c3eff).into()), - editor_background: Some(rgba(0x292c3eff).into()), - editor_gutter_background: Some(rgba(0x292c3eff).into()), - editor_line_number: Some(rgba(0x4c5374ff).into()), - editor_active_line_number: Some(rgba(0xbfc7d5ff).into()), - terminal_ansi_bright_black: Some(rgba(0x676e95ff).into()), - terminal_ansi_bright_red: Some(rgba(0xff5571ff).into()), - terminal_ansi_bright_green: Some(rgba(0xc3e88dff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xffcb6bff).into()), - terminal_ansi_bright_blue: Some(rgba(0x82aaffff).into()), - terminal_ansi_bright_magenta: Some(rgba(0xc792eaff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x89ddffff).into()), - terminal_ansi_bright_white: Some(rgba(0xffffffff).into()), - terminal_ansi_black: Some(rgba(0x676e95ff).into()), - terminal_ansi_red: Some(rgba(0xff5571ff).into()), - terminal_ansi_green: Some(rgba(0xa9c77dff).into()), - terminal_ansi_yellow: Some(rgba(0xffcb6bff).into()), - terminal_ansi_blue: Some(rgba(0x82aaffff).into()), - terminal_ansi_magenta: Some(rgba(0xc792eaff).into()), - terminal_ansi_cyan: Some(rgba(0x89ddffff).into()), - terminal_ansi_white: Some(rgba(0xffffffff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xef524fff).into()), - error: Some(rgba(0xef524fff).into()), - hidden: Some(rgba(0x9199c8ff).into()), - ..Default::default() - }, - }, - }, - UserTheme { - name: "Palenight (Mild Contrast)".into(), - appearance: Appearance::Dark, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0x2c2f40ff).into()), - border_variant: Some(rgba(0x2c2f40ff).into()), - border_focused: Some(rgba(0x2c2f40ff).into()), - border_selected: Some(rgba(0x2c2f40ff).into()), - border_transparent: Some(rgba(0x2c2f40ff).into()), - border_disabled: Some(rgba(0x2c2f40ff).into()), - elevated_surface_background: Some(rgba(0x25283aff).into()), - surface_background: Some(rgba(0x25283aff).into()), - background: Some(rgba(0x292c3eff).into()), - element_background: Some(rgba(0x7d56c1cc).into()), - element_hover: Some(rgba(0x0000001a).into()), - element_selected: Some(rgba(0x7d56c1ff).into()), - drop_target_background: Some(rgba(0x2e3245ff).into()), - ghost_element_hover: Some(rgba(0x0000001a).into()), - text: Some(rgba(0xffffffff).into()), - tab_inactive_background: Some(rgba(0x31364aff).into()), - tab_active_background: Some(rgba(0x25283aff).into()), - editor_background: Some(rgba(0x292c3eff).into()), - editor_gutter_background: Some(rgba(0x292c3eff).into()), - editor_line_number: Some(rgba(0x4c5374ff).into()), - editor_active_line_number: Some(rgba(0xbfc7d5ff).into()), - terminal_ansi_bright_black: Some(rgba(0x676e95ff).into()), - terminal_ansi_bright_red: Some(rgba(0xff5571ff).into()), - terminal_ansi_bright_green: Some(rgba(0xc3e88dff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xffcb6bff).into()), - terminal_ansi_bright_blue: Some(rgba(0x82aaffff).into()), - terminal_ansi_bright_magenta: Some(rgba(0xc792eaff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x89ddffff).into()), - terminal_ansi_bright_white: Some(rgba(0xffffffff).into()), - terminal_ansi_black: Some(rgba(0x676e95ff).into()), - terminal_ansi_red: Some(rgba(0xff5571ff).into()), - terminal_ansi_green: Some(rgba(0xa9c77dff).into()), - terminal_ansi_yellow: Some(rgba(0xffcb6bff).into()), - terminal_ansi_blue: Some(rgba(0x82aaffff).into()), - terminal_ansi_magenta: Some(rgba(0xc792eaff).into()), - terminal_ansi_cyan: Some(rgba(0x89ddffff).into()), - terminal_ansi_white: Some(rgba(0xffffffff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xef524fff).into()), - error: Some(rgba(0xef524fff).into()), - hidden: Some(rgba(0x9199c8ff).into()), - ..Default::default() - }, - }, - }, - ], - } + use crate::{ + Appearance, ThemeColorsRefinement, StatusColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + }; + + pub fn palenight() -> UserThemeFamily { + UserThemeFamily { + name: "Palenight".into(), + author: "Olaolu Olawuyi (whizkydee)".into(), + themes: vec![UserTheme { name: "Palenight".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x282b3bff).into()),border_variant: Some(rgba(0x282b3bff).into()),border_focused: Some(rgba(0x282b3bff).into()),border_selected: Some(rgba(0x282b3bff).into()),border_transparent: Some(rgba(0x282b3bff).into()),border_disabled: Some(rgba(0x282b3bff).into()),elevated_surface_background: Some(rgba(0x292c3eff).into()),surface_background: Some(rgba(0x292c3eff).into()),background: Some(rgba(0x292c3eff).into()),element_background: Some(rgba(0x7d56c1cc).into()),element_hover: Some(rgba(0x0000001a).into()),element_selected: Some(rgba(0x7d56c1ff).into()),drop_target_background: Some(rgba(0x2e3245ff).into()),ghost_element_hover: Some(rgba(0x0000001a).into()),text: Some(rgba(0xffffffff).into()),tab_inactive_background: Some(rgba(0x31364aff).into()),tab_active_background: Some(rgba(0x292c3eff).into()),editor_background: Some(rgba(0x292c3eff).into()),editor_gutter_background: Some(rgba(0x292c3eff).into()),editor_line_number: Some(rgba(0x4c5374ff).into()),editor_active_line_number: Some(rgba(0xbfc7d5ff).into()),terminal_ansi_bright_black: Some(rgba(0x676e95ff).into()),terminal_ansi_bright_red: Some(rgba(0xff5571ff).into()),terminal_ansi_bright_green: Some(rgba(0xc3e88dff).into()),terminal_ansi_bright_yellow: Some(rgba(0xffcb6bff).into()),terminal_ansi_bright_blue: Some(rgba(0x82aaffff).into()),terminal_ansi_bright_magenta: Some(rgba(0xc792eaff).into()),terminal_ansi_bright_cyan: Some(rgba(0x89ddffff).into()),terminal_ansi_bright_white: Some(rgba(0xffffffff).into()),terminal_ansi_black: Some(rgba(0x676e95ff).into()),terminal_ansi_red: Some(rgba(0xff5571ff).into()),terminal_ansi_green: Some(rgba(0xa9c77dff).into()),terminal_ansi_yellow: Some(rgba(0xffcb6bff).into()),terminal_ansi_blue: Some(rgba(0x82aaffff).into()),terminal_ansi_magenta: Some(rgba(0xc792eaff).into()),terminal_ansi_cyan: Some(rgba(0x89ddffff).into()),terminal_ansi_white: Some(rgba(0xffffffff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xef524fff).into()),error: Some(rgba(0xef524fff).into()),hidden: Some(rgba(0x9199c8ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x687097ff).into()), ("something".into(), rgba(0xc3e88dff).into()), ("something".into(), rgba(0xffcb6bff).into()), ("punctuation".into(), rgba(0xc792eaff).into()), ("something".into(), rgba(0xc792eaff).into()), ("punctuation".into(), rgba(0x89ddffff).into()), ("punctuation".into(), rgba(0xd3413dff).into()), ("something".into(), rgba(0xc792eaff).into()), ("something".into(), rgba(0xffcb6bff).into()), ("something".into(), rgba(0x687097ff).into()), ("something".into(), rgba(0x7fcac3ff).into())] }) } }, UserTheme { name: "Palenight Operator".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x282b3bff).into()),border_variant: Some(rgba(0x282b3bff).into()),border_focused: Some(rgba(0x282b3bff).into()),border_selected: Some(rgba(0x282b3bff).into()),border_transparent: Some(rgba(0x282b3bff).into()),border_disabled: Some(rgba(0x282b3bff).into()),elevated_surface_background: Some(rgba(0x292c3eff).into()),surface_background: Some(rgba(0x292c3eff).into()),background: Some(rgba(0x292c3eff).into()),element_background: Some(rgba(0x7d56c1cc).into()),element_hover: Some(rgba(0x0000001a).into()),element_selected: Some(rgba(0x7d56c1ff).into()),drop_target_background: Some(rgba(0x2e3245ff).into()),ghost_element_hover: Some(rgba(0x0000001a).into()),text: Some(rgba(0xffffffff).into()),tab_inactive_background: Some(rgba(0x31364aff).into()),tab_active_background: Some(rgba(0x292c3eff).into()),editor_background: Some(rgba(0x292c3eff).into()),editor_gutter_background: Some(rgba(0x292c3eff).into()),editor_line_number: Some(rgba(0x4c5374ff).into()),editor_active_line_number: Some(rgba(0xbfc7d5ff).into()),terminal_ansi_bright_black: Some(rgba(0x676e95ff).into()),terminal_ansi_bright_red: Some(rgba(0xff5571ff).into()),terminal_ansi_bright_green: Some(rgba(0xc3e88dff).into()),terminal_ansi_bright_yellow: Some(rgba(0xffcb6bff).into()),terminal_ansi_bright_blue: Some(rgba(0x82aaffff).into()),terminal_ansi_bright_magenta: Some(rgba(0xc792eaff).into()),terminal_ansi_bright_cyan: Some(rgba(0x89ddffff).into()),terminal_ansi_bright_white: Some(rgba(0xffffffff).into()),terminal_ansi_black: Some(rgba(0x676e95ff).into()),terminal_ansi_red: Some(rgba(0xff5571ff).into()),terminal_ansi_green: Some(rgba(0xa9c77dff).into()),terminal_ansi_yellow: Some(rgba(0xffcb6bff).into()),terminal_ansi_blue: Some(rgba(0x82aaffff).into()),terminal_ansi_magenta: Some(rgba(0xc792eaff).into()),terminal_ansi_cyan: Some(rgba(0x89ddffff).into()),terminal_ansi_white: Some(rgba(0xffffffff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xef524fff).into()),error: Some(rgba(0xef524fff).into()),hidden: Some(rgba(0x9199c8ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x687097ff).into()), ("something".into(), rgba(0xc3e88dff).into()), ("something".into(), rgba(0xffcb6bff).into()), ("punctuation".into(), rgba(0xc792eaff).into()), ("something".into(), rgba(0xc792eaff).into()), ("punctuation".into(), rgba(0x89ddffff).into()), ("punctuation".into(), rgba(0xd3413dff).into()), ("something".into(), rgba(0xc792eaff).into()), ("something".into(), rgba(0xffcb6bff).into()), ("something".into(), rgba(0x687097ff).into()), ("something".into(), rgba(0x7fcac3ff).into())] }) } }, UserTheme { name: "Palenight (Mild Contrast)".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x2c2f40ff).into()),border_variant: Some(rgba(0x2c2f40ff).into()),border_focused: Some(rgba(0x2c2f40ff).into()),border_selected: Some(rgba(0x2c2f40ff).into()),border_transparent: Some(rgba(0x2c2f40ff).into()),border_disabled: Some(rgba(0x2c2f40ff).into()),elevated_surface_background: Some(rgba(0x25283aff).into()),surface_background: Some(rgba(0x25283aff).into()),background: Some(rgba(0x292c3eff).into()),element_background: Some(rgba(0x7d56c1cc).into()),element_hover: Some(rgba(0x0000001a).into()),element_selected: Some(rgba(0x7d56c1ff).into()),drop_target_background: Some(rgba(0x2e3245ff).into()),ghost_element_hover: Some(rgba(0x0000001a).into()),text: Some(rgba(0xffffffff).into()),tab_inactive_background: Some(rgba(0x31364aff).into()),tab_active_background: Some(rgba(0x25283aff).into()),editor_background: Some(rgba(0x292c3eff).into()),editor_gutter_background: Some(rgba(0x292c3eff).into()),editor_line_number: Some(rgba(0x4c5374ff).into()),editor_active_line_number: Some(rgba(0xbfc7d5ff).into()),terminal_ansi_bright_black: Some(rgba(0x676e95ff).into()),terminal_ansi_bright_red: Some(rgba(0xff5571ff).into()),terminal_ansi_bright_green: Some(rgba(0xc3e88dff).into()),terminal_ansi_bright_yellow: Some(rgba(0xffcb6bff).into()),terminal_ansi_bright_blue: Some(rgba(0x82aaffff).into()),terminal_ansi_bright_magenta: Some(rgba(0xc792eaff).into()),terminal_ansi_bright_cyan: Some(rgba(0x89ddffff).into()),terminal_ansi_bright_white: Some(rgba(0xffffffff).into()),terminal_ansi_black: Some(rgba(0x676e95ff).into()),terminal_ansi_red: Some(rgba(0xff5571ff).into()),terminal_ansi_green: Some(rgba(0xa9c77dff).into()),terminal_ansi_yellow: Some(rgba(0xffcb6bff).into()),terminal_ansi_blue: Some(rgba(0x82aaffff).into()),terminal_ansi_magenta: Some(rgba(0xc792eaff).into()),terminal_ansi_cyan: Some(rgba(0x89ddffff).into()),terminal_ansi_white: Some(rgba(0xffffffff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xef524fff).into()),error: Some(rgba(0xef524fff).into()),hidden: Some(rgba(0x9199c8ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x687097ff).into()), ("something".into(), rgba(0xc3e88dff).into()), ("something".into(), rgba(0xffcb6bff).into()), ("punctuation".into(), rgba(0xc792eaff).into()), ("something".into(), rgba(0xc792eaff).into()), ("punctuation".into(), rgba(0x89ddffff).into()), ("punctuation".into(), rgba(0xd3413dff).into()), ("something".into(), rgba(0xc792eaff).into()), ("something".into(), rgba(0xffcb6bff).into()), ("something".into(), rgba(0x687097ff).into()), ("something".into(), rgba(0x7fcac3ff).into())] }) } }], } + } + \ No newline at end of file diff --git a/crates/theme2/src/themes/rose_pine.rs b/crates/theme2/src/themes/rose_pine.rs index 9cc8b0ab83e2648bd2b76210b8faf2088caa88c8..fbc06e04ddb499c4b2838e1e65eb251dcc8a8e7a 100644 --- a/crates/theme2/src/themes/rose_pine.rs +++ b/crates/theme2/src/themes/rose_pine.rs @@ -1,177 +1,18 @@ -// This file was generated by the `theme_importer`. -// Be careful when modifying it by hand. -use gpui::rgba; + // This file was generated by the `theme_importer`. + // Be careful when modifying it by hand. -use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, - UserThemeStylesRefinement, -}; + use gpui::rgba; -pub fn rose_pine() -> UserThemeFamily { - UserThemeFamily { - name: "Rose Pine".into(), - author: "Rosé Pine".into(), - themes: vec![ - UserTheme { - name: "Rose Pine".into(), - appearance: Appearance::Dark, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0x000000ff).into()), - border_variant: Some(rgba(0x000000ff).into()), - border_focused: Some(rgba(0x6e6a8633).into()), - border_selected: Some(rgba(0x000000ff).into()), - border_transparent: Some(rgba(0x000000ff).into()), - border_disabled: Some(rgba(0x000000ff).into()), - elevated_surface_background: Some(rgba(0x1f1d2eff).into()), - surface_background: Some(rgba(0x1f1d2eff).into()), - background: Some(rgba(0x191724ff).into()), - element_background: Some(rgba(0xebbcbaff).into()), - element_hover: Some(rgba(0x6e6a861a).into()), - element_selected: Some(rgba(0x6e6a8633).into()), - drop_target_background: Some(rgba(0x1f1d2eff).into()), - ghost_element_hover: Some(rgba(0x6e6a861a).into()), - text: Some(rgba(0xe0def4ff).into()), - tab_inactive_background: Some(rgba(0x000000ff).into()), - tab_active_background: Some(rgba(0x6e6a861a).into()), - editor_background: Some(rgba(0x191724ff).into()), - editor_gutter_background: Some(rgba(0x191724ff).into()), - editor_line_number: Some(rgba(0x908caaff).into()), - editor_active_line_number: Some(rgba(0xe0def4ff).into()), - terminal_ansi_bright_black: Some(rgba(0x908caaff).into()), - terminal_ansi_bright_red: Some(rgba(0xeb6f92ff).into()), - terminal_ansi_bright_green: Some(rgba(0x30738fff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xf5c177ff).into()), - terminal_ansi_bright_blue: Some(rgba(0x9ccfd8ff).into()), - terminal_ansi_bright_magenta: Some(rgba(0xc4a7e7ff).into()), - terminal_ansi_bright_cyan: Some(rgba(0xebbcbaff).into()), - terminal_ansi_bright_white: Some(rgba(0xe0def4ff).into()), - terminal_ansi_black: Some(rgba(0x26233aff).into()), - terminal_ansi_red: Some(rgba(0xeb6f92ff).into()), - terminal_ansi_green: Some(rgba(0x30738fff).into()), - terminal_ansi_yellow: Some(rgba(0xf5c177ff).into()), - terminal_ansi_blue: Some(rgba(0x9ccfd8ff).into()), - terminal_ansi_magenta: Some(rgba(0xc4a7e7ff).into()), - terminal_ansi_cyan: Some(rgba(0xebbcbaff).into()), - terminal_ansi_white: Some(rgba(0xe0def4ff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xeb6f92ff).into()), - error: Some(rgba(0xeb6f92ff).into()), - hidden: Some(rgba(0x908caaff).into()), - warning: Some(rgba(0xf5c177ff).into()), - ..Default::default() - }, - }, - }, - UserTheme { - name: "Rose Moon".into(), - appearance: Appearance::Dark, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0x000000ff).into()), - border_variant: Some(rgba(0x000000ff).into()), - border_focused: Some(rgba(0x817c9c26).into()), - border_selected: Some(rgba(0x000000ff).into()), - border_transparent: Some(rgba(0x000000ff).into()), - border_disabled: Some(rgba(0x000000ff).into()), - elevated_surface_background: Some(rgba(0x2a273eff).into()), - surface_background: Some(rgba(0x2a273eff).into()), - background: Some(rgba(0x232136ff).into()), - element_background: Some(rgba(0xea9a97ff).into()), - element_hover: Some(rgba(0x817c9c14).into()), - element_selected: Some(rgba(0x817c9c26).into()), - drop_target_background: Some(rgba(0x2a273eff).into()), - ghost_element_hover: Some(rgba(0x817c9c14).into()), - text: Some(rgba(0xe0def4ff).into()), - tab_inactive_background: Some(rgba(0x000000ff).into()), - tab_active_background: Some(rgba(0x817c9c14).into()), - editor_background: Some(rgba(0x232136ff).into()), - editor_gutter_background: Some(rgba(0x232136ff).into()), - editor_line_number: Some(rgba(0x908caaff).into()), - editor_active_line_number: Some(rgba(0xe0def4ff).into()), - terminal_ansi_bright_black: Some(rgba(0x908caaff).into()), - terminal_ansi_bright_red: Some(rgba(0xeb6f92ff).into()), - terminal_ansi_bright_green: Some(rgba(0x3d8fb0ff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xf5c177ff).into()), - terminal_ansi_bright_blue: Some(rgba(0x9ccfd8ff).into()), - terminal_ansi_bright_magenta: Some(rgba(0xc4a7e7ff).into()), - terminal_ansi_bright_cyan: Some(rgba(0xea9a97ff).into()), - terminal_ansi_bright_white: Some(rgba(0xe0def4ff).into()), - terminal_ansi_black: Some(rgba(0x393552ff).into()), - terminal_ansi_red: Some(rgba(0xeb6f92ff).into()), - terminal_ansi_green: Some(rgba(0x3d8fb0ff).into()), - terminal_ansi_yellow: Some(rgba(0xf5c177ff).into()), - terminal_ansi_blue: Some(rgba(0x9ccfd8ff).into()), - terminal_ansi_magenta: Some(rgba(0xc4a7e7ff).into()), - terminal_ansi_cyan: Some(rgba(0xea9a97ff).into()), - terminal_ansi_white: Some(rgba(0xe0def4ff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xeb6f92ff).into()), - error: Some(rgba(0xeb6f92ff).into()), - hidden: Some(rgba(0x908caaff).into()), - warning: Some(rgba(0xf5c177ff).into()), - ..Default::default() - }, - }, - }, - UserTheme { - name: "Rose Pine Dawn".into(), - appearance: Appearance::Light, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0x000000ff).into()), - border_variant: Some(rgba(0x000000ff).into()), - border_focused: Some(rgba(0x6e6a8614).into()), - border_selected: Some(rgba(0x000000ff).into()), - border_transparent: Some(rgba(0x000000ff).into()), - border_disabled: Some(rgba(0x000000ff).into()), - elevated_surface_background: Some(rgba(0xfffaf3ff).into()), - surface_background: Some(rgba(0xfffaf3ff).into()), - background: Some(rgba(0xfaf4edff).into()), - element_background: Some(rgba(0xd7827dff).into()), - element_hover: Some(rgba(0x6e6a860d).into()), - element_selected: Some(rgba(0x6e6a8614).into()), - drop_target_background: Some(rgba(0xfffaf3ff).into()), - ghost_element_hover: Some(rgba(0x6e6a860d).into()), - text: Some(rgba(0x575279ff).into()), - tab_inactive_background: Some(rgba(0x000000ff).into()), - tab_active_background: Some(rgba(0x6e6a860d).into()), - editor_background: Some(rgba(0xfaf4edff).into()), - editor_gutter_background: Some(rgba(0xfaf4edff).into()), - editor_line_number: Some(rgba(0x797593ff).into()), - editor_active_line_number: Some(rgba(0x575279ff).into()), - terminal_ansi_bright_black: Some(rgba(0x797593ff).into()), - terminal_ansi_bright_red: Some(rgba(0xb3627aff).into()), - terminal_ansi_bright_green: Some(rgba(0x276983ff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xea9d34ff).into()), - terminal_ansi_bright_blue: Some(rgba(0x55949fff).into()), - terminal_ansi_bright_magenta: Some(rgba(0x9079a9ff).into()), - terminal_ansi_bright_cyan: Some(rgba(0xd7827dff).into()), - terminal_ansi_bright_white: Some(rgba(0x575279ff).into()), - terminal_ansi_black: Some(rgba(0xf2e9e1ff).into()), - terminal_ansi_red: Some(rgba(0xb3627aff).into()), - terminal_ansi_green: Some(rgba(0x276983ff).into()), - terminal_ansi_yellow: Some(rgba(0xea9d34ff).into()), - terminal_ansi_blue: Some(rgba(0x55949fff).into()), - terminal_ansi_magenta: Some(rgba(0x9079a9ff).into()), - terminal_ansi_cyan: Some(rgba(0xd7827dff).into()), - terminal_ansi_white: Some(rgba(0x575279ff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xb3627aff).into()), - error: Some(rgba(0xb3627aff).into()), - hidden: Some(rgba(0x797593ff).into()), - warning: Some(rgba(0xea9d34ff).into()), - ..Default::default() - }, - }, - }, - ], - } + use crate::{ + Appearance, ThemeColorsRefinement, StatusColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + }; + + pub fn rose_pine() -> UserThemeFamily { + UserThemeFamily { + name: "Rose Pine".into(), + author: "Rosé Pine".into(), + themes: vec![UserTheme { name: "Rose Pine".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x000000ff).into()),border_variant: Some(rgba(0x000000ff).into()),border_focused: Some(rgba(0x6e6a8633).into()),border_selected: Some(rgba(0x000000ff).into()),border_transparent: Some(rgba(0x000000ff).into()),border_disabled: Some(rgba(0x000000ff).into()),elevated_surface_background: Some(rgba(0x1f1d2eff).into()),surface_background: Some(rgba(0x1f1d2eff).into()),background: Some(rgba(0x191724ff).into()),element_background: Some(rgba(0xebbcbaff).into()),element_hover: Some(rgba(0x6e6a861a).into()),element_selected: Some(rgba(0x6e6a8633).into()),drop_target_background: Some(rgba(0x1f1d2eff).into()),ghost_element_hover: Some(rgba(0x6e6a861a).into()),text: Some(rgba(0xe0def4ff).into()),tab_inactive_background: Some(rgba(0x000000ff).into()),tab_active_background: Some(rgba(0x6e6a861a).into()),editor_background: Some(rgba(0x191724ff).into()),editor_gutter_background: Some(rgba(0x191724ff).into()),editor_line_number: Some(rgba(0x908caaff).into()),editor_active_line_number: Some(rgba(0xe0def4ff).into()),terminal_ansi_bright_black: Some(rgba(0x908caaff).into()),terminal_ansi_bright_red: Some(rgba(0xeb6f92ff).into()),terminal_ansi_bright_green: Some(rgba(0x30738fff).into()),terminal_ansi_bright_yellow: Some(rgba(0xf5c177ff).into()),terminal_ansi_bright_blue: Some(rgba(0x9ccfd8ff).into()),terminal_ansi_bright_magenta: Some(rgba(0xc4a7e7ff).into()),terminal_ansi_bright_cyan: Some(rgba(0xebbcbaff).into()),terminal_ansi_bright_white: Some(rgba(0xe0def4ff).into()),terminal_ansi_black: Some(rgba(0x26233aff).into()),terminal_ansi_red: Some(rgba(0xeb6f92ff).into()),terminal_ansi_green: Some(rgba(0x30738fff).into()),terminal_ansi_yellow: Some(rgba(0xf5c177ff).into()),terminal_ansi_blue: Some(rgba(0x9ccfd8ff).into()),terminal_ansi_magenta: Some(rgba(0xc4a7e7ff).into()),terminal_ansi_cyan: Some(rgba(0xebbcbaff).into()),terminal_ansi_white: Some(rgba(0xe0def4ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xeb6f92ff).into()),error: Some(rgba(0xeb6f92ff).into()),hidden: Some(rgba(0x908caaff).into()),warning: Some(rgba(0xf5c177ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x6e6a86ff).into()), ("something".into(), rgba(0x30738fff).into()), ("punctuation".into(), rgba(0x908caaff).into()), ("punctuation".into(), rgba(0x30738fff).into()), ("punctuation".into(), rgba(0x6e6a86ff).into()), ("something".into(), rgba(0xf5c177ff).into()), ("something".into(), rgba(0x9ccfd8ff).into()), ("something".into(), rgba(0xebbcbaff).into())] }) } }, UserTheme { name: "Rose Moon".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x000000ff).into()),border_variant: Some(rgba(0x000000ff).into()),border_focused: Some(rgba(0x817c9c26).into()),border_selected: Some(rgba(0x000000ff).into()),border_transparent: Some(rgba(0x000000ff).into()),border_disabled: Some(rgba(0x000000ff).into()),elevated_surface_background: Some(rgba(0x2a273eff).into()),surface_background: Some(rgba(0x2a273eff).into()),background: Some(rgba(0x232136ff).into()),element_background: Some(rgba(0xea9a97ff).into()),element_hover: Some(rgba(0x817c9c14).into()),element_selected: Some(rgba(0x817c9c26).into()),drop_target_background: Some(rgba(0x2a273eff).into()),ghost_element_hover: Some(rgba(0x817c9c14).into()),text: Some(rgba(0xe0def4ff).into()),tab_inactive_background: Some(rgba(0x000000ff).into()),tab_active_background: Some(rgba(0x817c9c14).into()),editor_background: Some(rgba(0x232136ff).into()),editor_gutter_background: Some(rgba(0x232136ff).into()),editor_line_number: Some(rgba(0x908caaff).into()),editor_active_line_number: Some(rgba(0xe0def4ff).into()),terminal_ansi_bright_black: Some(rgba(0x908caaff).into()),terminal_ansi_bright_red: Some(rgba(0xeb6f92ff).into()),terminal_ansi_bright_green: Some(rgba(0x3d8fb0ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xf5c177ff).into()),terminal_ansi_bright_blue: Some(rgba(0x9ccfd8ff).into()),terminal_ansi_bright_magenta: Some(rgba(0xc4a7e7ff).into()),terminal_ansi_bright_cyan: Some(rgba(0xea9a97ff).into()),terminal_ansi_bright_white: Some(rgba(0xe0def4ff).into()),terminal_ansi_black: Some(rgba(0x393552ff).into()),terminal_ansi_red: Some(rgba(0xeb6f92ff).into()),terminal_ansi_green: Some(rgba(0x3d8fb0ff).into()),terminal_ansi_yellow: Some(rgba(0xf5c177ff).into()),terminal_ansi_blue: Some(rgba(0x9ccfd8ff).into()),terminal_ansi_magenta: Some(rgba(0xc4a7e7ff).into()),terminal_ansi_cyan: Some(rgba(0xea9a97ff).into()),terminal_ansi_white: Some(rgba(0xe0def4ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xeb6f92ff).into()),error: Some(rgba(0xeb6f92ff).into()),hidden: Some(rgba(0x908caaff).into()),warning: Some(rgba(0xf5c177ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x6e6a86ff).into()), ("something".into(), rgba(0x3d8fb0ff).into()), ("punctuation".into(), rgba(0x908caaff).into()), ("punctuation".into(), rgba(0x3d8fb0ff).into()), ("punctuation".into(), rgba(0x6e6a86ff).into()), ("something".into(), rgba(0xf5c177ff).into()), ("something".into(), rgba(0x9ccfd8ff).into()), ("something".into(), rgba(0xea9a97ff).into())] }) } }, UserTheme { name: "Rose Pine Dawn".into(), appearance: Appearance::Light, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x000000ff).into()),border_variant: Some(rgba(0x000000ff).into()),border_focused: Some(rgba(0x6e6a8614).into()),border_selected: Some(rgba(0x000000ff).into()),border_transparent: Some(rgba(0x000000ff).into()),border_disabled: Some(rgba(0x000000ff).into()),elevated_surface_background: Some(rgba(0xfffaf3ff).into()),surface_background: Some(rgba(0xfffaf3ff).into()),background: Some(rgba(0xfaf4edff).into()),element_background: Some(rgba(0xd7827dff).into()),element_hover: Some(rgba(0x6e6a860d).into()),element_selected: Some(rgba(0x6e6a8614).into()),drop_target_background: Some(rgba(0xfffaf3ff).into()),ghost_element_hover: Some(rgba(0x6e6a860d).into()),text: Some(rgba(0x575279ff).into()),tab_inactive_background: Some(rgba(0x000000ff).into()),tab_active_background: Some(rgba(0x6e6a860d).into()),editor_background: Some(rgba(0xfaf4edff).into()),editor_gutter_background: Some(rgba(0xfaf4edff).into()),editor_line_number: Some(rgba(0x797593ff).into()),editor_active_line_number: Some(rgba(0x575279ff).into()),terminal_ansi_bright_black: Some(rgba(0x797593ff).into()),terminal_ansi_bright_red: Some(rgba(0xb3627aff).into()),terminal_ansi_bright_green: Some(rgba(0x276983ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xea9d34ff).into()),terminal_ansi_bright_blue: Some(rgba(0x55949fff).into()),terminal_ansi_bright_magenta: Some(rgba(0x9079a9ff).into()),terminal_ansi_bright_cyan: Some(rgba(0xd7827dff).into()),terminal_ansi_bright_white: Some(rgba(0x575279ff).into()),terminal_ansi_black: Some(rgba(0xf2e9e1ff).into()),terminal_ansi_red: Some(rgba(0xb3627aff).into()),terminal_ansi_green: Some(rgba(0x276983ff).into()),terminal_ansi_yellow: Some(rgba(0xea9d34ff).into()),terminal_ansi_blue: Some(rgba(0x55949fff).into()),terminal_ansi_magenta: Some(rgba(0x9079a9ff).into()),terminal_ansi_cyan: Some(rgba(0xd7827dff).into()),terminal_ansi_white: Some(rgba(0x575279ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xb3627aff).into()),error: Some(rgba(0xb3627aff).into()),hidden: Some(rgba(0x797593ff).into()),warning: Some(rgba(0xea9d34ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x9893a5ff).into()), ("something".into(), rgba(0x276983ff).into()), ("punctuation".into(), rgba(0x797593ff).into()), ("punctuation".into(), rgba(0x276983ff).into()), ("punctuation".into(), rgba(0x9893a5ff).into()), ("something".into(), rgba(0xea9d34ff).into()), ("something".into(), rgba(0x55949fff).into()), ("something".into(), rgba(0xd7827dff).into())] }) } }], } + } + \ No newline at end of file diff --git a/crates/theme2/src/themes/solarized.rs b/crates/theme2/src/themes/solarized.rs index 01e3ab9eaf9cc23fdf5240bc6dc6121a6d3bd2a8..e3a15deb4861a0b6cd49eed4725b77990a8582a8 100644 --- a/crates/theme2/src/themes/solarized.rs +++ b/crates/theme2/src/themes/solarized.rs @@ -1,111 +1,18 @@ -// This file was generated by the `theme_importer`. -// Be careful when modifying it by hand. -use gpui::rgba; + // This file was generated by the `theme_importer`. + // Be careful when modifying it by hand. -use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, - UserThemeStylesRefinement, -}; + use gpui::rgba; -pub fn solarized() -> UserThemeFamily { - UserThemeFamily { - name: "Solarized".into(), - author: "Ethan Schoonover (altercation)".into(), - themes: vec![ - UserTheme { - name: "Solarized Dark".into(), - appearance: Appearance::Dark, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0x003847ff).into()), - border_variant: Some(rgba(0x003847ff).into()), - border_focused: Some(rgba(0x29a19899).into()), - border_selected: Some(rgba(0x003847ff).into()), - border_transparent: Some(rgba(0x003847ff).into()), - border_disabled: Some(rgba(0x003847ff).into()), - background: Some(rgba(0x002a35ff).into()), - element_background: Some(rgba(0x29a19899).into()), - element_hover: Some(rgba(0x004353aa).into()), - element_selected: Some(rgba(0x005a6fff).into()), - drop_target_background: Some(rgba(0x00435388).into()), - ghost_element_hover: Some(rgba(0x004353aa).into()), - tab_inactive_background: Some(rgba(0x003f51ff).into()), - tab_active_background: Some(rgba(0x002a36ff).into()), - editor_background: Some(rgba(0x002a35ff).into()), - editor_gutter_background: Some(rgba(0x002a35ff).into()), - editor_line_number: Some(rgba(0x566c74ff).into()), - terminal_ansi_bright_black: Some(rgba(0x586e75ff).into()), - terminal_ansi_bright_red: Some(rgba(0xcb4b15ff).into()), - terminal_ansi_bright_green: Some(rgba(0x859900ff).into()), - terminal_ansi_bright_yellow: Some(rgba(0x657b83ff).into()), - terminal_ansi_bright_blue: Some(rgba(0x839496ff).into()), - terminal_ansi_bright_magenta: Some(rgba(0x6c71c4ff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x93a1a1ff).into()), - terminal_ansi_bright_white: Some(rgba(0x839496ff).into()), - terminal_ansi_black: Some(rgba(0x063642ff).into()), - terminal_ansi_red: Some(rgba(0xdc312eff).into()), - terminal_ansi_green: Some(rgba(0x859900ff).into()), - terminal_ansi_yellow: Some(rgba(0xb58800ff).into()), - terminal_ansi_blue: Some(rgba(0x258ad2ff).into()), - terminal_ansi_magenta: Some(rgba(0xd33582ff).into()), - terminal_ansi_cyan: Some(rgba(0x29a198ff).into()), - terminal_ansi_white: Some(rgba(0x839496ff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xffeaeaff).into()), - error: Some(rgba(0xffeaeaff).into()), - hidden: Some(rgba(0x93a1a1ff).into()), - ..Default::default() - }, - }, - }, - UserTheme { - name: "Solarized Light".into(), - appearance: Appearance::Light, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border: Some(rgba(0xddd6c1ff).into()), - border_variant: Some(rgba(0xddd6c1ff).into()), - border_focused: Some(rgba(0xd3af86ff).into()), - border_selected: Some(rgba(0xddd6c1ff).into()), - border_transparent: Some(rgba(0xddd6c1ff).into()), - border_disabled: Some(rgba(0xddd6c1ff).into()), - background: Some(rgba(0xfdf6e3ff).into()), - element_background: Some(rgba(0xab9d56ff).into()), - element_hover: Some(rgba(0xdec98744).into()), - element_selected: Some(rgba(0xdec987ff).into()), - ghost_element_hover: Some(rgba(0xdec98744).into()), - tab_inactive_background: Some(rgba(0xd3cbb7ff).into()), - tab_active_background: Some(rgba(0xfdf6e3ff).into()), - editor_background: Some(rgba(0xfdf6e3ff).into()), - editor_gutter_background: Some(rgba(0xfdf6e3ff).into()), - editor_line_number: Some(rgba(0x9ca8a6ff).into()), - terminal_ansi_bright_black: Some(rgba(0x657b83ff).into()), - terminal_ansi_bright_red: Some(rgba(0xcb4b15ff).into()), - terminal_ansi_bright_green: Some(rgba(0x859900ff).into()), - terminal_ansi_bright_yellow: Some(rgba(0x657b83ff).into()), - terminal_ansi_bright_blue: Some(rgba(0x839496ff).into()), - terminal_ansi_bright_magenta: Some(rgba(0x6c71c4ff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x93a1a1ff).into()), - terminal_ansi_bright_white: Some(rgba(0xeee8d5ff).into()), - terminal_ansi_black: Some(rgba(0x657b83ff).into()), - terminal_ansi_red: Some(rgba(0xdc312eff).into()), - terminal_ansi_green: Some(rgba(0x859900ff).into()), - terminal_ansi_yellow: Some(rgba(0xb58800ff).into()), - terminal_ansi_blue: Some(rgba(0x258ad2ff).into()), - terminal_ansi_magenta: Some(rgba(0xd33582ff).into()), - terminal_ansi_cyan: Some(rgba(0x29a198ff).into()), - terminal_ansi_white: Some(rgba(0xeee8d5ff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - hidden: Some(rgba(0x586e75ff).into()), - ..Default::default() - }, - }, - }, - ], - } + use crate::{ + Appearance, ThemeColorsRefinement, StatusColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + }; + + pub fn solarized() -> UserThemeFamily { + UserThemeFamily { + name: "Solarized".into(), + author: "Ethan Schoonover (altercation)".into(), + themes: vec![UserTheme { name: "Solarized Dark".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x003847ff).into()),border_variant: Some(rgba(0x003847ff).into()),border_focused: Some(rgba(0x29a19899).into()),border_selected: Some(rgba(0x003847ff).into()),border_transparent: Some(rgba(0x003847ff).into()),border_disabled: Some(rgba(0x003847ff).into()),background: Some(rgba(0x002a35ff).into()),element_background: Some(rgba(0x29a19899).into()),element_hover: Some(rgba(0x004353aa).into()),element_selected: Some(rgba(0x005a6fff).into()),drop_target_background: Some(rgba(0x00435388).into()),ghost_element_hover: Some(rgba(0x004353aa).into()),tab_inactive_background: Some(rgba(0x003f51ff).into()),tab_active_background: Some(rgba(0x002a36ff).into()),editor_background: Some(rgba(0x002a35ff).into()),editor_gutter_background: Some(rgba(0x002a35ff).into()),editor_line_number: Some(rgba(0x566c74ff).into()),terminal_ansi_bright_black: Some(rgba(0x586e75ff).into()),terminal_ansi_bright_red: Some(rgba(0xcb4b15ff).into()),terminal_ansi_bright_green: Some(rgba(0x859900ff).into()),terminal_ansi_bright_yellow: Some(rgba(0x657b83ff).into()),terminal_ansi_bright_blue: Some(rgba(0x839496ff).into()),terminal_ansi_bright_magenta: Some(rgba(0x6c71c4ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x93a1a1ff).into()),terminal_ansi_bright_white: Some(rgba(0x839496ff).into()),terminal_ansi_black: Some(rgba(0x063642ff).into()),terminal_ansi_red: Some(rgba(0xdc312eff).into()),terminal_ansi_green: Some(rgba(0x859900ff).into()),terminal_ansi_yellow: Some(rgba(0xb58800ff).into()),terminal_ansi_blue: Some(rgba(0x258ad2ff).into()),terminal_ansi_magenta: Some(rgba(0xd33582ff).into()),terminal_ansi_cyan: Some(rgba(0x29a198ff).into()),terminal_ansi_white: Some(rgba(0x839496ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xffeaeaff).into()),error: Some(rgba(0xffeaeaff).into()),hidden: Some(rgba(0x93a1a1ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x657b83ff).into()), ("something".into(), rgba(0x29a198ff).into()), ("something".into(), rgba(0x93a1a1ff).into()), ("punctuation".into(), rgba(0x859900ff).into()), ("punctuation".into(), rgba(0xd30001ff).into()), ("punctuation".into(), rgba(0xd30001ff).into()), ("punctuation".into(), rgba(0x657b83ff).into())] }) } }, UserTheme { name: "Solarized Light".into(), appearance: Appearance::Light, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0xddd6c1ff).into()),border_variant: Some(rgba(0xddd6c1ff).into()),border_focused: Some(rgba(0xd3af86ff).into()),border_selected: Some(rgba(0xddd6c1ff).into()),border_transparent: Some(rgba(0xddd6c1ff).into()),border_disabled: Some(rgba(0xddd6c1ff).into()),background: Some(rgba(0xfdf6e3ff).into()),element_background: Some(rgba(0xab9d56ff).into()),element_hover: Some(rgba(0xdec98744).into()),element_selected: Some(rgba(0xdec987ff).into()),ghost_element_hover: Some(rgba(0xdec98744).into()),tab_inactive_background: Some(rgba(0xd3cbb7ff).into()),tab_active_background: Some(rgba(0xfdf6e3ff).into()),editor_background: Some(rgba(0xfdf6e3ff).into()),editor_gutter_background: Some(rgba(0xfdf6e3ff).into()),editor_line_number: Some(rgba(0x9ca8a6ff).into()),terminal_ansi_bright_black: Some(rgba(0x657b83ff).into()),terminal_ansi_bright_red: Some(rgba(0xcb4b15ff).into()),terminal_ansi_bright_green: Some(rgba(0x859900ff).into()),terminal_ansi_bright_yellow: Some(rgba(0x657b83ff).into()),terminal_ansi_bright_blue: Some(rgba(0x839496ff).into()),terminal_ansi_bright_magenta: Some(rgba(0x6c71c4ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x93a1a1ff).into()),terminal_ansi_bright_white: Some(rgba(0xeee8d5ff).into()),terminal_ansi_black: Some(rgba(0x657b83ff).into()),terminal_ansi_red: Some(rgba(0xdc312eff).into()),terminal_ansi_green: Some(rgba(0x859900ff).into()),terminal_ansi_yellow: Some(rgba(0xb58800ff).into()),terminal_ansi_blue: Some(rgba(0x258ad2ff).into()),terminal_ansi_magenta: Some(rgba(0xd33582ff).into()),terminal_ansi_cyan: Some(rgba(0x29a198ff).into()),terminal_ansi_white: Some(rgba(0xeee8d5ff).into()),..Default::default()}, status: StatusColorsRefinement {hidden: Some(rgba(0x586e75ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x93a1a1ff).into()), ("something".into(), rgba(0x29a198ff).into()), ("something".into(), rgba(0x063642ff).into()), ("punctuation".into(), rgba(0x859900ff).into()), ("punctuation".into(), rgba(0xd30001ff).into()), ("punctuation".into(), rgba(0xd30001ff).into()), ("punctuation".into(), rgba(0x93a1a1ff).into()), ("punctuation".into(), rgba(0x93a1a1ff).into()), ("something".into(), rgba(0x657b83ff).into())] }) } }], } + } + \ No newline at end of file diff --git a/crates/theme2/src/themes/synthwave_84.rs b/crates/theme2/src/themes/synthwave_84.rs index f18b9f9409ba8f0b03dd8c4ca46855d391224f8c..ad4677c799b3f231cf2847e52b6a15da99703527 100644 --- a/crates/theme2/src/themes/synthwave_84.rs +++ b/crates/theme2/src/themes/synthwave_84.rs @@ -1,55 +1,18 @@ -// This file was generated by the `theme_importer`. -// Be careful when modifying it by hand. -use gpui::rgba; + // This file was generated by the `theme_importer`. + // Be careful when modifying it by hand. -use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, - UserThemeStylesRefinement, -}; + use gpui::rgba; -pub fn synthwave_84() -> UserThemeFamily { - UserThemeFamily { - name: "Synthwave 84".into(), - author: "Robb Owen (robb0wen)".into(), - themes: vec![UserTheme { - name: "Synthwave 84".into(), - appearance: Appearance::Dark, - styles: UserThemeStylesRefinement { - colors: ThemeColorsRefinement { - border_focused: Some(rgba(0x1f212bff).into()), - background: Some(rgba(0x252334ff).into()), - element_background: Some(rgba(0x614d85ff).into()), - element_hover: Some(rgba(0x37294d99).into()), - element_selected: Some(rgba(0xffffff20).into()), - drop_target_background: Some(rgba(0x34294f66).into()), - ghost_element_hover: Some(rgba(0x37294d99).into()), - text: Some(rgba(0xffffffff).into()), - tab_inactive_background: Some(rgba(0x252334ff).into()), - editor_background: Some(rgba(0x252334ff).into()), - editor_gutter_background: Some(rgba(0x252334ff).into()), - editor_line_number: Some(rgba(0xffffff73).into()), - terminal_ansi_bright_red: Some(rgba(0xfe444fff).into()), - terminal_ansi_bright_green: Some(rgba(0x71f1b7ff).into()), - terminal_ansi_bright_yellow: Some(rgba(0xfede5cff).into()), - terminal_ansi_bright_blue: Some(rgba(0x02edf9ff).into()), - terminal_ansi_bright_magenta: Some(rgba(0xff7ddaff).into()), - terminal_ansi_bright_cyan: Some(rgba(0x02edf9ff).into()), - terminal_ansi_red: Some(rgba(0xfe444fff).into()), - terminal_ansi_green: Some(rgba(0x71f1b7ff).into()), - terminal_ansi_yellow: Some(rgba(0xf3e70fff).into()), - terminal_ansi_blue: Some(rgba(0x02edf9ff).into()), - terminal_ansi_magenta: Some(rgba(0xff7ddaff).into()), - terminal_ansi_cyan: Some(rgba(0x02edf9ff).into()), - ..Default::default() - }, - status: StatusColorsRefinement { - deleted: Some(rgba(0xfe444fff).into()), - error: Some(rgba(0xfe444fff).into()), - warning: Some(rgba(0x71f1b7bb).into()), - ..Default::default() - }, - }, - }], - } + use crate::{ + Appearance, ThemeColorsRefinement, StatusColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + }; + + pub fn synthwave_84() -> UserThemeFamily { + UserThemeFamily { + name: "Synthwave 84".into(), + author: "Robb Owen (robb0wen)".into(), + themes: vec![UserTheme { name: "Synthwave 84".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border_focused: Some(rgba(0x1f212bff).into()),background: Some(rgba(0x252334ff).into()),element_background: Some(rgba(0x614d85ff).into()),element_hover: Some(rgba(0x37294d99).into()),element_selected: Some(rgba(0xffffff20).into()),drop_target_background: Some(rgba(0x34294f66).into()),ghost_element_hover: Some(rgba(0x37294d99).into()),text: Some(rgba(0xffffffff).into()),tab_inactive_background: Some(rgba(0x252334ff).into()),editor_background: Some(rgba(0x252334ff).into()),editor_gutter_background: Some(rgba(0x252334ff).into()),editor_line_number: Some(rgba(0xffffff73).into()),terminal_ansi_bright_red: Some(rgba(0xfe444fff).into()),terminal_ansi_bright_green: Some(rgba(0x71f1b7ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xfede5cff).into()),terminal_ansi_bright_blue: Some(rgba(0x02edf9ff).into()),terminal_ansi_bright_magenta: Some(rgba(0xff7ddaff).into()),terminal_ansi_bright_cyan: Some(rgba(0x02edf9ff).into()),terminal_ansi_red: Some(rgba(0xfe444fff).into()),terminal_ansi_green: Some(rgba(0x71f1b7ff).into()),terminal_ansi_yellow: Some(rgba(0xf3e70fff).into()),terminal_ansi_blue: Some(rgba(0x02edf9ff).into()),terminal_ansi_magenta: Some(rgba(0xff7ddaff).into()),terminal_ansi_cyan: Some(rgba(0x02edf9ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xfe444fff).into()),error: Some(rgba(0xfe444fff).into()),warning: Some(rgba(0x71f1b7bb).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x848bbdff).into()), ("something".into(), rgba(0xff7ddaff).into()), ("something".into(), rgba(0xf97d71ff).into()), ("punctuation".into(), rgba(0x35f9f5ff).into()), ("something".into(), rgba(0xfe444fff).into()), ("punctuation".into(), rgba(0xfede5cff).into())] }) } }], } + } + \ No newline at end of file diff --git a/crates/theme2/src/user_theme.rs b/crates/theme2/src/user_theme.rs index 0667359dfbda5cefa933664a174ee4e9019d7ebb..f0287bfb7269ec07ece862f119019e9ee48566c9 100644 --- a/crates/theme2/src/user_theme.rs +++ b/crates/theme2/src/user_theme.rs @@ -1,3 +1,4 @@ +use gpui::Hsla; use refineable::Refineable; use serde::Deserialize; @@ -24,4 +25,21 @@ pub struct UserThemeStyles { pub colors: ThemeColors, #[refineable] pub status: StatusColors, + pub syntax: UserSyntaxTheme, +} + +#[derive(Clone, Default, Deserialize)] +pub struct UserSyntaxTheme { + pub highlights: Vec<(String, UserHighlightStyle)>, +} + +#[derive(Clone, Default, Deserialize)] +pub struct UserHighlightStyle { + pub color: Option, +} + +impl UserHighlightStyle { + pub fn is_empty(&self) -> bool { + self.color.is_none() + } } diff --git a/crates/theme_importer/src/main.rs b/crates/theme_importer/src/main.rs index 6981ae41707a71ab62294d0b276145b88bc61d5f..531d4913faae614a4f5d0d679b5788509231c0ab 100644 --- a/crates/theme_importer/src/main.rs +++ b/crates/theme_importer/src/main.rs @@ -1,6 +1,7 @@ mod theme_printer; mod util; mod vscode; +mod vscode_syntax; use std::fs::{self, File}; use std::io::Write; diff --git a/crates/theme_importer/src/theme_printer.rs b/crates/theme_importer/src/theme_printer.rs index ba85fb94412295c604b40843ae0976aee5534b11..e114584d836deeec05def5433f4eb20158eb66b7 100644 --- a/crates/theme_importer/src/theme_printer.rs +++ b/crates/theme_importer/src/theme_printer.rs @@ -2,8 +2,8 @@ use std::fmt::{self, Debug}; use gpui::{Hsla, Rgba}; use theme::{ - Appearance, PlayerColor, PlayerColors, StatusColors, StatusColorsRefinement, SyntaxTheme, - SystemColors, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, PlayerColor, PlayerColors, StatusColorsRefinement, SystemColors, + ThemeColorsRefinement, UserSyntaxTheme, UserTheme, UserThemeFamily, UserThemeStylesRefinement, }; struct RawSyntaxPrinter<'a>(&'a str); @@ -30,6 +30,17 @@ impl<'a, D: Debug> Debug for IntoPrinter<'a, D> { } } +pub struct OptionPrinter<'a, T>(&'a Option); + +impl<'a, T: Debug> Debug for OptionPrinter<'a, T> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self.0 { + Some(value) => write!(f, "Some({:?})", value), + None => write!(f, "None"), + } + } +} + pub struct VecPrinter<'a, T>(&'a Vec); impl<'a, T: Debug> Debug for VecPrinter<'a, T> { @@ -93,6 +104,16 @@ impl<'a> Debug for UserThemeStylesRefinementPrinter<'a> { f.debug_struct("UserThemeStylesRefinement") .field("colors", &ThemeColorsRefinementPrinter(&self.0.colors)) .field("status", &StatusColorsRefinementPrinter(&self.0.status)) + .field( + "syntax", + &OptionPrinter( + &self + .0 + .syntax + .as_ref() + .map(|syntax| UserSyntaxThemePrinter(syntax)), + ), + ) .finish() } } @@ -316,11 +337,11 @@ impl<'a> Debug for PlayerColorPrinter<'a> { } } -pub struct SyntaxThemePrinter<'a>(&'a SyntaxTheme); +pub struct UserSyntaxThemePrinter<'a>(&'a UserSyntaxTheme); -impl<'a> Debug for SyntaxThemePrinter<'a> { +impl<'a> Debug for UserSyntaxThemePrinter<'a> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("SyntaxTheme") + f.debug_struct("UserSyntaxTheme") .field( "highlights", &VecPrinter( diff --git a/crates/theme_importer/src/vscode.rs b/crates/theme_importer/src/vscode.rs index 2eb80fc53f23a92b27126d2d19841ba325585102..9ebb0c7b528fc41c97d31c6d3c013bff1abd86a8 100644 --- a/crates/theme_importer/src/vscode.rs +++ b/crates/theme_importer/src/vscode.rs @@ -1,9 +1,13 @@ use anyhow::Result; use gpui::{Hsla, Rgba}; use serde::Deserialize; -use theme::{StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeStylesRefinement}; +use theme::{ + StatusColorsRefinement, ThemeColorsRefinement, UserSyntaxTheme, UserTheme, + UserThemeStylesRefinement, +}; use crate::util::Traverse; +use crate::vscode_syntax::VsCodeTokenColor; use crate::ThemeMetadata; #[derive(Deserialize, Debug)] @@ -18,6 +22,8 @@ pub struct VsCodeTheme { #[serde(rename = "semanticHighlighting")] pub semantic_highlighting: Option, pub colors: VsCodeColors, + #[serde(rename = "tokenColors")] + pub token_colors: Vec, } #[derive(Debug, Deserialize)] @@ -413,7 +419,7 @@ pub struct VsCodeColors { pub list_filter_widget_no_matches_outline: Option, } -fn try_parse_color(color: &str) -> Result { +pub(crate) fn try_parse_color(color: &str) -> Result { Ok(Rgba::try_from(color)?.into()) } @@ -618,12 +624,23 @@ impl VsCodeThemeConverter { ..Default::default() }; + let mut highlight_styles = Vec::new(); + + for token_color in self.theme.token_colors { + highlight_styles.extend(token_color.highlight_styles()?); + } + + let syntax_theme = UserSyntaxTheme { + highlights: highlight_styles, + }; + Ok(UserTheme { name: self.theme_metadata.name.into(), appearance, styles: UserThemeStylesRefinement { colors: theme_colors_refinements, status: status_color_refinements, + syntax: Some(syntax_theme), }, }) } diff --git a/crates/theme_importer/src/vscode_syntax.rs b/crates/theme_importer/src/vscode_syntax.rs new file mode 100644 index 0000000000000000000000000000000000000000..7891c43235695a41adbab767473a4aed59aac8c3 --- /dev/null +++ b/crates/theme_importer/src/vscode_syntax.rs @@ -0,0 +1,261 @@ +// Create ThemeSyntaxRefinement +// Map tokenColors style to HighlightStyle (fontStyle, foreground, background) +// Take in the scopes from the tokenColors and try to match each to our HighlightStyles + +use anyhow::Result; +use serde::Deserialize; +use theme::UserHighlightStyle; + +use crate::{util::Traverse, vscode::try_parse_color}; + +#[derive(Debug, Deserialize)] +#[serde(untagged)] +pub enum VsCodeTokenScope { + One(String), + Many(Vec), +} + +#[derive(Debug, Deserialize)] +pub struct VsCodeTokenColor { + pub scope: Option, + pub settings: VsCodeTokenColorSettings, +} + +#[derive(Debug, Deserialize)] +pub struct VsCodeTokenColorSettings { + pub foreground: Option, + pub background: Option, + #[serde(rename = "fontStyle")] + pub font_style: Option, +} + +impl VsCodeTokenColor { + pub fn highlight_styles(&self) -> Result> { + let mut highlight_styles = Vec::new(); + + let scope = match self.scope { + Some(VsCodeTokenScope::One(ref scope)) => vec![scope.clone()], + Some(VsCodeTokenScope::Many(ref scopes)) => scopes.clone(), + None => return Ok(Vec::new()), + }; + + for scope in &scope { + let Some(syntax_token) = Self::to_zed_token(&scope) else { + continue; + }; + + let highlight_style = UserHighlightStyle { + color: self + .settings + .foreground + .as_ref() + .traverse(|color| try_parse_color(&color))?, + }; + + if highlight_style.is_empty() { + continue; + } + + highlight_styles.push((syntax_token, highlight_style)); + } + + Ok(highlight_styles) + } + + fn to_zed_token(scope: &str) -> Option { + match scope { + "attribute" => Some("attribute".to_string()), + "boolean" => Some("boolean".to_string()), + "comment" => Some("comment".to_string()), + "comment.doc" => Some("comment.doc".to_string()), + "punctuation" + | "punctuation.accessor" + | "punctuation.definition.array.begin.json" + | "punctuation.definition.array.end.json" + | "punctuation.definition.dictionary.begin.json" + | "punctuation.definition.dictionary.end.json" + | "punctuation.definition.markdown" + | "punctuation.definition.tag" + | "punctuation.definition.tag.begin" + | "punctuation.definition.tag.end" + | "punctuation.definition.template-expression" + | "punctuation.definition.variable" + | "punctuation.section" + | "punctuation.section.embedded" + | "punctuation.section.embedded.begin" + | "punctuation.section.embedded.end" + | "punctuation.separator" + | "punctuation.separator.array.json" + | "punctuation.separator.dictionary.key-value.json" + | "punctuation.separator.dictionary.pair.json" => Some("punctuation".to_string()), + + // --- + "constant" | "character" | "language" | "language.python" | "numeric" | "other" + | "other.symbol" => Some("something".to_string()), + + "entity" + | "name" + | "name.class" + | "name.filename.find-in-files" + | "name.function" + | "name.function.python" + | "name.import" + | "name.package" + | "name.tag" + | "name.type" + | "name.type.class.python" + | "other.attribute-name" + | "other.inherited-class" => Some("something".to_string()), + + "markup" | "bold" | "changed" | "deleted" | "heading" | "heading.setext" + | "inline.raw" | "italic" | "list" | "quote" | "raw" | "raw.inline" | "strike" + | "table" | "underline.link" => Some("something".to_string()), + + "source" => Some("something".to_string()), + "storage" => Some("something".to_string()), + "string" => Some("something".to_string()), + "support" => Some("something".to_string()), + "text" => Some("something".to_string()), + "token" => Some("something".to_string()), + "variable" => Some("something".to_string()), + _ => None, + } + } +} + +// "comment" => "" +// "constant.character" => "" +// "constant.language" => "" +// "constant.language.python" => "" +// "constant.numeric" => "" +// "constant.numeric.line-number.find-in-files - match" => "" +// "constant.numeric.line-number.match" => "" +// "constant.other" => "" +// "constant.other.symbol" => "" +// "entity.name" => "" +// "entity.name.class" => "" +// "entity.name.filename.find-in-files" => "" +// "entity.name.function" => "" +// "entity.name.function.python" => "" +// "entity.name.import" => "" +// "entity.name.package" => "" +// "entity.name.tag" => "" +// "entity.name.type" => "" +// "entity.name.type.class.python" => "" +// "entity.other.attribute-name" => "" +// "entity.other.inherited-class" => "" +// "invalid" => "" +// "keyword" => "" +// "keyword.control.from" => "" +// "keyword.control.import" => "" +// "keyword.operator" => "" +// "keyword.other.new" => "" +// "markup.bold markup.italic" => "" +// "markup.bold" => "" +// "markup.changed" => "" +// "markup.deleted" => "" +// "markup.heading entity.name" => "" +// "markup.heading" => "" +// "markup.heading.setext" => "" +// "markup.inline.raw" => "" +// "markup.inserted" => "" +// "markup.inserted" => "" +// "markup.italic markup.bold" => "" +// "markup.italic" => "" +// "markup.list punctuation.definition.list.begin" => "" +// "markup.list" => "" +// "markup.quote" => "" +// "markup.raw" => "" +// "markup.raw.inline" => "" +// "markup.strike" => "" +// "markup.table" => "" +// "markup.underline.link" => "" +// "message.error" => "" +// "meta.decorator punctuation.decorator" => "" +// "meta.decorator variable.other" => "" +// "meta.diff" => "" +// "meta.diff.header" => "" +// "meta.embedded" => "" +// "meta.function-call" => "" +// "meta.function-call.generic" => "" +// "meta.import" => "" +// "meta.parameter" => "" +// "meta.preprocessor" => "" +// "meta.separator" => "" +// "meta.tag.sgml" => "" +// "punctuation.accessor" => "" +// "punctuation.definition.array.begin.json" => "" +// "punctuation.definition.array.end.json" => "" +// "punctuation.definition.dictionary.begin.json" => "" +// "punctuation.definition.dictionary.end.json" => "" +// "punctuation.definition.markdown" => "" +// "punctuation.definition.tag" => "" +// "punctuation.definition.tag.begin" => "" +// "punctuation.definition.tag.end" => "" +// "punctuation.definition.template-expression" => "" +// "punctuation.definition.variable" => "" +// "punctuation.section" => "" +// "punctuation.section.embedded" => "" +// "punctuation.section.embedded.begin" => "" +// "punctuation.section.embedded.end" => "" +// "punctuation.separator" => "" +// "punctuation.separator.array.json" => "" +// "punctuation.separator.dictionary.key-value.json" => "" +// "punctuation.separator.dictionary.pair.json" => "" +// "punctuation.terminator" => "" +// "source.c storage.type" => "" +// "source.css entity.name.tag" => "" +// "source.css support.type" => "" +// "source.go storage.type" => "" +// "source.groovy.embedded" => "" +// "source.haskell storage.type" => "" +// "source.java storage.type" => "" +// "source.java storage.type.primitive" => "" +// "source.less entity.name.tag" => "" +// "source.less support.type" => "" +// "source.python" => "" +// "source.ruby variable.other.readwrite" => "" +// "source.sass entity.name.tag" => "" +// "source.sass support.type" => "" +// "source.scss entity.name.tag" => "" +// "source.scss support.type" => "" +// "source.stylus entity.name.tag" => "" +// "source.stylus support.type" => "" +// "source.ts" => "" +// "storage" => "" +// "storage.modifier" => "" +// "storage.modifier.async" => "" +// "storage.modifier.tsx" => "" +// "storage.type.annotation" => "" +// "storage.type.function" => "" +// "string" => "" +// "string.other.link" => "" +// "string.regexp" => "" +// "support.class" => "" +// "support.class.component" => "" +// "support.constant" => "" +// "support.function" => "" +// "support.function.construct" => "" +// "support.function.go" => "" +// "support.macro" => "" +// "support.other.variable" => "" +// "support.type" => "" +// "support.type.exception" => "" +// "support.type.primitive" => "" +// "support.type.property-name" => "" +// "support.type.python" => "" +// "text.html.markdown markup.inline.raw" => "" +// "text.html.markdown meta.dummy.line-break" => "" +// "token.debug-token" => "" +// "token.error-token" => "" +// "token.info-token" => "" +// "token.warn-token" => "" +// "variable" => "" +// "variable.annotation" => "" +// "variable.function" => "" +// "variable.language" => "" +// "variable.member" => "" +// "variable.object.property" => "" +// "variable.other" => "" +// "variable.parameter" => "" +// "variable.parameter.function-call" => "" From 194d6156916671f035b454118bfdae0eccb65791 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Thu, 9 Nov 2023 18:33:36 +0100 Subject: [PATCH 16/76] Fix up keybindings propagation Co-authored-by: Conrad --- assets/keymaps/default.json | 3 +-- .../command_palette2/src/command_palette.rs | 5 ++--- crates/editor2/src/element.rs | 4 ++++ crates/gpui2/src/interactive.rs | 1 + crates/gpui2/src/keymap/binding.rs | 13 ++++++++++++ crates/gpui2/src/keymap/matcher.rs | 1 + crates/workspace2/src/modal_layer.rs | 20 ++++++++++++++----- crates/workspace2/src/workspace2.rs | 7 ++++--- 8 files changed, 41 insertions(+), 13 deletions(-) diff --git a/assets/keymaps/default.json b/assets/keymaps/default.json index b18cb4a7ae245f7906a7d1c50b097e90209a8911..ef6a655bdcead3cd64f29e9aa25b90d0d4e4d626 100644 --- a/assets/keymaps/default.json +++ b/assets/keymaps/default.json @@ -387,8 +387,7 @@ } }, { - // todo!() fix context - // "context": "Workspace", + "context": "Workspace", "bindings": { "cmd-1": ["workspace::ActivatePane", 0], "cmd-2": ["workspace::ActivatePane", 1], diff --git a/crates/command_palette2/src/command_palette.rs b/crates/command_palette2/src/command_palette.rs index dd0490082ea04d450b86d93893c1754c2cd0e72d..46b099ea3c2d5e10c2fd9e1250e6351842f9bddb 100644 --- a/crates/command_palette2/src/command_palette.rs +++ b/crates/command_palette2/src/command_palette.rs @@ -3,8 +3,8 @@ use collections::{CommandPaletteFilter, HashMap}; use fuzzy::{StringMatch, StringMatchCandidate}; use gpui::{ actions, div, Action, AnyElement, AnyWindowHandle, AppContext, BorrowWindow, Div, Element, - EventEmitter, FocusHandle, Keystroke, ParentElement, Render, View, ViewContext, VisualContext, - WeakView, + EventEmitter, FocusHandle, Keystroke, ParentElement, Render, Styled, View, ViewContext, + VisualContext, WeakView, }; use picker::{Picker, PickerDelegate}; use std::cmp::{self, Reverse}; @@ -60,7 +60,6 @@ impl Render for CommandPalette { type Element = Div; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { - dbg!("Rendering"); modal(cx).w_96().child(self.picker.clone()) } } diff --git a/crates/editor2/src/element.rs b/crates/editor2/src/element.rs index 3e77a66936443aa872fc6f196fb71257bfede82f..8dbe989b1f4d5e38842eb00b6bca71701845bc1e 100644 --- a/crates/editor2/src/element.rs +++ b/crates/editor2/src/element.rs @@ -4149,12 +4149,16 @@ fn build_key_listeners( build_key_listener( move |editor, key_down: &KeyDownEvent, dispatch_context, phase, cx| { if phase == DispatchPhase::Bubble { + dbg!(&dispatch_context); if let KeyMatch::Some(action) = cx.match_keystroke( &global_element_id, &key_down.keystroke, dispatch_context, ) { + dbg!("got action", &action); return Some(action); + } else { + dbg!("not action"); } } diff --git a/crates/gpui2/src/interactive.rs b/crates/gpui2/src/interactive.rs index a546c1b40b9cbb073f3539133c29b1714fffd951..51efde62c11e7b33bf5bb50f39114040108166d0 100644 --- a/crates/gpui2/src/interactive.rs +++ b/crates/gpui2/src/interactive.rs @@ -414,6 +414,7 @@ pub trait ElementInteractivity: 'static { Box::new(move |_, key_down, context, phase, cx| { if phase == DispatchPhase::Bubble { let key_down = key_down.downcast_ref::().unwrap(); + dbg!(&context); if let KeyMatch::Some(action) = cx.match_keystroke(&global_id, &key_down.keystroke, context) { diff --git a/crates/gpui2/src/keymap/binding.rs b/crates/gpui2/src/keymap/binding.rs index 829f7a3b2cfa7a816b76ebc7c1acd3229b57aa18..67041dc4885cbe1ec05bf8db16ec25880d11288b 100644 --- a/crates/gpui2/src/keymap/binding.rs +++ b/crates/gpui2/src/keymap/binding.rs @@ -44,6 +44,19 @@ impl KeyBinding { pending_keystrokes: &[Keystroke], contexts: &[&DispatchContext], ) -> KeyMatch { + let should_debug = self.keystrokes.len() == 1 + && self.keystrokes[0].key == "p" + && self.keystrokes[0].modifiers.command == true + && self.keystrokes[0].modifiers.shift == true; + + if false && should_debug { + dbg!( + &self.keystrokes, + &pending_keystrokes, + &contexts, + &self.matches_context(contexts) + ); + } if self.keystrokes.as_ref().starts_with(&pending_keystrokes) && self.matches_context(contexts) { diff --git a/crates/gpui2/src/keymap/matcher.rs b/crates/gpui2/src/keymap/matcher.rs index c2033a95953a46479c02bfef69f432f0c877b3ae..c86b65c47e55fff8b689f8fd477e3a2569513e5f 100644 --- a/crates/gpui2/src/keymap/matcher.rs +++ b/crates/gpui2/src/keymap/matcher.rs @@ -46,6 +46,7 @@ impl KeyMatcher { keystroke: &Keystroke, context_stack: &[&DispatchContext], ) -> KeyMatch { + dbg!(keystroke, &context_stack); let keymap = self.keymap.lock(); // Clear pending keystrokes if the keymap has changed since the last matched keystroke. if keymap.version() != self.keymap_version { diff --git a/crates/workspace2/src/modal_layer.rs b/crates/workspace2/src/modal_layer.rs index a5760380f5efa6f138f237a0eb3ae3a0e34216de..fc85ae835130964b4a0fd67ff74d579030a2e34d 100644 --- a/crates/workspace2/src/modal_layer.rs +++ b/crates/workspace2/src/modal_layer.rs @@ -1,7 +1,7 @@ use crate::Workspace; use gpui::{ - div, px, AnyView, Component, Div, EventEmitter, ParentElement, Render, StatelessInteractive, - Styled, Subscription, View, ViewContext, + div, px, AnyView, Component, Div, EventEmitter, ParentElement, Render, StatefulInteractivity, + StatelessInteractive, Styled, Subscription, View, ViewContext, }; use std::{any::TypeId, sync::Arc}; use ui::v_stack; @@ -9,7 +9,14 @@ use ui::v_stack; pub struct ModalLayer { open_modal: Option, subscription: Option, - registered_modals: Vec<(TypeId, Box) -> Div>)>, + registered_modals: Vec<( + TypeId, + Box< + dyn Fn( + Div>, + ) -> Div>, + >, + )>, } pub enum ModalEvent { @@ -64,8 +71,11 @@ impl ModalLayer { cx.notify(); } - pub fn wrapper_element(&self, cx: &ViewContext) -> Div { - let mut parent = div().relative().size_full(); + pub fn wrapper_element( + &self, + cx: &ViewContext, + ) -> Div> { + let mut parent = div().id("modal layer").relative().size_full(); for (_, action) in self.registered_modals.iter() { parent = (action)(parent); diff --git a/crates/workspace2/src/workspace2.rs b/crates/workspace2/src/workspace2.rs index c91c388f2afb1b43a6e9f9cc10214d6795a9c70e..54c8709d7ed817748637581a13b0c92211ce6065 100644 --- a/crates/workspace2/src/workspace2.rs +++ b/crates/workspace2/src/workspace2.rs @@ -39,8 +39,8 @@ use gpui::{ actions, div, point, rems, size, AnyModel, AnyView, AnyWeakView, AppContext, AsyncAppContext, AsyncWindowContext, Bounds, Component, DispatchContext, Div, Entity, EntityId, EventEmitter, FocusHandle, GlobalPixels, Model, ModelContext, ParentElement, Point, Render, Size, - StatefulInteractive, Styled, Subscription, Task, View, ViewContext, VisualContext, WeakView, - WindowBounds, WindowContext, WindowHandle, WindowOptions, + StatefulInteractive, StatefulInteractivity, Styled, Subscription, Task, View, ViewContext, + VisualContext, WeakView, WindowBounds, WindowContext, WindowHandle, WindowOptions, }; use item::{FollowableItem, FollowableItemHandle, Item, ItemHandle, ItemSettings, ProjectItem}; use itertools::Itertools; @@ -3706,13 +3706,14 @@ fn notify_if_database_failed(workspace: WindowHandle, cx: &mut AsyncA impl EventEmitter for Workspace {} impl Render for Workspace { - type Element = Div; + type Element = Div>; fn render(&mut self, cx: &mut ViewContext) -> Self::Element { let mut context = DispatchContext::default(); context.insert("Workspace"); cx.with_key_dispatch_context(context, |cx| { div() + .id("workspace") .relative() .size_full() .flex() From 5d158866752d7dd3c92665f66166ac4c7955a74c Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 9 Nov 2023 18:43:26 +0100 Subject: [PATCH 17/76] Render code actions indicator Co-Authored-By: Nathan --- Cargo.lock | 1 + crates/editor2/Cargo.toml | 1 + crates/editor2/src/editor.rs | 137 +++++++++++------------ crates/editor2/src/element.rs | 89 ++++++++------- crates/gpui2/src/element.rs | 93 +++++++++++++-- crates/gpui2/src/taffy.rs | 31 ++++- crates/gpui2/src/window.rs | 2 + crates/ui2/src/components/icon_button.rs | 1 + 8 files changed, 227 insertions(+), 128 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ded64052c8e165e4b4ca3955e3382a38874d88bf..ed06172fd8f495bf04e0b09340b7557d5e1ef739 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2781,6 +2781,7 @@ dependencies = [ "tree-sitter-html", "tree-sitter-rust", "tree-sitter-typescript", + "ui2", "unindent", "util", "workspace2", diff --git a/crates/editor2/Cargo.toml b/crates/editor2/Cargo.toml index b897110966709ecef886caf8adef36f1973cc4bd..493f10006f734f5c0fd907935981d2cb9a17b9e1 100644 --- a/crates/editor2/Cargo.toml +++ b/crates/editor2/Cargo.toml @@ -44,6 +44,7 @@ snippet = { path = "../snippet" } sum_tree = { path = "../sum_tree" } text = { package="text2", path = "../text2" } theme = { package="theme2", path = "../theme2" } +ui2 = { package = "ui2", path = "../ui2" } util = { path = "../util" } sqlez = { path = "../sqlez" } workspace = { package = "workspace2", path = "../workspace2" } diff --git a/crates/editor2/src/editor.rs b/crates/editor2/src/editor.rs index 51cd549923827ce21f9220e153f1f983bf5aa95d..752696bcaef3752a8acf0df0516c1ed742978a9e 100644 --- a/crates/editor2/src/editor.rs +++ b/crates/editor2/src/editor.rs @@ -40,9 +40,9 @@ use fuzzy::{StringMatch, StringMatchCandidate}; use git::diff_hunk_to_display; use gpui::{ action, actions, point, px, relative, rems, size, AnyElement, AppContext, BackgroundExecutor, - Bounds, ClipboardItem, Context, DispatchContext, EventEmitter, FocusHandle, FontFeatures, - FontStyle, FontWeight, HighlightStyle, Hsla, InputHandler, Model, Pixels, Render, Subscription, - Task, TextStyle, View, ViewContext, VisualContext, WeakView, WindowContext, + Bounds, ClipboardItem, Component, Context, DispatchContext, EventEmitter, FocusHandle, + FontFeatures, FontStyle, FontWeight, HighlightStyle, Hsla, InputHandler, Model, Pixels, Render, + Subscription, Task, TextStyle, View, ViewContext, VisualContext, WeakView, WindowContext, }; use highlight_matching_bracket::refresh_matching_bracket_highlights; use hover_popover::{hide_hover, HoverState}; @@ -95,6 +95,7 @@ use text::{OffsetUtf16, Rope}; use theme::{ ActiveTheme, DiagnosticStyle, PlayerColor, SyntaxTheme, Theme, ThemeColors, ThemeSettings, }; +use ui2::IconButton; use util::{post_inc, RangeExt, ResultExt, TryFutureExt}; use workspace::{ item::ItemEvent, searchable::SearchEvent, ItemNavHistory, SplitDirection, ViewId, Workspace, @@ -3846,44 +3847,44 @@ impl Editor { // })) // } - // pub fn toggle_code_actions(&mut self, action: &ToggleCodeActions, cx: &mut ViewContext) { - // let mut context_menu = self.context_menu.write(); - // if matches!(context_menu.as_ref(), Some(ContextMenu::CodeActions(_))) { - // *context_menu = None; - // cx.notify(); - // return; - // } - // drop(context_menu); - - // let deployed_from_indicator = action.deployed_from_indicator; - // let mut task = self.code_actions_task.take(); - // cx.spawn(|this, mut cx| async move { - // while let Some(prev_task) = task { - // prev_task.await; - // task = this.update(&mut cx, |this, _| this.code_actions_task.take())?; - // } + pub fn toggle_code_actions(&mut self, action: &ToggleCodeActions, cx: &mut ViewContext) { + let mut context_menu = self.context_menu.write(); + if matches!(context_menu.as_ref(), Some(ContextMenu::CodeActions(_))) { + *context_menu = None; + cx.notify(); + return; + } + drop(context_menu); - // this.update(&mut cx, |this, cx| { - // if this.focused { - // if let Some((buffer, actions)) = this.available_code_actions.clone() { - // this.completion_tasks.clear(); - // this.discard_copilot_suggestion(cx); - // *this.context_menu.write() = - // Some(ContextMenu::CodeActions(CodeActionsMenu { - // buffer, - // actions, - // selected_item: Default::default(), - // list: Default::default(), - // deployed_from_indicator, - // })); - // } - // } - // })?; + let deployed_from_indicator = action.deployed_from_indicator; + let mut task = self.code_actions_task.take(); + cx.spawn(|this, mut cx| async move { + while let Some(prev_task) = task { + prev_task.await; + task = this.update(&mut cx, |this, _| this.code_actions_task.take())?; + } - // Ok::<_, anyhow::Error>(()) - // }) - // .detach_and_log_err(cx); - // } + this.update(&mut cx, |this, cx| { + if this.focus_handle.is_focused(cx) { + if let Some((buffer, actions)) = this.available_code_actions.clone() { + this.completion_tasks.clear(); + this.discard_copilot_suggestion(cx); + *this.context_menu.write() = + Some(ContextMenu::CodeActions(CodeActionsMenu { + buffer, + actions, + selected_item: Default::default(), + list: Default::default(), + deployed_from_indicator, + })); + } + } + })?; + + Ok::<_, anyhow::Error>(()) + }) + .detach_and_log_err(cx); + } // pub fn confirm_code_action( // workspace: &mut Workspace, @@ -4390,41 +4391,29 @@ impl Editor { self.discard_copilot_suggestion(cx); } - // pub fn render_code_actions_indicator( - // &self, - // style: &EditorStyle, - // is_active: bool, - // cx: &mut ViewContext, - // ) -> Option> { - // if self.available_code_actions.is_some() { - // enum CodeActions {} - // Some( - // MouseEventHandler::new::(0, cx, |state, _| { - // Svg::new("icons/bolt.svg").with_color( - // style - // .code_actions - // .indicator - // .in_state(is_active) - // .style_for(state) - // .color, - // ) - // }) - // .with_cursor_style(CursorStyle::PointingHand) - // .with_padding(Padding::uniform(3.)) - // .on_down(MouseButton::Left, |_, this, cx| { - // this.toggle_code_actions( - // &ToggleCodeActions { - // deployed_from_indicator: true, - // }, - // cx, - // ); - // }) - // .into_any(), - // ) - // } else { - // None - // } - // } + pub fn render_code_actions_indicator( + &self, + style: &EditorStyle, + is_active: bool, + cx: &mut ViewContext, + ) -> Option> { + if self.available_code_actions.is_some() { + Some( + IconButton::new("code_actions", ui2::Icon::Bolt) + .on_click(|editor: &mut Editor, cx| { + editor.toggle_code_actions( + &ToggleCodeActions { + deployed_from_indicator: true, + }, + cx, + ); + }) + .render(), + ) + } else { + None + } + } // pub fn render_fold_indicators( // &self, diff --git a/crates/editor2/src/element.rs b/crates/editor2/src/element.rs index 3e77a66936443aa872fc6f196fb71257bfede82f..a447b5647c48eefd9b9c10f9e130d7d8e4d705a6 100644 --- a/crates/editor2/src/element.rs +++ b/crates/editor2/src/element.rs @@ -15,7 +15,7 @@ use crate::{ use anyhow::Result; use collections::{BTreeMap, HashMap}; use gpui::{ - black, hsla, point, px, relative, size, transparent_black, Action, AnyElement, + black, hsla, point, px, relative, size, transparent_black, Action, AnyElement, AvailableSpace, BorrowAppContext, BorrowWindow, Bounds, ContentMask, Corners, DispatchContext, DispatchPhase, Edges, Element, ElementId, ElementInputHandler, Entity, FocusHandle, GlobalElementId, Hsla, InputHandler, KeyDownEvent, KeyListener, KeyMatch, Line, LineLayout, Modifiers, MouseButton, @@ -447,7 +447,7 @@ impl EditorElement { fn paint_gutter( &mut self, bounds: Bounds, - layout: &LayoutState, + layout: &mut LayoutState, editor: &mut Editor, cx: &mut ViewContext, ) { @@ -495,14 +495,21 @@ impl EditorElement { // } // } - // todo!("code actions indicator") - // if let Some((row, indicator)) = layout.code_actions_indicator.as_mut() { - // let mut x = 0.; - // let mut y = *row as f32 * line_height - scroll_top; - // x += ((layout.gutter_padding + layout.gutter_margin) - indicator.size().x) / 2.; - // y += (line_height - indicator.size().y) / 2.; - // indicator.paint(bounds.origin + point(x, y), visible_bounds, editor, cx); - // } + if let Some(indicator) = layout.code_actions_indicator.as_mut() { + let available_space = size( + AvailableSpace::MinContent, + AvailableSpace::Definite(line_height), + ); + let indicator_size = indicator.element.measure(available_space, editor, cx); + let mut x = Pixels::ZERO; + let mut y = indicator.row as f32 * line_height - scroll_top; + // Center indicator. + x += ((layout.gutter_padding + layout.gutter_margin) - indicator_size.width) / 2.; + y += (line_height - indicator_size.height) / 2.; + indicator + .element + .draw(bounds.origin + point(x, y), available_space, editor, cx); + } } fn paint_diff_hunks( @@ -1776,24 +1783,27 @@ impl EditorElement { // todo!("context menu") // let mut context_menu = None; - // let mut code_actions_indicator = None; - // if let Some(newest_selection_head) = newest_selection_head { - // if (start_row..end_row).contains(&newest_selection_head.row()) { - // if editor.context_menu_visible() { - // context_menu = - // editor.render_context_menu(newest_selection_head, style.clone(), cx); - // } - - // let active = matches!( - // editor.context_menu.read().as_ref(), - // Some(crate::ContextMenu::CodeActions(_)) - // ); + let mut code_actions_indicator = None; + if let Some(newest_selection_head) = newest_selection_head { + if (start_row..end_row).contains(&newest_selection_head.row()) { + // if editor.context_menu_visible() { + // context_menu = + // editor.render_context_menu(newest_selection_head, style.clone(), cx); + // } + + let active = matches!( + editor.context_menu.read().as_ref(), + Some(crate::ContextMenu::CodeActions(_)) + ); - // code_actions_indicator = editor - // .render_code_actions_indicator(&style, active, cx) - // .map(|indicator| (newest_selection_head.row(), indicator)); - // } - // } + code_actions_indicator = editor + .render_code_actions_indicator(&style, active, cx) + .map(|element| CodeActionsIndicator { + row: newest_selection_head.row(), + element, + }); + } + } let visible_rows = start_row..start_row + line_layouts.len() as u32; // todo!("hover") @@ -1831,18 +1841,6 @@ impl EditorElement { // ); // } - // todo!("code actions") - // if let Some((_, indicator)) = code_actions_indicator.as_mut() { - // indicator.layout( - // SizeConstraint::strict_along( - // Axis::Vertical, - // line_height * style.code_actions.vertical_scale, - // ), - // editor, - // cx, - // ); - // } - // todo!("fold indicators") // for fold_indicator in fold_indicators.iter_mut() { // if let Some(indicator) = fold_indicator.as_mut() { @@ -1942,7 +1940,7 @@ impl EditorElement { // blocks, selections, // context_menu, - // code_actions_indicator, + code_actions_indicator, // fold_indicators, tab_invisible, space_invisible, @@ -2493,7 +2491,7 @@ impl Element for EditorElement { element_state: &mut Self::ElementState, cx: &mut gpui::ViewContext, ) { - let layout = self.compute_layout(editor, cx, bounds); + let mut layout = self.compute_layout(editor, cx, bounds); let gutter_bounds = Bounds { origin: bounds.origin, size: layout.gutter_size, @@ -2513,7 +2511,7 @@ impl Element for EditorElement { ); self.paint_background(gutter_bounds, text_bounds, &layout, cx); if layout.gutter_size.width > Pixels::ZERO { - self.paint_gutter(gutter_bounds, &layout, editor, cx); + self.paint_gutter(gutter_bounds, &mut layout, editor, cx); } self.paint_text(text_bounds, &layout, editor, cx); let input_handler = ElementInputHandler::new(bounds, cx); @@ -3144,13 +3142,18 @@ pub struct LayoutState { is_singleton: bool, max_row: u32, // context_menu: Option<(DisplayPoint, AnyElement)>, - // code_actions_indicator: Option<(u32, AnyElement)>, + code_actions_indicator: Option, // hover_popovers: Option<(DisplayPoint, Vec>)>, // fold_indicators: Vec>>, tab_invisible: Line, space_invisible: Line, } +struct CodeActionsIndicator { + row: u32, + element: AnyElement, +} + struct PositionMap { size: Size, line_height: Pixels, diff --git a/crates/gpui2/src/element.rs b/crates/gpui2/src/element.rs index 775b3b8a895215c49476e06d34913b3aa311c695..e7526dfa3a74d444bf6747d51a8b98a1de85d9cf 100644 --- a/crates/gpui2/src/element.rs +++ b/crates/gpui2/src/element.rs @@ -63,6 +63,19 @@ trait ElementObject { fn initialize(&mut self, view_state: &mut V, cx: &mut ViewContext); fn layout(&mut self, view_state: &mut V, cx: &mut ViewContext) -> LayoutId; fn paint(&mut self, view_state: &mut V, cx: &mut ViewContext); + fn measure( + &mut self, + available_space: Size, + view_state: &mut V, + cx: &mut ViewContext, + ) -> Size; + fn draw( + &mut self, + origin: Point, + available_space: Size, + view_state: &mut V, + cx: &mut ViewContext, + ); } struct RenderedElement> { @@ -81,6 +94,11 @@ enum ElementRenderPhase { layout_id: LayoutId, frame_state: Option, }, + LayoutComputed { + layout_id: LayoutId, + available_space: Size, + frame_state: Option, + }, Painted, } @@ -137,7 +155,9 @@ where } } ElementRenderPhase::Start => panic!("must call initialize before layout"), - ElementRenderPhase::LayoutRequested { .. } | ElementRenderPhase::Painted => { + ElementRenderPhase::LayoutRequested { .. } + | ElementRenderPhase::LayoutComputed { .. } + | ElementRenderPhase::Painted => { panic!("element rendered twice") } }; @@ -154,6 +174,11 @@ where ElementRenderPhase::LayoutRequested { layout_id, mut frame_state, + } + | ElementRenderPhase::LayoutComputed { + layout_id, + mut frame_state, + .. } => { let bounds = cx.layout_bounds(layout_id); if let Some(id) = self.element.id() { @@ -173,6 +198,62 @@ where _ => panic!("must call layout before paint"), }; } + + fn measure( + &mut self, + available_space: Size, + view_state: &mut V, + cx: &mut ViewContext, + ) -> Size { + if matches!(&self.phase, ElementRenderPhase::Start) { + self.initialize(view_state, cx); + } + + if matches!(&self.phase, ElementRenderPhase::Initialized { .. }) { + self.layout(view_state, cx); + } + + let layout_id = match &mut self.phase { + ElementRenderPhase::LayoutRequested { + layout_id, + frame_state, + } => { + cx.compute_layout(*layout_id, available_space); + let layout_id = *layout_id; + self.phase = ElementRenderPhase::LayoutComputed { + layout_id, + available_space, + frame_state: frame_state.take(), + }; + layout_id + } + ElementRenderPhase::LayoutComputed { + layout_id, + available_space: prev_available_space, + .. + } => { + if available_space != *prev_available_space { + cx.compute_layout(*layout_id, available_space); + *prev_available_space = available_space; + } + *layout_id + } + _ => panic!("cannot measure after painting"), + }; + + cx.layout_bounds(layout_id).size + } + + fn draw( + &mut self, + origin: Point, + available_space: Size, + view_state: &mut V, + cx: &mut ViewContext, + ) { + self.measure(available_space, view_state, cx); + cx.with_element_offset(Some(origin), |cx| self.paint(view_state, cx)) + } } pub struct AnyElement(Box>); @@ -206,10 +287,7 @@ impl AnyElement { view_state: &mut V, cx: &mut ViewContext, ) -> Size { - self.initialize(view_state, cx); - let layout_id = self.layout(view_state, cx); - cx.compute_layout(layout_id, available_space); - cx.layout_bounds(layout_id).size + self.0.measure(available_space, view_state, cx) } /// Initializes this element and performs layout in the available space, then paints it at the given origin. @@ -220,10 +298,7 @@ impl AnyElement { view_state: &mut V, cx: &mut ViewContext, ) { - self.initialize(view_state, cx); - let layout_id = self.layout(view_state, cx); - cx.compute_layout(layout_id, available_space); - cx.with_element_offset(Some(origin), |cx| self.paint(view_state, cx)) + self.0.draw(origin, available_space, view_state, cx) } } diff --git a/crates/gpui2/src/taffy.rs b/crates/gpui2/src/taffy.rs index 9724179eed4735b7959f93865bd234bc3d246823..ea87f73872cd445ee37e530d973d5e0e054a76fd 100644 --- a/crates/gpui2/src/taffy.rs +++ b/crates/gpui2/src/taffy.rs @@ -1,5 +1,6 @@ use super::{AbsoluteLength, Bounds, DefiniteLength, Edges, Length, Pixels, Point, Size, Style}; -use collections::HashMap; +use collections::{HashMap, HashSet}; +use smallvec::SmallVec; use std::fmt::Debug; use taffy::{ geometry::{Point as TaffyPoint, Rect as TaffyRect, Size as TaffySize}, @@ -12,6 +13,7 @@ pub struct TaffyLayoutEngine { taffy: Taffy, children_to_parents: HashMap, absolute_layout_bounds: HashMap>, + computed_layouts: HashSet, } static EXPECT_MESSAGE: &'static str = @@ -23,9 +25,17 @@ impl TaffyLayoutEngine { taffy: Taffy::new(), children_to_parents: HashMap::default(), absolute_layout_bounds: HashMap::default(), + computed_layouts: HashSet::default(), } } + pub fn clear(&mut self) { + self.taffy.clear(); + self.children_to_parents.clear(); + self.absolute_layout_bounds.clear(); + self.computed_layouts.clear(); + } + pub fn request_layout( &mut self, style: &Style, @@ -115,6 +125,7 @@ impl TaffyLayoutEngine { } pub fn compute_layout(&mut self, id: LayoutId, available_space: Size) { + // Leaving this here until we have a better instrumentation approach. // println!("Laying out {} children", self.count_all_children(id)?); // println!("Max layout depth: {}", self.max_depth(0, id)?); @@ -124,6 +135,22 @@ impl TaffyLayoutEngine { // println!("N{} --> N{}", u64::from(a), u64::from(b)); // } // println!(""); + // + + if !self.computed_layouts.insert(id) { + let mut stack = SmallVec::<[LayoutId; 64]>::new(); + stack.push(id); + while let Some(id) = stack.pop() { + self.absolute_layout_bounds.remove(&id); + stack.extend( + self.taffy + .children(id.into()) + .expect(EXPECT_MESSAGE) + .into_iter() + .map(Into::into), + ); + } + } // let started_at = std::time::Instant::now(); self.taffy @@ -397,7 +424,7 @@ where } } -#[derive(Copy, Clone, Default, Debug)] +#[derive(Copy, Clone, Default, Debug, Eq, PartialEq)] pub enum AvailableSpace { /// The amount of space available is the specified number of pixels Definite(Pixels), diff --git a/crates/gpui2/src/window.rs b/crates/gpui2/src/window.rs index ac7dcf02569e4db6c3c8f92658d95088dcdc4ba5..7b5ce5b7fc418d612a90f64c23ebf44ecc6a1b10 100644 --- a/crates/gpui2/src/window.rs +++ b/crates/gpui2/src/window.rs @@ -1060,6 +1060,8 @@ impl<'a> WindowContext<'a> { self.text_system().start_frame(); let window = &mut *self.window; + window.layout_engine.clear(); + mem::swap(&mut window.previous_frame, &mut window.current_frame); let frame = &mut window.current_frame; frame.element_states.clear(); diff --git a/crates/ui2/src/components/icon_button.rs b/crates/ui2/src/components/icon_button.rs index f0dc85b445c326f801d5579d5f4002690e617b75..91653ea8cdd0158d88294886b826c680b5cbf9b3 100644 --- a/crates/ui2/src/components/icon_button.rs +++ b/crates/ui2/src/components/icon_button.rs @@ -98,6 +98,7 @@ impl IconButton { if let Some(click_handler) = self.handlers.click.clone() { button = button.on_mouse_down(MouseButton::Left, move |state, event, cx| { + cx.stop_propagation(); click_handler(state, cx); }); } From 60eae3e50a20e47f5cfeb522e689a5d506a9644f Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 9 Nov 2023 12:46:37 -0500 Subject: [PATCH 18/76] Emit unique highlights for each syntax token --- crates/theme2/src/themes/andromeda.rs | 10 +- crates/theme2/src/themes/ayu.rs | 34 +- crates/theme2/src/themes/dracula.rs | 87 ++- crates/theme2/src/themes/gruvbox.rs | 376 ++++++++++- crates/theme2/src/themes/mod.rs | 56 +- crates/theme2/src/themes/night_owl.rs | 147 ++++- crates/theme2/src/themes/nord.rs | 87 ++- crates/theme2/src/themes/notctis.rs | 699 ++++++++++++++++++++- crates/theme2/src/themes/palenight.rs | 205 +++++- crates/theme2/src/themes/rose_pine.rs | 208 +++++- crates/theme2/src/themes/solarized.rs | 135 +++- crates/theme2/src/themes/synthwave_84.rs | 72 ++- crates/theme_importer/src/main.rs | 2 +- crates/theme_importer/src/vscode.rs | 57 +- crates/theme_importer/src/vscode_syntax.rs | 13 +- 15 files changed, 1968 insertions(+), 220 deletions(-) diff --git a/crates/theme2/src/themes/andromeda.rs b/crates/theme2/src/themes/andromeda.rs index 6e2b2989f7ebc0fcde31700afd8273c276ffd6ae..00973f0f51676bd13fedfb1e33b5da048517893d 100644 --- a/crates/theme2/src/themes/andromeda.rs +++ b/crates/theme2/src/themes/andromeda.rs @@ -62,10 +62,6 @@ pub fn andromeda() -> UserThemeFamily { syntax: Some(UserSyntaxTheme { highlights: vec![ ("comment".into(), rgba(0x9fa0a6cc).into()), - ("something".into(), rgba(0x00e8c6ff).into()), - ("punctuation".into(), rgba(0xf92571ff).into()), - ("something".into(), rgba(0xc64dedff).into()), - ("something".into(), rgba(0xee5d42ff).into()), ("something".into(), rgba(0x95e072ff).into()), ("punctuation".into(), rgba(0x95e072ff).into()), ], @@ -120,13 +116,9 @@ pub fn andromeda() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ("punctuation".into(), rgba(0x95e072ff).into()), ("comment".into(), rgba(0x9fa0a6cc).into()), - ("something".into(), rgba(0x00e8c6ff).into()), - ("punctuation".into(), rgba(0xf92571ff).into()), - ("something".into(), rgba(0xc64dedff).into()), - ("something".into(), rgba(0xee5d42ff).into()), ("something".into(), rgba(0x95e072ff).into()), - ("punctuation".into(), rgba(0x95e072ff).into()), ], }), }, diff --git a/crates/theme2/src/themes/ayu.rs b/crates/theme2/src/themes/ayu.rs index 3aa1e0a7c32b95bd9a498ff60e6fec1d342516d2..47d50d96c457e5834b64eca44fc187ecd09d1f2c 100644 --- a/crates/theme2/src/themes/ayu.rs +++ b/crates/theme2/src/themes/ayu.rs @@ -65,19 +65,9 @@ pub fn ayu() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("comment".into(), rgba(0x787b8099).into()), - ("something".into(), rgba(0x86b300ff).into()), - ("something".into(), rgba(0x5c6166ff).into()), ("something".into(), rgba(0xfa8d3eff).into()), - ("punctuation".into(), rgba(0x5c6166b3).into()), - ("punctuation".into(), rgba(0x5c6166ff).into()), - ("punctuation".into(), rgba(0xed9365ff).into()), - ("punctuation".into(), rgba(0xfa8d3eff).into()), - ("punctuation".into(), rgba(0xfa8d3eff).into()), - ("punctuation".into(), rgba(0x55b4d380).into()), - ("punctuation".into(), rgba(0x55b4d380).into()), - ("punctuation".into(), rgba(0x55b4d380).into()), ("punctuation".into(), rgba(0x787b8099).into()), + ("comment".into(), rgba(0x787b8099).into()), ], }), }, @@ -134,18 +124,8 @@ pub fn ayu() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("comment".into(), rgba(0xb8cfe680).into()), - ("something".into(), rgba(0xd4fe7fff).into()), - ("something".into(), rgba(0xcccac2ff).into()), ("something".into(), rgba(0xffad65ff).into()), - ("punctuation".into(), rgba(0xcccac2b3).into()), - ("punctuation".into(), rgba(0xcccac2ff).into()), - ("punctuation".into(), rgba(0xf29e74ff).into()), - ("punctuation".into(), rgba(0xffad65ff).into()), - ("punctuation".into(), rgba(0xffad65ff).into()), - ("punctuation".into(), rgba(0x5ccfe680).into()), - ("punctuation".into(), rgba(0x5ccfe680).into()), - ("punctuation".into(), rgba(0x5ccfe680).into()), + ("comment".into(), rgba(0xb8cfe680).into()), ("punctuation".into(), rgba(0xb8cfe680).into()), ], }), @@ -204,17 +184,7 @@ pub fn ayu() -> UserThemeFamily { syntax: Some(UserSyntaxTheme { highlights: vec![ ("comment".into(), rgba(0xabb5be8c).into()), - ("something".into(), rgba(0xa9d94bff).into()), - ("something".into(), rgba(0xbfbdb6ff).into()), ("something".into(), rgba(0xff8f3fff).into()), - ("punctuation".into(), rgba(0xbfbdb6b3).into()), - ("punctuation".into(), rgba(0xbfbdb6ff).into()), - ("punctuation".into(), rgba(0xf29668ff).into()), - ("punctuation".into(), rgba(0xff8f3fff).into()), - ("punctuation".into(), rgba(0xff8f3fff).into()), - ("punctuation".into(), rgba(0x38b9e680).into()), - ("punctuation".into(), rgba(0x38b9e680).into()), - ("punctuation".into(), rgba(0x38b9e680).into()), ("punctuation".into(), rgba(0xabb5be8c).into()), ], }), diff --git a/crates/theme2/src/themes/dracula.rs b/crates/theme2/src/themes/dracula.rs index 757f5d5a18f1d5222685aa75f952aeacd9b8ec2d..d8b97589ab734857ff12a8d26f96df0b5ae6bebe 100644 --- a/crates/theme2/src/themes/dracula.rs +++ b/crates/theme2/src/themes/dracula.rs @@ -1,18 +1,77 @@ +// This file was generated by the `theme_importer`. +// Be careful when modifying it by hand. - // This file was generated by the `theme_importer`. - // Be careful when modifying it by hand. +use gpui::rgba; - use gpui::rgba; +use crate::{ + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, + UserThemeStylesRefinement, +}; - use crate::{ - Appearance, ThemeColorsRefinement, StatusColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, - }; - - pub fn dracula() -> UserThemeFamily { - UserThemeFamily { - name: "Dracula".into(), - author: "Zeno Rocha".into(), - themes: vec![UserTheme { name: "Dracula".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0xbd93f9ff).into()),border_variant: Some(rgba(0xbd93f9ff).into()),border_focused: Some(rgba(0x6272a4ff).into()),border_selected: Some(rgba(0xbd93f9ff).into()),border_transparent: Some(rgba(0xbd93f9ff).into()),border_disabled: Some(rgba(0xbd93f9ff).into()),elevated_surface_background: Some(rgba(0x282a35ff).into()),surface_background: Some(rgba(0x282a35ff).into()),background: Some(rgba(0x282a35ff).into()),element_background: Some(rgba(0x44475aff).into()),element_hover: Some(rgba(0x44475a75).into()),element_selected: Some(rgba(0x44475aff).into()),drop_target_background: Some(rgba(0x44475aff).into()),ghost_element_hover: Some(rgba(0x44475a75).into()),text: Some(rgba(0xf8f8f2ff).into()),tab_inactive_background: Some(rgba(0x21222cff).into()),tab_active_background: Some(rgba(0x282a35ff).into()),editor_background: Some(rgba(0x282a35ff).into()),editor_gutter_background: Some(rgba(0x282a35ff).into()),editor_line_number: Some(rgba(0x6272a4ff).into()),editor_active_line_number: Some(rgba(0xf8f8f2ff).into()),terminal_background: Some(rgba(0x282a35ff).into()),terminal_ansi_bright_black: Some(rgba(0x6272a4ff).into()),terminal_ansi_bright_red: Some(rgba(0xff6d6dff).into()),terminal_ansi_bright_green: Some(rgba(0x69ff94ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xffffa5ff).into()),terminal_ansi_bright_blue: Some(rgba(0xd6abfeff).into()),terminal_ansi_bright_magenta: Some(rgba(0xff92dfff).into()),terminal_ansi_bright_cyan: Some(rgba(0xa3fefeff).into()),terminal_ansi_bright_white: Some(rgba(0xffffffff).into()),terminal_ansi_black: Some(rgba(0x21222cff).into()),terminal_ansi_red: Some(rgba(0xff5555ff).into()),terminal_ansi_green: Some(rgba(0x50fa7bff).into()),terminal_ansi_yellow: Some(rgba(0xf1fa8cff).into()),terminal_ansi_blue: Some(rgba(0xbd93f9ff).into()),terminal_ansi_magenta: Some(rgba(0xff79c6ff).into()),terminal_ansi_cyan: Some(rgba(0x8be9fdff).into()),terminal_ansi_white: Some(rgba(0xf8f8f2ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xff5555ff).into()),error: Some(rgba(0xff5555ff).into()),hidden: Some(rgba(0x6272a4ff).into()),warning: Some(rgba(0xffb76bff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x6272a4ff).into()), ("something".into(), rgba(0xbd93f9ff).into()), ("something".into(), rgba(0x8be9fdff).into()), ("punctuation".into(), rgba(0xff79c6ff).into()), ("punctuation".into(), rgba(0xff79c6ff).into()), ("something".into(), rgba(0xff79c6ff).into()), ("something".into(), rgba(0xf1fa8cff).into()), ("something".into(), rgba(0xf8f8f2ff).into())] }) } }], +pub fn dracula() -> UserThemeFamily { + UserThemeFamily { + name: "Dracula".into(), + author: "Zeno Rocha".into(), + themes: vec![UserTheme { + name: "Dracula".into(), + appearance: Appearance::Dark, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0xbd93f9ff).into()), + border_variant: Some(rgba(0xbd93f9ff).into()), + border_focused: Some(rgba(0x6272a4ff).into()), + border_selected: Some(rgba(0xbd93f9ff).into()), + border_transparent: Some(rgba(0xbd93f9ff).into()), + border_disabled: Some(rgba(0xbd93f9ff).into()), + elevated_surface_background: Some(rgba(0x282a35ff).into()), + surface_background: Some(rgba(0x282a35ff).into()), + background: Some(rgba(0x282a35ff).into()), + element_background: Some(rgba(0x44475aff).into()), + element_hover: Some(rgba(0x44475a75).into()), + element_selected: Some(rgba(0x44475aff).into()), + drop_target_background: Some(rgba(0x44475aff).into()), + ghost_element_hover: Some(rgba(0x44475a75).into()), + text: Some(rgba(0xf8f8f2ff).into()), + tab_inactive_background: Some(rgba(0x21222cff).into()), + tab_active_background: Some(rgba(0x282a35ff).into()), + editor_background: Some(rgba(0x282a35ff).into()), + editor_gutter_background: Some(rgba(0x282a35ff).into()), + editor_line_number: Some(rgba(0x6272a4ff).into()), + editor_active_line_number: Some(rgba(0xf8f8f2ff).into()), + terminal_background: Some(rgba(0x282a35ff).into()), + terminal_ansi_bright_black: Some(rgba(0x6272a4ff).into()), + terminal_ansi_bright_red: Some(rgba(0xff6d6dff).into()), + terminal_ansi_bright_green: Some(rgba(0x69ff94ff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xffffa5ff).into()), + terminal_ansi_bright_blue: Some(rgba(0xd6abfeff).into()), + terminal_ansi_bright_magenta: Some(rgba(0xff92dfff).into()), + terminal_ansi_bright_cyan: Some(rgba(0xa3fefeff).into()), + terminal_ansi_bright_white: Some(rgba(0xffffffff).into()), + terminal_ansi_black: Some(rgba(0x21222cff).into()), + terminal_ansi_red: Some(rgba(0xff5555ff).into()), + terminal_ansi_green: Some(rgba(0x50fa7bff).into()), + terminal_ansi_yellow: Some(rgba(0xf1fa8cff).into()), + terminal_ansi_blue: Some(rgba(0xbd93f9ff).into()), + terminal_ansi_magenta: Some(rgba(0xff79c6ff).into()), + terminal_ansi_cyan: Some(rgba(0x8be9fdff).into()), + terminal_ansi_white: Some(rgba(0xf8f8f2ff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xff5555ff).into()), + error: Some(rgba(0xff5555ff).into()), + hidden: Some(rgba(0x6272a4ff).into()), + warning: Some(rgba(0xffb76bff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("comment".into(), rgba(0x6272a4ff).into()), + ("something".into(), rgba(0xf8f8f2ff).into()), + ("punctuation".into(), rgba(0xff79c6ff).into()), + ], + }), + }, + }], + } } - } - \ No newline at end of file diff --git a/crates/theme2/src/themes/gruvbox.rs b/crates/theme2/src/themes/gruvbox.rs index 71be1ec98bfb3396bcadcf63281b29264759e916..a7a3a42f19d87a77f47d791d3e294cb1fcaf64be 100644 --- a/crates/theme2/src/themes/gruvbox.rs +++ b/crates/theme2/src/themes/gruvbox.rs @@ -1,18 +1,366 @@ +// This file was generated by the `theme_importer`. +// Be careful when modifying it by hand. - // This file was generated by the `theme_importer`. - // Be careful when modifying it by hand. +use gpui::rgba; - use gpui::rgba; +use crate::{ + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, + UserThemeStylesRefinement, +}; - use crate::{ - Appearance, ThemeColorsRefinement, StatusColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, - }; - - pub fn gruvbox() -> UserThemeFamily { - UserThemeFamily { - name: "Gruvbox".into(), - author: "morhetz".into(), - themes: vec![UserTheme { name: "Gruvbox Dark Hard".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x3c3836ff).into()),border_variant: Some(rgba(0x3c3836ff).into()),border_focused: Some(rgba(0x3c3836ff).into()),border_selected: Some(rgba(0x3c3836ff).into()),border_transparent: Some(rgba(0x3c3836ff).into()),border_disabled: Some(rgba(0x3c3836ff).into()),background: Some(rgba(0x1d2021ff).into()),element_background: Some(rgba(0x44858780).into()),element_hover: Some(rgba(0x3c383680).into()),element_selected: Some(rgba(0x3c383680).into()),drop_target_background: Some(rgba(0x3c3836ff).into()),ghost_element_hover: Some(rgba(0x3c383680).into()),text: Some(rgba(0xebdbb2ff).into()),tab_inactive_background: Some(rgba(0x1d2021ff).into()),tab_active_background: Some(rgba(0x32302fff).into()),editor_background: Some(rgba(0x1d2021ff).into()),editor_gutter_background: Some(rgba(0x1d2021ff).into()),editor_line_number: Some(rgba(0x665c54ff).into()),editor_active_line_number: Some(rgba(0xebdbb2ff).into()),terminal_background: Some(rgba(0x1d2021ff).into()),terminal_ansi_bright_black: Some(rgba(0x928374ff).into()),terminal_ansi_bright_red: Some(rgba(0xfb4833ff).into()),terminal_ansi_bright_green: Some(rgba(0xb8bb25ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xfabd2eff).into()),terminal_ansi_bright_blue: Some(rgba(0x83a598ff).into()),terminal_ansi_bright_magenta: Some(rgba(0xd3869bff).into()),terminal_ansi_bright_cyan: Some(rgba(0x8ec07cff).into()),terminal_ansi_bright_white: Some(rgba(0xebdbb2ff).into()),terminal_ansi_black: Some(rgba(0x3c3836ff).into()),terminal_ansi_red: Some(rgba(0xcc241cff).into()),terminal_ansi_green: Some(rgba(0x989719ff).into()),terminal_ansi_yellow: Some(rgba(0xd79920ff).into()),terminal_ansi_blue: Some(rgba(0x448587ff).into()),terminal_ansi_magenta: Some(rgba(0xb16185ff).into()),terminal_ansi_cyan: Some(rgba(0x679d6aff).into()),terminal_ansi_white: Some(rgba(0xa89984ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xfb4833ff).into()),error: Some(rgba(0xfb4833ff).into()),hidden: Some(rgba(0xa89984ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x928374ff).into()), ("something".into(), rgba(0xd3869bff).into()), ("something".into(), rgba(0xfb4833ff).into()), ("something".into(), rgba(0xb8bb25ff).into()), ("something".into(), rgba(0x83a598ff).into()), ("punctuation".into(), rgba(0xa89984ff).into()), ("punctuation".into(), rgba(0x83a598ff).into())] }) } }, UserTheme { name: "Gruvbox Dark Medium".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x3c3836ff).into()),border_variant: Some(rgba(0x3c3836ff).into()),border_focused: Some(rgba(0x3c3836ff).into()),border_selected: Some(rgba(0x3c3836ff).into()),border_transparent: Some(rgba(0x3c3836ff).into()),border_disabled: Some(rgba(0x3c3836ff).into()),background: Some(rgba(0x282828ff).into()),element_background: Some(rgba(0x44858780).into()),element_hover: Some(rgba(0x3c383680).into()),element_selected: Some(rgba(0x3c383680).into()),drop_target_background: Some(rgba(0x3c3836ff).into()),ghost_element_hover: Some(rgba(0x3c383680).into()),text: Some(rgba(0xebdbb2ff).into()),tab_inactive_background: Some(rgba(0x282828ff).into()),tab_active_background: Some(rgba(0x3c3836ff).into()),editor_background: Some(rgba(0x282828ff).into()),editor_gutter_background: Some(rgba(0x282828ff).into()),editor_line_number: Some(rgba(0x665c54ff).into()),editor_active_line_number: Some(rgba(0xebdbb2ff).into()),terminal_background: Some(rgba(0x282828ff).into()),terminal_ansi_bright_black: Some(rgba(0x928374ff).into()),terminal_ansi_bright_red: Some(rgba(0xfb4833ff).into()),terminal_ansi_bright_green: Some(rgba(0xb8bb25ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xfabd2eff).into()),terminal_ansi_bright_blue: Some(rgba(0x83a598ff).into()),terminal_ansi_bright_magenta: Some(rgba(0xd3869bff).into()),terminal_ansi_bright_cyan: Some(rgba(0x8ec07cff).into()),terminal_ansi_bright_white: Some(rgba(0xebdbb2ff).into()),terminal_ansi_black: Some(rgba(0x3c3836ff).into()),terminal_ansi_red: Some(rgba(0xcc241cff).into()),terminal_ansi_green: Some(rgba(0x989719ff).into()),terminal_ansi_yellow: Some(rgba(0xd79920ff).into()),terminal_ansi_blue: Some(rgba(0x448587ff).into()),terminal_ansi_magenta: Some(rgba(0xb16185ff).into()),terminal_ansi_cyan: Some(rgba(0x679d6aff).into()),terminal_ansi_white: Some(rgba(0xa89984ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xfb4833ff).into()),error: Some(rgba(0xfb4833ff).into()),hidden: Some(rgba(0xa89984ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x928374ff).into()), ("something".into(), rgba(0xd3869bff).into()), ("something".into(), rgba(0xfb4833ff).into()), ("something".into(), rgba(0xb8bb25ff).into()), ("something".into(), rgba(0x83a598ff).into()), ("punctuation".into(), rgba(0xa89984ff).into()), ("punctuation".into(), rgba(0x83a598ff).into())] }) } }, UserTheme { name: "Gruvbox Dark Soft".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x3c3836ff).into()),border_variant: Some(rgba(0x3c3836ff).into()),border_focused: Some(rgba(0x3c3836ff).into()),border_selected: Some(rgba(0x3c3836ff).into()),border_transparent: Some(rgba(0x3c3836ff).into()),border_disabled: Some(rgba(0x3c3836ff).into()),background: Some(rgba(0x32302fff).into()),element_background: Some(rgba(0x44858780).into()),element_hover: Some(rgba(0x3c383680).into()),element_selected: Some(rgba(0x3c383680).into()),drop_target_background: Some(rgba(0x3c3836ff).into()),ghost_element_hover: Some(rgba(0x3c383680).into()),text: Some(rgba(0xebdbb2ff).into()),tab_inactive_background: Some(rgba(0x32302fff).into()),tab_active_background: Some(rgba(0x504945ff).into()),editor_background: Some(rgba(0x32302fff).into()),editor_gutter_background: Some(rgba(0x32302fff).into()),editor_line_number: Some(rgba(0x665c54ff).into()),editor_active_line_number: Some(rgba(0xebdbb2ff).into()),terminal_background: Some(rgba(0x32302fff).into()),terminal_ansi_bright_black: Some(rgba(0x928374ff).into()),terminal_ansi_bright_red: Some(rgba(0xfb4833ff).into()),terminal_ansi_bright_green: Some(rgba(0xb8bb25ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xfabd2eff).into()),terminal_ansi_bright_blue: Some(rgba(0x83a598ff).into()),terminal_ansi_bright_magenta: Some(rgba(0xd3869bff).into()),terminal_ansi_bright_cyan: Some(rgba(0x8ec07cff).into()),terminal_ansi_bright_white: Some(rgba(0xebdbb2ff).into()),terminal_ansi_black: Some(rgba(0x3c3836ff).into()),terminal_ansi_red: Some(rgba(0xcc241cff).into()),terminal_ansi_green: Some(rgba(0x989719ff).into()),terminal_ansi_yellow: Some(rgba(0xd79920ff).into()),terminal_ansi_blue: Some(rgba(0x448587ff).into()),terminal_ansi_magenta: Some(rgba(0xb16185ff).into()),terminal_ansi_cyan: Some(rgba(0x679d6aff).into()),terminal_ansi_white: Some(rgba(0xa89984ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xfb4833ff).into()),error: Some(rgba(0xfb4833ff).into()),hidden: Some(rgba(0xa89984ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x928374ff).into()), ("something".into(), rgba(0xd3869bff).into()), ("something".into(), rgba(0xfb4833ff).into()), ("something".into(), rgba(0xb8bb25ff).into()), ("something".into(), rgba(0x83a598ff).into()), ("punctuation".into(), rgba(0xa89984ff).into()), ("punctuation".into(), rgba(0x83a598ff).into())] }) } }, UserTheme { name: "Gruvbox Light Hard".into(), appearance: Appearance::Light, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0xebdbb2ff).into()),border_variant: Some(rgba(0xebdbb2ff).into()),border_focused: Some(rgba(0xebdbb2ff).into()),border_selected: Some(rgba(0xebdbb2ff).into()),border_transparent: Some(rgba(0xebdbb2ff).into()),border_disabled: Some(rgba(0xebdbb2ff).into()),background: Some(rgba(0xf9f5d7ff).into()),element_background: Some(rgba(0x44858780).into()),element_hover: Some(rgba(0xebdbb280).into()),element_selected: Some(rgba(0xebdbb280).into()),drop_target_background: Some(rgba(0xebdbb2ff).into()),ghost_element_hover: Some(rgba(0xebdbb280).into()),text: Some(rgba(0x3c3836ff).into()),tab_inactive_background: Some(rgba(0xf9f5d7ff).into()),tab_active_background: Some(rgba(0xf2e5bcff).into()),editor_background: Some(rgba(0xf9f5d7ff).into()),editor_gutter_background: Some(rgba(0xf9f5d7ff).into()),editor_line_number: Some(rgba(0xbdae93ff).into()),editor_active_line_number: Some(rgba(0x3c3836ff).into()),terminal_background: Some(rgba(0xf9f5d7ff).into()),terminal_ansi_bright_black: Some(rgba(0x928374ff).into()),terminal_ansi_bright_red: Some(rgba(0x9d0006ff).into()),terminal_ansi_bright_green: Some(rgba(0x79740eff).into()),terminal_ansi_bright_yellow: Some(rgba(0xb57613ff).into()),terminal_ansi_bright_blue: Some(rgba(0x066578ff).into()),terminal_ansi_bright_magenta: Some(rgba(0x8f3e71ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x427b58ff).into()),terminal_ansi_bright_white: Some(rgba(0x3c3836ff).into()),terminal_ansi_black: Some(rgba(0xebdbb2ff).into()),terminal_ansi_red: Some(rgba(0xcc241cff).into()),terminal_ansi_green: Some(rgba(0x989719ff).into()),terminal_ansi_yellow: Some(rgba(0xd79920ff).into()),terminal_ansi_blue: Some(rgba(0x448587ff).into()),terminal_ansi_magenta: Some(rgba(0xb16185ff).into()),terminal_ansi_cyan: Some(rgba(0x679d6aff).into()),terminal_ansi_white: Some(rgba(0x7c6f64ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0x9d0006ff).into()),error: Some(rgba(0x9d0006ff).into()),hidden: Some(rgba(0x7c6f64ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x928374ff).into()), ("something".into(), rgba(0x8f3e71ff).into()), ("something".into(), rgba(0x9d0006ff).into()), ("something".into(), rgba(0x79740eff).into()), ("something".into(), rgba(0x066578ff).into()), ("punctuation".into(), rgba(0x7c6f64ff).into()), ("punctuation".into(), rgba(0x066578ff).into())] }) } }, UserTheme { name: "Gruvbox Light Medium".into(), appearance: Appearance::Light, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0xebdbb2ff).into()),border_variant: Some(rgba(0xebdbb2ff).into()),border_focused: Some(rgba(0xebdbb2ff).into()),border_selected: Some(rgba(0xebdbb2ff).into()),border_transparent: Some(rgba(0xebdbb2ff).into()),border_disabled: Some(rgba(0xebdbb2ff).into()),background: Some(rgba(0xfbf1c7ff).into()),element_background: Some(rgba(0x44858780).into()),element_hover: Some(rgba(0xebdbb280).into()),element_selected: Some(rgba(0xebdbb280).into()),drop_target_background: Some(rgba(0xebdbb2ff).into()),ghost_element_hover: Some(rgba(0xebdbb280).into()),text: Some(rgba(0x3c3836ff).into()),tab_inactive_background: Some(rgba(0xfbf1c7ff).into()),tab_active_background: Some(rgba(0xebdbb2ff).into()),editor_background: Some(rgba(0xfbf1c7ff).into()),editor_gutter_background: Some(rgba(0xfbf1c7ff).into()),editor_line_number: Some(rgba(0xbdae93ff).into()),editor_active_line_number: Some(rgba(0x3c3836ff).into()),terminal_background: Some(rgba(0xfbf1c7ff).into()),terminal_ansi_bright_black: Some(rgba(0x928374ff).into()),terminal_ansi_bright_red: Some(rgba(0x9d0006ff).into()),terminal_ansi_bright_green: Some(rgba(0x79740eff).into()),terminal_ansi_bright_yellow: Some(rgba(0xb57613ff).into()),terminal_ansi_bright_blue: Some(rgba(0x066578ff).into()),terminal_ansi_bright_magenta: Some(rgba(0x8f3e71ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x427b58ff).into()),terminal_ansi_bright_white: Some(rgba(0x3c3836ff).into()),terminal_ansi_black: Some(rgba(0xebdbb2ff).into()),terminal_ansi_red: Some(rgba(0xcc241cff).into()),terminal_ansi_green: Some(rgba(0x989719ff).into()),terminal_ansi_yellow: Some(rgba(0xd79920ff).into()),terminal_ansi_blue: Some(rgba(0x448587ff).into()),terminal_ansi_magenta: Some(rgba(0xb16185ff).into()),terminal_ansi_cyan: Some(rgba(0x679d6aff).into()),terminal_ansi_white: Some(rgba(0x7c6f64ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0x9d0006ff).into()),error: Some(rgba(0x9d0006ff).into()),hidden: Some(rgba(0x7c6f64ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x928374ff).into()), ("something".into(), rgba(0x8f3e71ff).into()), ("something".into(), rgba(0x9d0006ff).into()), ("something".into(), rgba(0x79740eff).into()), ("something".into(), rgba(0x066578ff).into()), ("punctuation".into(), rgba(0x7c6f64ff).into()), ("punctuation".into(), rgba(0x066578ff).into())] }) } }, UserTheme { name: "Gruvbox Light Soft".into(), appearance: Appearance::Light, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0xebdbb2ff).into()),border_variant: Some(rgba(0xebdbb2ff).into()),border_focused: Some(rgba(0xebdbb2ff).into()),border_selected: Some(rgba(0xebdbb2ff).into()),border_transparent: Some(rgba(0xebdbb2ff).into()),border_disabled: Some(rgba(0xebdbb2ff).into()),background: Some(rgba(0xf2e5bcff).into()),element_background: Some(rgba(0x44858780).into()),element_hover: Some(rgba(0xebdbb280).into()),element_selected: Some(rgba(0xebdbb280).into()),drop_target_background: Some(rgba(0xebdbb2ff).into()),ghost_element_hover: Some(rgba(0xebdbb280).into()),text: Some(rgba(0x3c3836ff).into()),tab_inactive_background: Some(rgba(0xf2e5bcff).into()),tab_active_background: Some(rgba(0xd5c4a1ff).into()),editor_background: Some(rgba(0xf2e5bcff).into()),editor_gutter_background: Some(rgba(0xf2e5bcff).into()),editor_line_number: Some(rgba(0xbdae93ff).into()),editor_active_line_number: Some(rgba(0x3c3836ff).into()),terminal_background: Some(rgba(0xf2e5bcff).into()),terminal_ansi_bright_black: Some(rgba(0x928374ff).into()),terminal_ansi_bright_red: Some(rgba(0x9d0006ff).into()),terminal_ansi_bright_green: Some(rgba(0x79740eff).into()),terminal_ansi_bright_yellow: Some(rgba(0xb57613ff).into()),terminal_ansi_bright_blue: Some(rgba(0x066578ff).into()),terminal_ansi_bright_magenta: Some(rgba(0x8f3e71ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x427b58ff).into()),terminal_ansi_bright_white: Some(rgba(0x3c3836ff).into()),terminal_ansi_black: Some(rgba(0xebdbb2ff).into()),terminal_ansi_red: Some(rgba(0xcc241cff).into()),terminal_ansi_green: Some(rgba(0x989719ff).into()),terminal_ansi_yellow: Some(rgba(0xd79920ff).into()),terminal_ansi_blue: Some(rgba(0x448587ff).into()),terminal_ansi_magenta: Some(rgba(0xb16185ff).into()),terminal_ansi_cyan: Some(rgba(0x679d6aff).into()),terminal_ansi_white: Some(rgba(0x7c6f64ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0x9d0006ff).into()),error: Some(rgba(0x9d0006ff).into()),hidden: Some(rgba(0x7c6f64ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x928374ff).into()), ("something".into(), rgba(0x8f3e71ff).into()), ("something".into(), rgba(0x9d0006ff).into()), ("something".into(), rgba(0x79740eff).into()), ("something".into(), rgba(0x066578ff).into()), ("punctuation".into(), rgba(0x7c6f64ff).into()), ("punctuation".into(), rgba(0x066578ff).into())] }) } }], +pub fn gruvbox() -> UserThemeFamily { + UserThemeFamily { + name: "Gruvbox".into(), + author: "morhetz".into(), + themes: vec![ + UserTheme { + name: "Gruvbox Dark Hard".into(), + appearance: Appearance::Dark, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0x3c3836ff).into()), + border_variant: Some(rgba(0x3c3836ff).into()), + border_focused: Some(rgba(0x3c3836ff).into()), + border_selected: Some(rgba(0x3c3836ff).into()), + border_transparent: Some(rgba(0x3c3836ff).into()), + border_disabled: Some(rgba(0x3c3836ff).into()), + background: Some(rgba(0x1d2021ff).into()), + element_background: Some(rgba(0x44858780).into()), + element_hover: Some(rgba(0x3c383680).into()), + element_selected: Some(rgba(0x3c383680).into()), + drop_target_background: Some(rgba(0x3c3836ff).into()), + ghost_element_hover: Some(rgba(0x3c383680).into()), + text: Some(rgba(0xebdbb2ff).into()), + tab_inactive_background: Some(rgba(0x1d2021ff).into()), + tab_active_background: Some(rgba(0x32302fff).into()), + editor_background: Some(rgba(0x1d2021ff).into()), + editor_gutter_background: Some(rgba(0x1d2021ff).into()), + editor_line_number: Some(rgba(0x665c54ff).into()), + editor_active_line_number: Some(rgba(0xebdbb2ff).into()), + terminal_background: Some(rgba(0x1d2021ff).into()), + terminal_ansi_bright_black: Some(rgba(0x928374ff).into()), + terminal_ansi_bright_red: Some(rgba(0xfb4833ff).into()), + terminal_ansi_bright_green: Some(rgba(0xb8bb25ff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xfabd2eff).into()), + terminal_ansi_bright_blue: Some(rgba(0x83a598ff).into()), + terminal_ansi_bright_magenta: Some(rgba(0xd3869bff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x8ec07cff).into()), + terminal_ansi_bright_white: Some(rgba(0xebdbb2ff).into()), + terminal_ansi_black: Some(rgba(0x3c3836ff).into()), + terminal_ansi_red: Some(rgba(0xcc241cff).into()), + terminal_ansi_green: Some(rgba(0x989719ff).into()), + terminal_ansi_yellow: Some(rgba(0xd79920ff).into()), + terminal_ansi_blue: Some(rgba(0x448587ff).into()), + terminal_ansi_magenta: Some(rgba(0xb16185ff).into()), + terminal_ansi_cyan: Some(rgba(0x679d6aff).into()), + terminal_ansi_white: Some(rgba(0xa89984ff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xfb4833ff).into()), + error: Some(rgba(0xfb4833ff).into()), + hidden: Some(rgba(0xa89984ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("comment".into(), rgba(0x928374ff).into()), + ("something".into(), rgba(0x83a598ff).into()), + ("punctuation".into(), rgba(0x83a598ff).into()), + ], + }), + }, + }, + UserTheme { + name: "Gruvbox Dark Medium".into(), + appearance: Appearance::Dark, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0x3c3836ff).into()), + border_variant: Some(rgba(0x3c3836ff).into()), + border_focused: Some(rgba(0x3c3836ff).into()), + border_selected: Some(rgba(0x3c3836ff).into()), + border_transparent: Some(rgba(0x3c3836ff).into()), + border_disabled: Some(rgba(0x3c3836ff).into()), + background: Some(rgba(0x282828ff).into()), + element_background: Some(rgba(0x44858780).into()), + element_hover: Some(rgba(0x3c383680).into()), + element_selected: Some(rgba(0x3c383680).into()), + drop_target_background: Some(rgba(0x3c3836ff).into()), + ghost_element_hover: Some(rgba(0x3c383680).into()), + text: Some(rgba(0xebdbb2ff).into()), + tab_inactive_background: Some(rgba(0x282828ff).into()), + tab_active_background: Some(rgba(0x3c3836ff).into()), + editor_background: Some(rgba(0x282828ff).into()), + editor_gutter_background: Some(rgba(0x282828ff).into()), + editor_line_number: Some(rgba(0x665c54ff).into()), + editor_active_line_number: Some(rgba(0xebdbb2ff).into()), + terminal_background: Some(rgba(0x282828ff).into()), + terminal_ansi_bright_black: Some(rgba(0x928374ff).into()), + terminal_ansi_bright_red: Some(rgba(0xfb4833ff).into()), + terminal_ansi_bright_green: Some(rgba(0xb8bb25ff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xfabd2eff).into()), + terminal_ansi_bright_blue: Some(rgba(0x83a598ff).into()), + terminal_ansi_bright_magenta: Some(rgba(0xd3869bff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x8ec07cff).into()), + terminal_ansi_bright_white: Some(rgba(0xebdbb2ff).into()), + terminal_ansi_black: Some(rgba(0x3c3836ff).into()), + terminal_ansi_red: Some(rgba(0xcc241cff).into()), + terminal_ansi_green: Some(rgba(0x989719ff).into()), + terminal_ansi_yellow: Some(rgba(0xd79920ff).into()), + terminal_ansi_blue: Some(rgba(0x448587ff).into()), + terminal_ansi_magenta: Some(rgba(0xb16185ff).into()), + terminal_ansi_cyan: Some(rgba(0x679d6aff).into()), + terminal_ansi_white: Some(rgba(0xa89984ff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xfb4833ff).into()), + error: Some(rgba(0xfb4833ff).into()), + hidden: Some(rgba(0xa89984ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("something".into(), rgba(0x83a598ff).into()), + ("comment".into(), rgba(0x928374ff).into()), + ("punctuation".into(), rgba(0x83a598ff).into()), + ], + }), + }, + }, + UserTheme { + name: "Gruvbox Dark Soft".into(), + appearance: Appearance::Dark, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0x3c3836ff).into()), + border_variant: Some(rgba(0x3c3836ff).into()), + border_focused: Some(rgba(0x3c3836ff).into()), + border_selected: Some(rgba(0x3c3836ff).into()), + border_transparent: Some(rgba(0x3c3836ff).into()), + border_disabled: Some(rgba(0x3c3836ff).into()), + background: Some(rgba(0x32302fff).into()), + element_background: Some(rgba(0x44858780).into()), + element_hover: Some(rgba(0x3c383680).into()), + element_selected: Some(rgba(0x3c383680).into()), + drop_target_background: Some(rgba(0x3c3836ff).into()), + ghost_element_hover: Some(rgba(0x3c383680).into()), + text: Some(rgba(0xebdbb2ff).into()), + tab_inactive_background: Some(rgba(0x32302fff).into()), + tab_active_background: Some(rgba(0x504945ff).into()), + editor_background: Some(rgba(0x32302fff).into()), + editor_gutter_background: Some(rgba(0x32302fff).into()), + editor_line_number: Some(rgba(0x665c54ff).into()), + editor_active_line_number: Some(rgba(0xebdbb2ff).into()), + terminal_background: Some(rgba(0x32302fff).into()), + terminal_ansi_bright_black: Some(rgba(0x928374ff).into()), + terminal_ansi_bright_red: Some(rgba(0xfb4833ff).into()), + terminal_ansi_bright_green: Some(rgba(0xb8bb25ff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xfabd2eff).into()), + terminal_ansi_bright_blue: Some(rgba(0x83a598ff).into()), + terminal_ansi_bright_magenta: Some(rgba(0xd3869bff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x8ec07cff).into()), + terminal_ansi_bright_white: Some(rgba(0xebdbb2ff).into()), + terminal_ansi_black: Some(rgba(0x3c3836ff).into()), + terminal_ansi_red: Some(rgba(0xcc241cff).into()), + terminal_ansi_green: Some(rgba(0x989719ff).into()), + terminal_ansi_yellow: Some(rgba(0xd79920ff).into()), + terminal_ansi_blue: Some(rgba(0x448587ff).into()), + terminal_ansi_magenta: Some(rgba(0xb16185ff).into()), + terminal_ansi_cyan: Some(rgba(0x679d6aff).into()), + terminal_ansi_white: Some(rgba(0xa89984ff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xfb4833ff).into()), + error: Some(rgba(0xfb4833ff).into()), + hidden: Some(rgba(0xa89984ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("comment".into(), rgba(0x928374ff).into()), + ("something".into(), rgba(0x83a598ff).into()), + ("punctuation".into(), rgba(0x83a598ff).into()), + ], + }), + }, + }, + UserTheme { + name: "Gruvbox Light Hard".into(), + appearance: Appearance::Light, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0xebdbb2ff).into()), + border_variant: Some(rgba(0xebdbb2ff).into()), + border_focused: Some(rgba(0xebdbb2ff).into()), + border_selected: Some(rgba(0xebdbb2ff).into()), + border_transparent: Some(rgba(0xebdbb2ff).into()), + border_disabled: Some(rgba(0xebdbb2ff).into()), + background: Some(rgba(0xf9f5d7ff).into()), + element_background: Some(rgba(0x44858780).into()), + element_hover: Some(rgba(0xebdbb280).into()), + element_selected: Some(rgba(0xebdbb280).into()), + drop_target_background: Some(rgba(0xebdbb2ff).into()), + ghost_element_hover: Some(rgba(0xebdbb280).into()), + text: Some(rgba(0x3c3836ff).into()), + tab_inactive_background: Some(rgba(0xf9f5d7ff).into()), + tab_active_background: Some(rgba(0xf2e5bcff).into()), + editor_background: Some(rgba(0xf9f5d7ff).into()), + editor_gutter_background: Some(rgba(0xf9f5d7ff).into()), + editor_line_number: Some(rgba(0xbdae93ff).into()), + editor_active_line_number: Some(rgba(0x3c3836ff).into()), + terminal_background: Some(rgba(0xf9f5d7ff).into()), + terminal_ansi_bright_black: Some(rgba(0x928374ff).into()), + terminal_ansi_bright_red: Some(rgba(0x9d0006ff).into()), + terminal_ansi_bright_green: Some(rgba(0x79740eff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xb57613ff).into()), + terminal_ansi_bright_blue: Some(rgba(0x066578ff).into()), + terminal_ansi_bright_magenta: Some(rgba(0x8f3e71ff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x427b58ff).into()), + terminal_ansi_bright_white: Some(rgba(0x3c3836ff).into()), + terminal_ansi_black: Some(rgba(0xebdbb2ff).into()), + terminal_ansi_red: Some(rgba(0xcc241cff).into()), + terminal_ansi_green: Some(rgba(0x989719ff).into()), + terminal_ansi_yellow: Some(rgba(0xd79920ff).into()), + terminal_ansi_blue: Some(rgba(0x448587ff).into()), + terminal_ansi_magenta: Some(rgba(0xb16185ff).into()), + terminal_ansi_cyan: Some(rgba(0x679d6aff).into()), + terminal_ansi_white: Some(rgba(0x7c6f64ff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0x9d0006ff).into()), + error: Some(rgba(0x9d0006ff).into()), + hidden: Some(rgba(0x7c6f64ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("comment".into(), rgba(0x928374ff).into()), + ("something".into(), rgba(0x066578ff).into()), + ("punctuation".into(), rgba(0x066578ff).into()), + ], + }), + }, + }, + UserTheme { + name: "Gruvbox Light Medium".into(), + appearance: Appearance::Light, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0xebdbb2ff).into()), + border_variant: Some(rgba(0xebdbb2ff).into()), + border_focused: Some(rgba(0xebdbb2ff).into()), + border_selected: Some(rgba(0xebdbb2ff).into()), + border_transparent: Some(rgba(0xebdbb2ff).into()), + border_disabled: Some(rgba(0xebdbb2ff).into()), + background: Some(rgba(0xfbf1c7ff).into()), + element_background: Some(rgba(0x44858780).into()), + element_hover: Some(rgba(0xebdbb280).into()), + element_selected: Some(rgba(0xebdbb280).into()), + drop_target_background: Some(rgba(0xebdbb2ff).into()), + ghost_element_hover: Some(rgba(0xebdbb280).into()), + text: Some(rgba(0x3c3836ff).into()), + tab_inactive_background: Some(rgba(0xfbf1c7ff).into()), + tab_active_background: Some(rgba(0xebdbb2ff).into()), + editor_background: Some(rgba(0xfbf1c7ff).into()), + editor_gutter_background: Some(rgba(0xfbf1c7ff).into()), + editor_line_number: Some(rgba(0xbdae93ff).into()), + editor_active_line_number: Some(rgba(0x3c3836ff).into()), + terminal_background: Some(rgba(0xfbf1c7ff).into()), + terminal_ansi_bright_black: Some(rgba(0x928374ff).into()), + terminal_ansi_bright_red: Some(rgba(0x9d0006ff).into()), + terminal_ansi_bright_green: Some(rgba(0x79740eff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xb57613ff).into()), + terminal_ansi_bright_blue: Some(rgba(0x066578ff).into()), + terminal_ansi_bright_magenta: Some(rgba(0x8f3e71ff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x427b58ff).into()), + terminal_ansi_bright_white: Some(rgba(0x3c3836ff).into()), + terminal_ansi_black: Some(rgba(0xebdbb2ff).into()), + terminal_ansi_red: Some(rgba(0xcc241cff).into()), + terminal_ansi_green: Some(rgba(0x989719ff).into()), + terminal_ansi_yellow: Some(rgba(0xd79920ff).into()), + terminal_ansi_blue: Some(rgba(0x448587ff).into()), + terminal_ansi_magenta: Some(rgba(0xb16185ff).into()), + terminal_ansi_cyan: Some(rgba(0x679d6aff).into()), + terminal_ansi_white: Some(rgba(0x7c6f64ff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0x9d0006ff).into()), + error: Some(rgba(0x9d0006ff).into()), + hidden: Some(rgba(0x7c6f64ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("something".into(), rgba(0x066578ff).into()), + ("comment".into(), rgba(0x928374ff).into()), + ("punctuation".into(), rgba(0x066578ff).into()), + ], + }), + }, + }, + UserTheme { + name: "Gruvbox Light Soft".into(), + appearance: Appearance::Light, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0xebdbb2ff).into()), + border_variant: Some(rgba(0xebdbb2ff).into()), + border_focused: Some(rgba(0xebdbb2ff).into()), + border_selected: Some(rgba(0xebdbb2ff).into()), + border_transparent: Some(rgba(0xebdbb2ff).into()), + border_disabled: Some(rgba(0xebdbb2ff).into()), + background: Some(rgba(0xf2e5bcff).into()), + element_background: Some(rgba(0x44858780).into()), + element_hover: Some(rgba(0xebdbb280).into()), + element_selected: Some(rgba(0xebdbb280).into()), + drop_target_background: Some(rgba(0xebdbb2ff).into()), + ghost_element_hover: Some(rgba(0xebdbb280).into()), + text: Some(rgba(0x3c3836ff).into()), + tab_inactive_background: Some(rgba(0xf2e5bcff).into()), + tab_active_background: Some(rgba(0xd5c4a1ff).into()), + editor_background: Some(rgba(0xf2e5bcff).into()), + editor_gutter_background: Some(rgba(0xf2e5bcff).into()), + editor_line_number: Some(rgba(0xbdae93ff).into()), + editor_active_line_number: Some(rgba(0x3c3836ff).into()), + terminal_background: Some(rgba(0xf2e5bcff).into()), + terminal_ansi_bright_black: Some(rgba(0x928374ff).into()), + terminal_ansi_bright_red: Some(rgba(0x9d0006ff).into()), + terminal_ansi_bright_green: Some(rgba(0x79740eff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xb57613ff).into()), + terminal_ansi_bright_blue: Some(rgba(0x066578ff).into()), + terminal_ansi_bright_magenta: Some(rgba(0x8f3e71ff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x427b58ff).into()), + terminal_ansi_bright_white: Some(rgba(0x3c3836ff).into()), + terminal_ansi_black: Some(rgba(0xebdbb2ff).into()), + terminal_ansi_red: Some(rgba(0xcc241cff).into()), + terminal_ansi_green: Some(rgba(0x989719ff).into()), + terminal_ansi_yellow: Some(rgba(0xd79920ff).into()), + terminal_ansi_blue: Some(rgba(0x448587ff).into()), + terminal_ansi_magenta: Some(rgba(0xb16185ff).into()), + terminal_ansi_cyan: Some(rgba(0x679d6aff).into()), + terminal_ansi_white: Some(rgba(0x7c6f64ff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0x9d0006ff).into()), + error: Some(rgba(0x9d0006ff).into()), + hidden: Some(rgba(0x7c6f64ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("something".into(), rgba(0x066578ff).into()), + ("comment".into(), rgba(0x928374ff).into()), + ("punctuation".into(), rgba(0x066578ff).into()), + ], + }), + }, + }, + ], + } } - } - \ No newline at end of file diff --git a/crates/theme2/src/themes/mod.rs b/crates/theme2/src/themes/mod.rs index 13397105e292a6a11025cff255a2446ad9b39ce8..c48338b184ac8678f8af3f13a274757435cdbca9 100644 --- a/crates/theme2/src/themes/mod.rs +++ b/crates/theme2/src/themes/mod.rs @@ -1,36 +1,44 @@ +// This file was generated by the `theme_importer`. +// Be careful when modifying it by hand. - // This file was generated by the `theme_importer`. - // Be careful when modifying it by hand. - - mod rose_pine; -mod night_owl; mod andromeda; -mod synthwave_84; -mod palenight; +mod ayu; mod dracula; -mod solarized; +mod gruvbox; +mod night_owl; mod nord; mod notctis; -mod ayu; -mod gruvbox; +mod palenight; +mod rose_pine; +mod solarized; +mod synthwave_84; - pub use rose_pine::*; -pub use night_owl::*; pub use andromeda::*; -pub use synthwave_84::*; -pub use palenight::*; +pub use ayu::*; pub use dracula::*; -pub use solarized::*; +pub use gruvbox::*; +pub use night_owl::*; pub use nord::*; pub use notctis::*; -pub use ayu::*; -pub use gruvbox::*; +pub use palenight::*; +pub use rose_pine::*; +pub use solarized::*; +pub use synthwave_84::*; - - use crate::UserThemeFamily; +use crate::UserThemeFamily; - pub(crate) fn all_user_themes() -> Vec { - vec![rose_pine(), night_owl(), andromeda(), synthwave_84(), palenight(), dracula(), solarized(), nord(), notctis(), ayu(), gruvbox()] - } - - \ No newline at end of file +pub(crate) fn all_user_themes() -> Vec { + vec![ + rose_pine(), + night_owl(), + andromeda(), + synthwave_84(), + palenight(), + dracula(), + solarized(), + nord(), + notctis(), + ayu(), + gruvbox(), + ] +} diff --git a/crates/theme2/src/themes/night_owl.rs b/crates/theme2/src/themes/night_owl.rs index 20619cbdb4cf3f252cbbe16a0ebcda61bceab7f9..a0a11b9aa1f3813c6d9a130c8d94259beb9f5ebd 100644 --- a/crates/theme2/src/themes/night_owl.rs +++ b/crates/theme2/src/themes/night_owl.rs @@ -1,18 +1,137 @@ +// This file was generated by the `theme_importer`. +// Be careful when modifying it by hand. - // This file was generated by the `theme_importer`. - // Be careful when modifying it by hand. +use gpui::rgba; - use gpui::rgba; +use crate::{ + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, + UserThemeStylesRefinement, +}; - use crate::{ - Appearance, ThemeColorsRefinement, StatusColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, - }; - - pub fn night_owl() -> UserThemeFamily { - UserThemeFamily { - name: "Night Owl".into(), - author: "Sarah Drasner (sdras)".into(), - themes: vec![UserTheme { name: "Night Owl".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x5f7e97ff).into()),border_variant: Some(rgba(0x5f7e97ff).into()),border_focused: Some(rgba(0x122d42ff).into()),border_selected: Some(rgba(0x5f7e97ff).into()),border_transparent: Some(rgba(0x5f7e97ff).into()),border_disabled: Some(rgba(0x5f7e97ff).into()),elevated_surface_background: Some(rgba(0x011526ff).into()),surface_background: Some(rgba(0x011526ff).into()),background: Some(rgba(0x011526ff).into()),element_background: Some(rgba(0x7d56c1cc).into()),element_hover: Some(rgba(0x011526ff).into()),element_selected: Some(rgba(0x234c708c).into()),drop_target_background: Some(rgba(0x011526ff).into()),ghost_element_hover: Some(rgba(0x011526ff).into()),text: Some(rgba(0xd6deebff).into()),tab_inactive_background: Some(rgba(0x01101cff).into()),tab_active_background: Some(rgba(0x0a2842ff).into()),editor_background: Some(rgba(0x011526ff).into()),editor_gutter_background: Some(rgba(0x011526ff).into()),editor_line_number: Some(rgba(0x4b6479ff).into()),editor_active_line_number: Some(rgba(0xd6deebff).into()),terminal_ansi_bright_black: Some(rgba(0x575656ff).into()),terminal_ansi_bright_red: Some(rgba(0xef524fff).into()),terminal_ansi_bright_green: Some(rgba(0x21da6eff).into()),terminal_ansi_bright_yellow: Some(rgba(0xffeb95ff).into()),terminal_ansi_bright_blue: Some(rgba(0x82aaffff).into()),terminal_ansi_bright_magenta: Some(rgba(0xc792eaff).into()),terminal_ansi_bright_cyan: Some(rgba(0x7fdbcaff).into()),terminal_ansi_bright_white: Some(rgba(0xffffffff).into()),terminal_ansi_black: Some(rgba(0x011526ff).into()),terminal_ansi_red: Some(rgba(0xef524fff).into()),terminal_ansi_green: Some(rgba(0x21da6eff).into()),terminal_ansi_yellow: Some(rgba(0xc5e478ff).into()),terminal_ansi_blue: Some(rgba(0x82aaffff).into()),terminal_ansi_magenta: Some(rgba(0xc792eaff).into()),terminal_ansi_cyan: Some(rgba(0x20c7a7ff).into()),terminal_ansi_white: Some(rgba(0xffffffff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xef524fff).into()),error: Some(rgba(0xef524fff).into()),hidden: Some(rgba(0x5f7e97ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x637777ff).into()), ("something".into(), rgba(0xecc48dff).into()), ("something".into(), rgba(0xc5e478ff).into()), ("punctuation".into(), rgba(0xc792eaff).into()), ("something".into(), rgba(0xc792eaff).into()), ("punctuation".into(), rgba(0x7fdbcaff).into()), ("punctuation".into(), rgba(0xd3413dff).into()), ("something".into(), rgba(0xc792eaff).into()), ("something".into(), rgba(0xc5e478ff).into()), ("something".into(), rgba(0x687097ff).into()), ("something".into(), rgba(0x7fcac3ff).into())] }) } }, UserTheme { name: "Night Owl Light".into(), appearance: Appearance::Light, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0xd9d9d9ff).into()),border_variant: Some(rgba(0xd9d9d9ff).into()),border_focused: Some(rgba(0x93a1a1ff).into()),border_selected: Some(rgba(0xd9d9d9ff).into()),border_transparent: Some(rgba(0xd9d9d9ff).into()),border_disabled: Some(rgba(0xd9d9d9ff).into()),elevated_surface_background: Some(rgba(0xf0f0f0ff).into()),surface_background: Some(rgba(0xf0f0f0ff).into()),background: Some(rgba(0xfbfbfbff).into()),element_background: Some(rgba(0x29a298ff).into()),element_hover: Some(rgba(0xd3e7f8ff).into()),element_selected: Some(rgba(0xd3e7f8ff).into()),ghost_element_hover: Some(rgba(0xd3e7f8ff).into()),text: Some(rgba(0x403f53ff).into()),tab_inactive_background: Some(rgba(0xf0f0f0ff).into()),tab_active_background: Some(rgba(0xf6f6f6ff).into()),editor_background: Some(rgba(0xfbfbfbff).into()),editor_gutter_background: Some(rgba(0xfbfbfbff).into()),editor_line_number: Some(rgba(0x90a7b2ff).into()),editor_active_line_number: Some(rgba(0x403f53ff).into()),terminal_background: Some(rgba(0xf6f6f6ff).into()),terminal_ansi_bright_black: Some(rgba(0x403f53ff).into()),terminal_ansi_bright_red: Some(rgba(0xde3c3aff).into()),terminal_ansi_bright_green: Some(rgba(0x07916aff).into()),terminal_ansi_bright_yellow: Some(rgba(0xdaa900ff).into()),terminal_ansi_bright_blue: Some(rgba(0x278dd7ff).into()),terminal_ansi_bright_magenta: Some(rgba(0xd64289ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x29a298ff).into()),terminal_ansi_bright_white: Some(rgba(0xf0f0f0ff).into()),terminal_ansi_black: Some(rgba(0x403f53ff).into()),terminal_ansi_red: Some(rgba(0xde3c3aff).into()),terminal_ansi_green: Some(rgba(0x07916aff).into()),terminal_ansi_yellow: Some(rgba(0xe0ae01ff).into()),terminal_ansi_blue: Some(rgba(0x278dd7ff).into()),terminal_ansi_magenta: Some(rgba(0xd64289ff).into()),terminal_ansi_cyan: Some(rgba(0x29a298ff).into()),terminal_ansi_white: Some(rgba(0xf0f0f0ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0x403f53ff).into()),error: Some(rgba(0x403f53ff).into()),hidden: Some(rgba(0x403f53ff).into()),warning: Some(rgba(0xdaa900ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x989fb1ff).into()), ("something".into(), rgba(0x4876d6ff).into()), ("something".into(), rgba(0x4876d6ff).into()), ("punctuation".into(), rgba(0x994bc3ff).into()), ("something".into(), rgba(0x994bc3ff).into()), ("punctuation".into(), rgba(0x994bc3ff).into()), ("punctuation".into(), rgba(0xd3413dff).into()), ("something".into(), rgba(0x994bc3ff).into()), ("something".into(), rgba(0x4876d6ff).into()), ("something".into(), rgba(0x687097ff).into()), ("something".into(), rgba(0x0b969bff).into())] }) } }], +pub fn night_owl() -> UserThemeFamily { + UserThemeFamily { + name: "Night Owl".into(), + author: "Sarah Drasner (sdras)".into(), + themes: vec![ + UserTheme { + name: "Night Owl".into(), + appearance: Appearance::Dark, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0x5f7e97ff).into()), + border_variant: Some(rgba(0x5f7e97ff).into()), + border_focused: Some(rgba(0x122d42ff).into()), + border_selected: Some(rgba(0x5f7e97ff).into()), + border_transparent: Some(rgba(0x5f7e97ff).into()), + border_disabled: Some(rgba(0x5f7e97ff).into()), + elevated_surface_background: Some(rgba(0x011526ff).into()), + surface_background: Some(rgba(0x011526ff).into()), + background: Some(rgba(0x011526ff).into()), + element_background: Some(rgba(0x7d56c1cc).into()), + element_hover: Some(rgba(0x011526ff).into()), + element_selected: Some(rgba(0x234c708c).into()), + drop_target_background: Some(rgba(0x011526ff).into()), + ghost_element_hover: Some(rgba(0x011526ff).into()), + text: Some(rgba(0xd6deebff).into()), + tab_inactive_background: Some(rgba(0x01101cff).into()), + tab_active_background: Some(rgba(0x0a2842ff).into()), + editor_background: Some(rgba(0x011526ff).into()), + editor_gutter_background: Some(rgba(0x011526ff).into()), + editor_line_number: Some(rgba(0x4b6479ff).into()), + editor_active_line_number: Some(rgba(0xd6deebff).into()), + terminal_ansi_bright_black: Some(rgba(0x575656ff).into()), + terminal_ansi_bright_red: Some(rgba(0xef524fff).into()), + terminal_ansi_bright_green: Some(rgba(0x21da6eff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xffeb95ff).into()), + terminal_ansi_bright_blue: Some(rgba(0x82aaffff).into()), + terminal_ansi_bright_magenta: Some(rgba(0xc792eaff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x7fdbcaff).into()), + terminal_ansi_bright_white: Some(rgba(0xffffffff).into()), + terminal_ansi_black: Some(rgba(0x011526ff).into()), + terminal_ansi_red: Some(rgba(0xef524fff).into()), + terminal_ansi_green: Some(rgba(0x21da6eff).into()), + terminal_ansi_yellow: Some(rgba(0xc5e478ff).into()), + terminal_ansi_blue: Some(rgba(0x82aaffff).into()), + terminal_ansi_magenta: Some(rgba(0xc792eaff).into()), + terminal_ansi_cyan: Some(rgba(0x20c7a7ff).into()), + terminal_ansi_white: Some(rgba(0xffffffff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xef524fff).into()), + error: Some(rgba(0xef524fff).into()), + hidden: Some(rgba(0x5f7e97ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("comment".into(), rgba(0x637777ff).into()), + ("something".into(), rgba(0x7fcac3ff).into()), + ("punctuation".into(), rgba(0xd3413dff).into()), + ], + }), + }, + }, + UserTheme { + name: "Night Owl Light".into(), + appearance: Appearance::Light, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0xd9d9d9ff).into()), + border_variant: Some(rgba(0xd9d9d9ff).into()), + border_focused: Some(rgba(0x93a1a1ff).into()), + border_selected: Some(rgba(0xd9d9d9ff).into()), + border_transparent: Some(rgba(0xd9d9d9ff).into()), + border_disabled: Some(rgba(0xd9d9d9ff).into()), + elevated_surface_background: Some(rgba(0xf0f0f0ff).into()), + surface_background: Some(rgba(0xf0f0f0ff).into()), + background: Some(rgba(0xfbfbfbff).into()), + element_background: Some(rgba(0x29a298ff).into()), + element_hover: Some(rgba(0xd3e7f8ff).into()), + element_selected: Some(rgba(0xd3e7f8ff).into()), + ghost_element_hover: Some(rgba(0xd3e7f8ff).into()), + text: Some(rgba(0x403f53ff).into()), + tab_inactive_background: Some(rgba(0xf0f0f0ff).into()), + tab_active_background: Some(rgba(0xf6f6f6ff).into()), + editor_background: Some(rgba(0xfbfbfbff).into()), + editor_gutter_background: Some(rgba(0xfbfbfbff).into()), + editor_line_number: Some(rgba(0x90a7b2ff).into()), + editor_active_line_number: Some(rgba(0x403f53ff).into()), + terminal_background: Some(rgba(0xf6f6f6ff).into()), + terminal_ansi_bright_black: Some(rgba(0x403f53ff).into()), + terminal_ansi_bright_red: Some(rgba(0xde3c3aff).into()), + terminal_ansi_bright_green: Some(rgba(0x07916aff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xdaa900ff).into()), + terminal_ansi_bright_blue: Some(rgba(0x278dd7ff).into()), + terminal_ansi_bright_magenta: Some(rgba(0xd64289ff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x29a298ff).into()), + terminal_ansi_bright_white: Some(rgba(0xf0f0f0ff).into()), + terminal_ansi_black: Some(rgba(0x403f53ff).into()), + terminal_ansi_red: Some(rgba(0xde3c3aff).into()), + terminal_ansi_green: Some(rgba(0x07916aff).into()), + terminal_ansi_yellow: Some(rgba(0xe0ae01ff).into()), + terminal_ansi_blue: Some(rgba(0x278dd7ff).into()), + terminal_ansi_magenta: Some(rgba(0xd64289ff).into()), + terminal_ansi_cyan: Some(rgba(0x29a298ff).into()), + terminal_ansi_white: Some(rgba(0xf0f0f0ff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0x403f53ff).into()), + error: Some(rgba(0x403f53ff).into()), + hidden: Some(rgba(0x403f53ff).into()), + warning: Some(rgba(0xdaa900ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("comment".into(), rgba(0x989fb1ff).into()), + ("something".into(), rgba(0x0b969bff).into()), + ("punctuation".into(), rgba(0xd3413dff).into()), + ], + }), + }, + }, + ], + } } - } - \ No newline at end of file diff --git a/crates/theme2/src/themes/nord.rs b/crates/theme2/src/themes/nord.rs index 2bbdab069db5a819dc75150d55aa46cfc0e2f9ea..eb0deed4f090eecbf1f05e49519cc3e21d04eecc 100644 --- a/crates/theme2/src/themes/nord.rs +++ b/crates/theme2/src/themes/nord.rs @@ -1,18 +1,77 @@ +// This file was generated by the `theme_importer`. +// Be careful when modifying it by hand. - // This file was generated by the `theme_importer`. - // Be careful when modifying it by hand. +use gpui::rgba; - use gpui::rgba; +use crate::{ + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, + UserThemeStylesRefinement, +}; - use crate::{ - Appearance, ThemeColorsRefinement, StatusColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, - }; - - pub fn nord() -> UserThemeFamily { - UserThemeFamily { - name: "Nord".into(), - author: "Sven Greb (svengreb)".into(), - themes: vec![UserTheme { name: "Nord".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x3b4252ff).into()),border_variant: Some(rgba(0x3b4252ff).into()),border_focused: Some(rgba(0x3b4252ff).into()),border_selected: Some(rgba(0x3b4252ff).into()),border_transparent: Some(rgba(0x3b4252ff).into()),border_disabled: Some(rgba(0x3b4252ff).into()),elevated_surface_background: Some(rgba(0x2e3440ff).into()),surface_background: Some(rgba(0x2e3440ff).into()),background: Some(rgba(0x2e3440ff).into()),element_background: Some(rgba(0x88bfd0ee).into()),element_hover: Some(rgba(0x3b4252ff).into()),element_selected: Some(rgba(0x88bfd0ff).into()),drop_target_background: Some(rgba(0x88bfd099).into()),ghost_element_hover: Some(rgba(0x3b4252ff).into()),text: Some(rgba(0xd8dee9ff).into()),tab_inactive_background: Some(rgba(0x2e3440ff).into()),tab_active_background: Some(rgba(0x3b4252ff).into()),editor_background: Some(rgba(0x2e3440ff).into()),editor_gutter_background: Some(rgba(0x2e3440ff).into()),editor_line_number: Some(rgba(0x4c566aff).into()),editor_active_line_number: Some(rgba(0xd8dee9ff).into()),terminal_background: Some(rgba(0x2e3440ff).into()),terminal_ansi_bright_black: Some(rgba(0x4c566aff).into()),terminal_ansi_bright_red: Some(rgba(0xbf616aff).into()),terminal_ansi_bright_green: Some(rgba(0xa3be8cff).into()),terminal_ansi_bright_yellow: Some(rgba(0xebcb8bff).into()),terminal_ansi_bright_blue: Some(rgba(0x81a1c1ff).into()),terminal_ansi_bright_magenta: Some(rgba(0xb48eacff).into()),terminal_ansi_bright_cyan: Some(rgba(0x8fbcbbff).into()),terminal_ansi_bright_white: Some(rgba(0xeceff4ff).into()),terminal_ansi_black: Some(rgba(0x3b4252ff).into()),terminal_ansi_red: Some(rgba(0xbf616aff).into()),terminal_ansi_green: Some(rgba(0xa3be8cff).into()),terminal_ansi_yellow: Some(rgba(0xebcb8bff).into()),terminal_ansi_blue: Some(rgba(0x81a1c1ff).into()),terminal_ansi_magenta: Some(rgba(0xb48eacff).into()),terminal_ansi_cyan: Some(rgba(0x88bfd0ff).into()),terminal_ansi_white: Some(rgba(0xe5e9f0ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xbf616aff).into()),error: Some(rgba(0xbf616aff).into()),hidden: Some(rgba(0xd8dee966).into()),warning: Some(rgba(0xebcb8bff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x606e87ff).into()), ("punctuation".into(), rgba(0xeceff4ff).into()), ("punctuation".into(), rgba(0x81a1c1ff).into()), ("punctuation".into(), rgba(0xeceff4ff).into()), ("punctuation".into(), rgba(0x81a1c1ff).into()), ("punctuation".into(), rgba(0x81a1c1ff).into()), ("punctuation".into(), rgba(0x81a1c1ff).into()), ("something".into(), rgba(0x81a1c1ff).into()), ("something".into(), rgba(0xa3be8cff).into())] }) } }], +pub fn nord() -> UserThemeFamily { + UserThemeFamily { + name: "Nord".into(), + author: "Sven Greb (svengreb)".into(), + themes: vec![UserTheme { + name: "Nord".into(), + appearance: Appearance::Dark, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0x3b4252ff).into()), + border_variant: Some(rgba(0x3b4252ff).into()), + border_focused: Some(rgba(0x3b4252ff).into()), + border_selected: Some(rgba(0x3b4252ff).into()), + border_transparent: Some(rgba(0x3b4252ff).into()), + border_disabled: Some(rgba(0x3b4252ff).into()), + elevated_surface_background: Some(rgba(0x2e3440ff).into()), + surface_background: Some(rgba(0x2e3440ff).into()), + background: Some(rgba(0x2e3440ff).into()), + element_background: Some(rgba(0x88bfd0ee).into()), + element_hover: Some(rgba(0x3b4252ff).into()), + element_selected: Some(rgba(0x88bfd0ff).into()), + drop_target_background: Some(rgba(0x88bfd099).into()), + ghost_element_hover: Some(rgba(0x3b4252ff).into()), + text: Some(rgba(0xd8dee9ff).into()), + tab_inactive_background: Some(rgba(0x2e3440ff).into()), + tab_active_background: Some(rgba(0x3b4252ff).into()), + editor_background: Some(rgba(0x2e3440ff).into()), + editor_gutter_background: Some(rgba(0x2e3440ff).into()), + editor_line_number: Some(rgba(0x4c566aff).into()), + editor_active_line_number: Some(rgba(0xd8dee9ff).into()), + terminal_background: Some(rgba(0x2e3440ff).into()), + terminal_ansi_bright_black: Some(rgba(0x4c566aff).into()), + terminal_ansi_bright_red: Some(rgba(0xbf616aff).into()), + terminal_ansi_bright_green: Some(rgba(0xa3be8cff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xebcb8bff).into()), + terminal_ansi_bright_blue: Some(rgba(0x81a1c1ff).into()), + terminal_ansi_bright_magenta: Some(rgba(0xb48eacff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x8fbcbbff).into()), + terminal_ansi_bright_white: Some(rgba(0xeceff4ff).into()), + terminal_ansi_black: Some(rgba(0x3b4252ff).into()), + terminal_ansi_red: Some(rgba(0xbf616aff).into()), + terminal_ansi_green: Some(rgba(0xa3be8cff).into()), + terminal_ansi_yellow: Some(rgba(0xebcb8bff).into()), + terminal_ansi_blue: Some(rgba(0x81a1c1ff).into()), + terminal_ansi_magenta: Some(rgba(0xb48eacff).into()), + terminal_ansi_cyan: Some(rgba(0x88bfd0ff).into()), + terminal_ansi_white: Some(rgba(0xe5e9f0ff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xbf616aff).into()), + error: Some(rgba(0xbf616aff).into()), + hidden: Some(rgba(0xd8dee966).into()), + warning: Some(rgba(0xebcb8bff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("comment".into(), rgba(0x606e87ff).into()), + ("punctuation".into(), rgba(0x81a1c1ff).into()), + ("something".into(), rgba(0xa3be8cff).into()), + ], + }), + }, + }], + } } - } - \ No newline at end of file diff --git a/crates/theme2/src/themes/notctis.rs b/crates/theme2/src/themes/notctis.rs index 8ac36cad64b7e618bdcd93f7da18acd43289631e..437fa982984c0e863c299b6764e1104468a921d0 100644 --- a/crates/theme2/src/themes/notctis.rs +++ b/crates/theme2/src/themes/notctis.rs @@ -1,18 +1,689 @@ +// This file was generated by the `theme_importer`. +// Be careful when modifying it by hand. - // This file was generated by the `theme_importer`. - // Be careful when modifying it by hand. +use gpui::rgba; - use gpui::rgba; +use crate::{ + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, + UserThemeStylesRefinement, +}; - use crate::{ - Appearance, ThemeColorsRefinement, StatusColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, - }; - - pub fn notctis() -> UserThemeFamily { - UserThemeFamily { - name: "Notctis".into(), - author: "Liviu Schera (liviuschera)".into(), - themes: vec![UserTheme { name: "Noctis Azureus".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x1579b6ff).into()),border_variant: Some(rgba(0x1579b6ff).into()),border_focused: Some(rgba(0x08324eff).into()),border_selected: Some(rgba(0x1579b6ff).into()),border_transparent: Some(rgba(0x1579b6ff).into()),border_disabled: Some(rgba(0x1579b6ff).into()),elevated_surface_background: Some(rgba(0x051b28ff).into()),surface_background: Some(rgba(0x051b28ff).into()),background: Some(rgba(0x07263aff).into()),element_background: Some(rgba(0x007e99ff).into()),element_hover: Some(rgba(0x00558a65).into()),element_selected: Some(rgba(0x0b3f5fff).into()),drop_target_background: Some(rgba(0x00294dff).into()),ghost_element_hover: Some(rgba(0x00558a65).into()),text: Some(rgba(0xbecfdaff).into()),tab_inactive_background: Some(rgba(0x08324eff).into()),tab_active_background: Some(rgba(0x07263aff).into()),editor_background: Some(rgba(0x07263aff).into()),editor_gutter_background: Some(rgba(0x07263aff).into()),editor_line_number: Some(rgba(0x4c6b7fff).into()),editor_active_line_number: Some(rgba(0xbecfdaff).into()),terminal_background: Some(rgba(0x051b28ff).into()),terminal_ansi_bright_black: Some(rgba(0x475e6cff).into()),terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()),terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()),terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()),terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()),terminal_ansi_bright_white: Some(rgba(0xbecfdaff).into()),terminal_ansi_black: Some(rgba(0x28343dff).into()),terminal_ansi_red: Some(rgba(0xe66432ff).into()),terminal_ansi_green: Some(rgba(0x49e9a6ff).into()),terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()),terminal_ansi_blue: Some(rgba(0x49ace9ff).into()),terminal_ansi_magenta: Some(rgba(0xdf759aff).into()),terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()),terminal_ansi_white: Some(rgba(0xaec3d0ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xe34d1bff).into()),error: Some(rgba(0xe34d1bff).into()),hidden: Some(rgba(0x9fb6c6ff).into()),warning: Some(rgba(0xffa857ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x5888a5ff).into()), ("punctuation".into(), rgba(0x5888a5ff).into()), ("punctuation".into(), rgba(0xbecfdaff).into()), ("punctuation".into(), rgba(0xbecfdaff).into()), ("punctuation".into(), rgba(0xdf759aff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("punctuation".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xd59719ff).into()), ("something".into(), rgba(0x49e9a6ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into())] }) } }, UserTheme { name: "Noctis Bordo".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x997582ff).into()),border_variant: Some(rgba(0x997582ff).into()),border_focused: Some(rgba(0x413036ff).into()),border_selected: Some(rgba(0x997582ff).into()),border_transparent: Some(rgba(0x997582ff).into()),border_disabled: Some(rgba(0x997582ff).into()),elevated_surface_background: Some(rgba(0x272022ff).into()),surface_background: Some(rgba(0x272022ff).into()),background: Some(rgba(0x322a2dff).into()),element_background: Some(rgba(0x007e99ff).into()),element_hover: Some(rgba(0x533641ff).into()),element_selected: Some(rgba(0x5c2e3e99).into()),drop_target_background: Some(rgba(0x38292eff).into()),ghost_element_hover: Some(rgba(0x533641ff).into()),text: Some(rgba(0xcbbec2ff).into()),tab_inactive_background: Some(rgba(0x413036ff).into()),tab_active_background: Some(rgba(0x322a2dff).into()),editor_background: Some(rgba(0x322a2dff).into()),editor_gutter_background: Some(rgba(0x322a2dff).into()),editor_line_number: Some(rgba(0x715b63ff).into()),editor_active_line_number: Some(rgba(0xcbbec2ff).into()),terminal_background: Some(rgba(0x272022ff).into()),terminal_ansi_bright_black: Some(rgba(0x69545bff).into()),terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()),terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()),terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()),terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()),terminal_ansi_bright_white: Some(rgba(0xcbbec2ff).into()),terminal_ansi_black: Some(rgba(0x47393eff).into()),terminal_ansi_red: Some(rgba(0xe66432ff).into()),terminal_ansi_green: Some(rgba(0x49e9a6ff).into()),terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()),terminal_ansi_blue: Some(rgba(0x49ace9ff).into()),terminal_ansi_magenta: Some(rgba(0xdf759aff).into()),terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()),terminal_ansi_white: Some(rgba(0xb9acb0ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xe34d1bff).into()),error: Some(rgba(0xe34d1bff).into()),hidden: Some(rgba(0xbbaab0ff).into()),warning: Some(rgba(0xffa857ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x8b737bff).into()), ("punctuation".into(), rgba(0x8b737bff).into()), ("punctuation".into(), rgba(0xcbbec2ff).into()), ("punctuation".into(), rgba(0xcbbec2ff).into()), ("punctuation".into(), rgba(0xdf759aff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("punctuation".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xd59719ff).into()), ("something".into(), rgba(0x49e9a6ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into())] }) } }, UserTheme { name: "Noctus Hibernus".into(), appearance: Appearance::Light, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x00c6e0ff).into()),border_variant: Some(rgba(0x00c6e0ff).into()),border_focused: Some(rgba(0xe0eff1ff).into()),border_selected: Some(rgba(0x00c6e0ff).into()),border_transparent: Some(rgba(0x00c6e0ff).into()),border_disabled: Some(rgba(0x00c6e0ff).into()),elevated_surface_background: Some(rgba(0xe1eeefff).into()),surface_background: Some(rgba(0xe1eeefff).into()),background: Some(rgba(0xf4f6f6ff).into()),element_background: Some(rgba(0x089099ff).into()),element_hover: Some(rgba(0xd1eafaff).into()),element_selected: Some(rgba(0xb6e1e7ff).into()),drop_target_background: Some(rgba(0xb1c9ccff).into()),ghost_element_hover: Some(rgba(0xd1eafaff).into()),text: Some(rgba(0x005661ff).into()),tab_inactive_background: Some(rgba(0xcaedf2ff).into()),tab_active_background: Some(rgba(0xf4f6f6ff).into()),editor_background: Some(rgba(0xf4f6f6ff).into()),editor_gutter_background: Some(rgba(0xf4f6f6ff).into()),editor_line_number: Some(rgba(0xa0abacff).into()),editor_active_line_number: Some(rgba(0x005661ff).into()),terminal_background: Some(rgba(0xe1eeefff).into()),terminal_ansi_bright_black: Some(rgba(0x004d57ff).into()),terminal_ansi_bright_red: Some(rgba(0xff3f00ff).into()),terminal_ansi_bright_green: Some(rgba(0x00d17aff).into()),terminal_ansi_bright_yellow: Some(rgba(0xff8c00ff).into()),terminal_ansi_bright_blue: Some(rgba(0x0ea3ffff).into()),terminal_ansi_bright_magenta: Some(rgba(0xff6b9eff).into()),terminal_ansi_bright_cyan: Some(rgba(0x00cae6ff).into()),terminal_ansi_bright_white: Some(rgba(0xbbc3c4ff).into()),terminal_ansi_black: Some(rgba(0x003b41ff).into()),terminal_ansi_red: Some(rgba(0xe34d1bff).into()),terminal_ansi_green: Some(rgba(0x00b368ff).into()),terminal_ansi_yellow: Some(rgba(0xf49724ff).into()),terminal_ansi_blue: Some(rgba(0x0094f0ff).into()),terminal_ansi_magenta: Some(rgba(0xff5792ff).into()),terminal_ansi_cyan: Some(rgba(0x00bdd6ff).into()),terminal_ansi_white: Some(rgba(0x8ca6a6ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xff3f00ff).into()),error: Some(rgba(0xff3f00ff).into()),hidden: Some(rgba(0x70838dff).into()),warning: Some(rgba(0xe07a52ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x8ca6a6ff).into()), ("punctuation".into(), rgba(0x8ca6a6ff).into()), ("punctuation".into(), rgba(0x004d57ff).into()), ("punctuation".into(), rgba(0x004d57ff).into()), ("punctuation".into(), rgba(0xff5792ff).into()), ("something".into(), rgba(0xfa8900ff).into()), ("something".into(), rgba(0xfa8900ff).into()), ("punctuation".into(), rgba(0xfa8900ff).into()), ("something".into(), rgba(0xa88c00ff).into()), ("something".into(), rgba(0x00b368ff).into()), ("punctuation".into(), rgba(0x0094f0ff).into()), ("punctuation".into(), rgba(0x0094f0ff).into())] }) } }, UserTheme { name: "Noctis Lilac".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0xaea4f4ff).into()),border_variant: Some(rgba(0xaea4f4ff).into()),border_focused: Some(rgba(0xdedbf5ff).into()),border_selected: Some(rgba(0xaea4f4ff).into()),border_transparent: Some(rgba(0xaea4f4ff).into()),border_disabled: Some(rgba(0xaea4f4ff).into()),elevated_surface_background: Some(rgba(0xe9e7f3ff).into()),surface_background: Some(rgba(0xe9e7f3ff).into()),background: Some(rgba(0xf2f1f8ff).into()),element_background: Some(rgba(0x8d7ffeff).into()),element_hover: Some(rgba(0xd1cbfeff).into()),element_selected: Some(rgba(0xbcb6e7ff).into()),drop_target_background: Some(rgba(0xafaad4aa).into()),ghost_element_hover: Some(rgba(0xd1cbfeff).into()),text: Some(rgba(0x0c006bff).into()),tab_inactive_background: Some(rgba(0xe2dff6ff).into()),tab_active_background: Some(rgba(0xf2f1f8ff).into()),editor_background: Some(rgba(0xf2f1f8ff).into()),editor_gutter_background: Some(rgba(0xf2f1f8ff).into()),editor_line_number: Some(rgba(0x9c99b0ff).into()),editor_active_line_number: Some(rgba(0x0c006bff).into()),terminal_background: Some(rgba(0xe9e7f3ff).into()),terminal_ansi_bright_black: Some(rgba(0x0f0080ff).into()),terminal_ansi_bright_red: Some(rgba(0xff3f00ff).into()),terminal_ansi_bright_green: Some(rgba(0x00d17aff).into()),terminal_ansi_bright_yellow: Some(rgba(0xff8c00ff).into()),terminal_ansi_bright_blue: Some(rgba(0x0ea3ffff).into()),terminal_ansi_bright_magenta: Some(rgba(0xff6b9eff).into()),terminal_ansi_bright_cyan: Some(rgba(0x00cae6ff).into()),terminal_ansi_bright_white: Some(rgba(0xbbc3c4ff).into()),terminal_ansi_black: Some(rgba(0x0c006bff).into()),terminal_ansi_red: Some(rgba(0xe34d1bff).into()),terminal_ansi_green: Some(rgba(0x00b368ff).into()),terminal_ansi_yellow: Some(rgba(0xf49724ff).into()),terminal_ansi_blue: Some(rgba(0x0094f0ff).into()),terminal_ansi_magenta: Some(rgba(0xff5792ff).into()),terminal_ansi_cyan: Some(rgba(0x00bdd6ff).into()),terminal_ansi_white: Some(rgba(0x8ca6a6ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xff3f00ff).into()),error: Some(rgba(0xff3f00ff).into()),hidden: Some(rgba(0x74708dff).into()),warning: Some(rgba(0xe07a52ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x9995b7ff).into()), ("punctuation".into(), rgba(0x9995b7ff).into()), ("punctuation".into(), rgba(0x0c006bff).into()), ("punctuation".into(), rgba(0x0c006bff).into()), ("punctuation".into(), rgba(0xff5792ff).into()), ("something".into(), rgba(0xfa8900ff).into()), ("something".into(), rgba(0xfa8900ff).into()), ("punctuation".into(), rgba(0xfa8900ff).into()), ("something".into(), rgba(0xa88c00ff).into()), ("something".into(), rgba(0x00b368ff).into()), ("punctuation".into(), rgba(0x0094f0ff).into()), ("punctuation".into(), rgba(0x0094f0ff).into())] }) } }, UserTheme { name: "Noctis Lux".into(), appearance: Appearance::Light, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x00c6e0ff).into()),border_variant: Some(rgba(0x00c6e0ff).into()),border_focused: Some(rgba(0xf2eddeff).into()),border_selected: Some(rgba(0x00c6e0ff).into()),border_transparent: Some(rgba(0x00c6e0ff).into()),border_disabled: Some(rgba(0x00c6e0ff).into()),elevated_surface_background: Some(rgba(0xf6eddaff).into()),surface_background: Some(rgba(0xf6eddaff).into()),background: Some(rgba(0xfef8ecff).into()),element_background: Some(rgba(0x089099ff).into()),element_hover: Some(rgba(0xd1f2f8ff).into()),element_selected: Some(rgba(0xb6e1e7ff).into()),drop_target_background: Some(rgba(0xcccab1ff).into()),ghost_element_hover: Some(rgba(0xd1f2f8ff).into()),text: Some(rgba(0x005661ff).into()),tab_inactive_background: Some(rgba(0xf0e9d6ff).into()),tab_active_background: Some(rgba(0xfef8ecff).into()),editor_background: Some(rgba(0xfef8ecff).into()),editor_gutter_background: Some(rgba(0xfef8ecff).into()),editor_line_number: Some(rgba(0xa0abacff).into()),editor_active_line_number: Some(rgba(0x005661ff).into()),terminal_background: Some(rgba(0xf6eddaff).into()),terminal_ansi_bright_black: Some(rgba(0x004d57ff).into()),terminal_ansi_bright_red: Some(rgba(0xff3f00ff).into()),terminal_ansi_bright_green: Some(rgba(0x00d17aff).into()),terminal_ansi_bright_yellow: Some(rgba(0xff8c00ff).into()),terminal_ansi_bright_blue: Some(rgba(0x0ea3ffff).into()),terminal_ansi_bright_magenta: Some(rgba(0xff6b9eff).into()),terminal_ansi_bright_cyan: Some(rgba(0x00cae6ff).into()),terminal_ansi_bright_white: Some(rgba(0xbbc3c4ff).into()),terminal_ansi_black: Some(rgba(0x003b41ff).into()),terminal_ansi_red: Some(rgba(0xe34d1bff).into()),terminal_ansi_green: Some(rgba(0x00b368ff).into()),terminal_ansi_yellow: Some(rgba(0xf49724ff).into()),terminal_ansi_blue: Some(rgba(0x0094f0ff).into()),terminal_ansi_magenta: Some(rgba(0xff5792ff).into()),terminal_ansi_cyan: Some(rgba(0x00bdd6ff).into()),terminal_ansi_white: Some(rgba(0x8ca6a6ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xff3f00ff).into()),error: Some(rgba(0xff3f00ff).into()),hidden: Some(rgba(0x878476ff).into()),warning: Some(rgba(0xe07a52ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x8ca6a6ff).into()), ("punctuation".into(), rgba(0x8ca6a6ff).into()), ("punctuation".into(), rgba(0x004d57ff).into()), ("punctuation".into(), rgba(0x004d57ff).into()), ("punctuation".into(), rgba(0xff5792ff).into()), ("something".into(), rgba(0xfa8900ff).into()), ("something".into(), rgba(0xfa8900ff).into()), ("punctuation".into(), rgba(0xfa8900ff).into()), ("something".into(), rgba(0xa88c00ff).into()), ("something".into(), rgba(0x00b368ff).into()), ("punctuation".into(), rgba(0x0094f0ff).into()), ("punctuation".into(), rgba(0x0094f0ff).into())] }) } }, UserTheme { name: "Noctis Minimus".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x496c83ff).into()),border_variant: Some(rgba(0x496c83ff).into()),border_focused: Some(rgba(0x202d37ff).into()),border_selected: Some(rgba(0x496c83ff).into()),border_transparent: Some(rgba(0x496c83ff).into()),border_disabled: Some(rgba(0x496c83ff).into()),elevated_surface_background: Some(rgba(0x0e1920ff).into()),surface_background: Some(rgba(0x0e1920ff).into()),background: Some(rgba(0x1b2932ff).into()),element_background: Some(rgba(0x2e616bff).into()),element_hover: Some(rgba(0x00558aff).into()),element_selected: Some(rgba(0x2c414eff).into()),drop_target_background: Some(rgba(0x152836ff).into()),ghost_element_hover: Some(rgba(0x00558aff).into()),text: Some(rgba(0xc5cdd3ff).into()),tab_inactive_background: Some(rgba(0x202d37ff).into()),tab_active_background: Some(rgba(0x1b2932ff).into()),editor_background: Some(rgba(0x1b2932ff).into()),editor_gutter_background: Some(rgba(0x1b2932ff).into()),editor_line_number: Some(rgba(0x5d6e79ff).into()),editor_active_line_number: Some(rgba(0xc5cdd3ff).into()),terminal_background: Some(rgba(0x0e1920ff).into()),terminal_ansi_bright_black: Some(rgba(0x425866ff).into()),terminal_ansi_bright_red: Some(rgba(0xca8468ff).into()),terminal_ansi_bright_green: Some(rgba(0x84c8abff).into()),terminal_ansi_bright_yellow: Some(rgba(0xd1aa7bff).into()),terminal_ansi_bright_blue: Some(rgba(0x68a4caff).into()),terminal_ansi_bright_magenta: Some(rgba(0xc88da2ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x84bfc8ff).into()),terminal_ansi_bright_white: Some(rgba(0xc5d1d3ff).into()),terminal_ansi_black: Some(rgba(0x182935ff).into()),terminal_ansi_red: Some(rgba(0xc08872ff).into()),terminal_ansi_green: Some(rgba(0x72c09fff).into()),terminal_ansi_yellow: Some(rgba(0xc8a984ff).into()),terminal_ansi_blue: Some(rgba(0x6095b7ff).into()),terminal_ansi_magenta: Some(rgba(0xc28097ff).into()),terminal_ansi_cyan: Some(rgba(0x72b7c0ff).into()),terminal_ansi_white: Some(rgba(0xc5cdd3ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xb96245ff).into()),error: Some(rgba(0xb96245ff).into()),hidden: Some(rgba(0x96a8b6ff).into()),warning: Some(rgba(0xffa857ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x5d7787ff).into()), ("punctuation".into(), rgba(0x5d7787ff).into()), ("punctuation".into(), rgba(0xc5cdd3ff).into()), ("punctuation".into(), rgba(0xc5cdd3ff).into()), ("punctuation".into(), rgba(0xc88da2ff).into()), ("something".into(), rgba(0xd3b692ff).into()), ("something".into(), rgba(0xd3b692ff).into()), ("punctuation".into(), rgba(0xd3b692ff).into()), ("something".into(), rgba(0xa88c00ff).into()), ("something".into(), rgba(0x72c09fff).into()), ("punctuation".into(), rgba(0x5897bfff).into()), ("punctuation".into(), rgba(0x5897bfff).into())] }) } }, UserTheme { name: "Noctis".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x0d6571ff).into()),border_variant: Some(rgba(0x0d6571ff).into()),border_focused: Some(rgba(0x063940ff).into()),border_selected: Some(rgba(0x0d6571ff).into()),border_transparent: Some(rgba(0x0d6571ff).into()),border_disabled: Some(rgba(0x0d6571ff).into()),elevated_surface_background: Some(rgba(0x03181aff).into()),surface_background: Some(rgba(0x03181aff).into()),background: Some(rgba(0x052428ff).into()),element_background: Some(rgba(0x089099ff).into()),element_hover: Some(rgba(0x0b505aff).into()),element_selected: Some(rgba(0x0d6571ff).into()),drop_target_background: Some(rgba(0x00404dff).into()),ghost_element_hover: Some(rgba(0x0b505aff).into()),text: Some(rgba(0xb1c9ccff).into()),tab_inactive_background: Some(rgba(0x052e32ff).into()),tab_active_background: Some(rgba(0x052428ff).into()),editor_background: Some(rgba(0x052428ff).into()),editor_gutter_background: Some(rgba(0x052428ff).into()),editor_line_number: Some(rgba(0x4e6b6eff).into()),editor_active_line_number: Some(rgba(0xb1c9ccff).into()),terminal_background: Some(rgba(0x03181aff).into()),terminal_ansi_bright_black: Some(rgba(0x47686cff).into()),terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()),terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()),terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()),terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()),terminal_ansi_bright_white: Some(rgba(0xc1d4d7ff).into()),terminal_ansi_black: Some(rgba(0x324a4dff).into()),terminal_ansi_red: Some(rgba(0xe66432ff).into()),terminal_ansi_green: Some(rgba(0x49e9a6ff).into()),terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()),terminal_ansi_blue: Some(rgba(0x49ace9ff).into()),terminal_ansi_magenta: Some(rgba(0xdf759aff).into()),terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()),terminal_ansi_white: Some(rgba(0xb1c9ccff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xe34d1bff).into()),error: Some(rgba(0xe34d1bff).into()),hidden: Some(rgba(0x87a7abff).into()),warning: Some(rgba(0xffa487ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x5b858bff).into()), ("punctuation".into(), rgba(0x5b858bff).into()), ("punctuation".into(), rgba(0xb1c9ccff).into()), ("punctuation".into(), rgba(0xb1c9ccff).into()), ("punctuation".into(), rgba(0xdf759aff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("punctuation".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xd59719ff).into()), ("something".into(), rgba(0x49e9a6ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into())] }) } }, UserTheme { name: "Noctis Obscuro".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x0d6571ff).into()),border_variant: Some(rgba(0x0d6571ff).into()),border_focused: Some(rgba(0x052e32ff).into()),border_selected: Some(rgba(0x0d6571ff).into()),border_transparent: Some(rgba(0x0d6571ff).into()),border_disabled: Some(rgba(0x0d6571ff).into()),elevated_surface_background: Some(rgba(0x020c0eff).into()),surface_background: Some(rgba(0x020c0eff).into()),background: Some(rgba(0x031316ff).into()),element_background: Some(rgba(0x089099ff).into()),element_hover: Some(rgba(0x0b505aff).into()),element_selected: Some(rgba(0x0d6571ff).into()),drop_target_background: Some(rgba(0x00404dff).into()),ghost_element_hover: Some(rgba(0x0b505aff).into()),text: Some(rgba(0xb1c9ccff).into()),tab_inactive_background: Some(rgba(0x052e32ff).into()),tab_active_background: Some(rgba(0x031316ff).into()),editor_background: Some(rgba(0x031316ff).into()),editor_gutter_background: Some(rgba(0x031316ff).into()),editor_line_number: Some(rgba(0x4e6b6eff).into()),editor_active_line_number: Some(rgba(0xb1c9ccff).into()),terminal_background: Some(rgba(0x020c0eff).into()),terminal_ansi_bright_black: Some(rgba(0x47686cff).into()),terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()),terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()),terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()),terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()),terminal_ansi_bright_white: Some(rgba(0xc1d4d7ff).into()),terminal_ansi_black: Some(rgba(0x324a4dff).into()),terminal_ansi_red: Some(rgba(0xe66432ff).into()),terminal_ansi_green: Some(rgba(0x49e9a6ff).into()),terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()),terminal_ansi_blue: Some(rgba(0x49ace9ff).into()),terminal_ansi_magenta: Some(rgba(0xdf759aff).into()),terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()),terminal_ansi_white: Some(rgba(0xb1c9ccff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xe34d1bff).into()),error: Some(rgba(0xe34d1bff).into()),hidden: Some(rgba(0x87a7abff).into()),warning: Some(rgba(0xffa487ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x5b858bff).into()), ("punctuation".into(), rgba(0x5b858bff).into()), ("punctuation".into(), rgba(0xb1c9ccff).into()), ("punctuation".into(), rgba(0xb1c9ccff).into()), ("punctuation".into(), rgba(0xdf759aff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("punctuation".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xd59719ff).into()), ("something".into(), rgba(0x49e9a6ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into())] }) } }, UserTheme { name: "Noctis Sereno".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x0d6571ff).into()),border_variant: Some(rgba(0x0d6571ff).into()),border_focused: Some(rgba(0x052e32ff).into()),border_selected: Some(rgba(0x0d6571ff).into()),border_transparent: Some(rgba(0x0d6571ff).into()),border_disabled: Some(rgba(0x0d6571ff).into()),elevated_surface_background: Some(rgba(0x020c0eff).into()),surface_background: Some(rgba(0x020c0eff).into()),background: Some(rgba(0x031316ff).into()),element_background: Some(rgba(0x089099ff).into()),element_hover: Some(rgba(0x0b505aff).into()),element_selected: Some(rgba(0x0d6571ff).into()),drop_target_background: Some(rgba(0x00404dff).into()),ghost_element_hover: Some(rgba(0x0b505aff).into()),text: Some(rgba(0xb1c9ccff).into()),tab_inactive_background: Some(rgba(0x052e32ff).into()),tab_active_background: Some(rgba(0x031316ff).into()),editor_background: Some(rgba(0x031316ff).into()),editor_gutter_background: Some(rgba(0x031316ff).into()),editor_line_number: Some(rgba(0x4e6b6eff).into()),editor_active_line_number: Some(rgba(0xb1c9ccff).into()),terminal_background: Some(rgba(0x020c0eff).into()),terminal_ansi_bright_black: Some(rgba(0x47686cff).into()),terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()),terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()),terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()),terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()),terminal_ansi_bright_white: Some(rgba(0xc1d4d7ff).into()),terminal_ansi_black: Some(rgba(0x324a4dff).into()),terminal_ansi_red: Some(rgba(0xe66432ff).into()),terminal_ansi_green: Some(rgba(0x49e9a6ff).into()),terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()),terminal_ansi_blue: Some(rgba(0x49ace9ff).into()),terminal_ansi_magenta: Some(rgba(0xdf759aff).into()),terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()),terminal_ansi_white: Some(rgba(0xb1c9ccff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xe34d1bff).into()),error: Some(rgba(0xe34d1bff).into()),hidden: Some(rgba(0x87a7abff).into()),warning: Some(rgba(0xffa487ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x5b858bff).into()), ("punctuation".into(), rgba(0x5b858bff).into()), ("punctuation".into(), rgba(0xb1c9ccff).into()), ("punctuation".into(), rgba(0xb1c9ccff).into()), ("punctuation".into(), rgba(0xdf759aff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("punctuation".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xd59719ff).into()), ("something".into(), rgba(0x49e9a6ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into())] }) } }, UserTheme { name: "Noctis Uva".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x6d66a7ff).into()),border_variant: Some(rgba(0x6d66a7ff).into()),border_focused: Some(rgba(0x2f2c49ff).into()),border_selected: Some(rgba(0x6d66a7ff).into()),border_transparent: Some(rgba(0x6d66a7ff).into()),border_disabled: Some(rgba(0x6d66a7ff).into()),elevated_surface_background: Some(rgba(0x1f1d30ff).into()),surface_background: Some(rgba(0x1f1d30ff).into()),background: Some(rgba(0x292640ff).into()),element_background: Some(rgba(0x007e99ff).into()),element_hover: Some(rgba(0x383866ff).into()),element_selected: Some(rgba(0x322e5cff).into()),drop_target_background: Some(rgba(0x202040ff).into()),ghost_element_hover: Some(rgba(0x383866ff).into()),text: Some(rgba(0xc5c2d6ff).into()),tab_inactive_background: Some(rgba(0x2f2c49ff).into()),tab_active_background: Some(rgba(0x292640ff).into()),editor_background: Some(rgba(0x292640ff).into()),editor_gutter_background: Some(rgba(0x292640ff).into()),editor_line_number: Some(rgba(0x5c5973ff).into()),editor_active_line_number: Some(rgba(0xc5c2d6ff).into()),terminal_background: Some(rgba(0x1f1d30ff).into()),terminal_ansi_bright_black: Some(rgba(0x504e65ff).into()),terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()),terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()),terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()),terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()),terminal_ansi_bright_white: Some(rgba(0xc5c2d6ff).into()),terminal_ansi_black: Some(rgba(0x302f3dff).into()),terminal_ansi_red: Some(rgba(0xe66432ff).into()),terminal_ansi_green: Some(rgba(0x49e9a6ff).into()),terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()),terminal_ansi_blue: Some(rgba(0x49ace9ff).into()),terminal_ansi_magenta: Some(rgba(0xdf759aff).into()),terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()),terminal_ansi_white: Some(rgba(0xb6b3ccff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xe34d1bff).into()),error: Some(rgba(0xe34d1bff).into()),hidden: Some(rgba(0xa9a5c0ff).into()),warning: Some(rgba(0xffa857ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x716b93ff).into()), ("punctuation".into(), rgba(0x716b93ff).into()), ("punctuation".into(), rgba(0xc5c2d6ff).into()), ("punctuation".into(), rgba(0xc5c2d6ff).into()), ("punctuation".into(), rgba(0xdf759aff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("punctuation".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xd59719ff).into()), ("something".into(), rgba(0x49e9a6ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into())] }) } }, UserTheme { name: "Noctis Viola".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x8666a7ff).into()),border_variant: Some(rgba(0x8666a7ff).into()),border_focused: Some(rgba(0x3d2e4dff).into()),border_selected: Some(rgba(0x8666a7ff).into()),border_transparent: Some(rgba(0x8666a7ff).into()),border_disabled: Some(rgba(0x8666a7ff).into()),elevated_surface_background: Some(rgba(0x291d35ff).into()),surface_background: Some(rgba(0x291d35ff).into()),background: Some(rgba(0x30243dff).into()),element_background: Some(rgba(0x007e99ff).into()),element_hover: Some(rgba(0x69438dff).into()),element_selected: Some(rgba(0x472e60ff).into()),drop_target_background: Some(rgba(0x302040ff).into()),ghost_element_hover: Some(rgba(0x69438dff).into()),text: Some(rgba(0xccbfd9ff).into()),tab_inactive_background: Some(rgba(0x3d2e4dff).into()),tab_active_background: Some(rgba(0x30243dff).into()),editor_background: Some(rgba(0x30243dff).into()),editor_gutter_background: Some(rgba(0x30243dff).into()),editor_line_number: Some(rgba(0x665973ff).into()),editor_active_line_number: Some(rgba(0xccbfd9ff).into()),terminal_background: Some(rgba(0x291d35ff).into()),terminal_ansi_bright_black: Some(rgba(0x594e65ff).into()),terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()),terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()),terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()),terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()),terminal_ansi_bright_white: Some(rgba(0xccbfd9ff).into()),terminal_ansi_black: Some(rgba(0x362f3dff).into()),terminal_ansi_red: Some(rgba(0xe66432ff).into()),terminal_ansi_green: Some(rgba(0x49e9a6ff).into()),terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()),terminal_ansi_blue: Some(rgba(0x49ace9ff).into()),terminal_ansi_magenta: Some(rgba(0xdf759aff).into()),terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()),terminal_ansi_white: Some(rgba(0xbfafcfff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xe34d1bff).into()),error: Some(rgba(0xe34d1bff).into()),hidden: Some(rgba(0xb3a5c0ff).into()),warning: Some(rgba(0xffa857ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x7e6499ff).into()), ("punctuation".into(), rgba(0x7e6499ff).into()), ("punctuation".into(), rgba(0xccbfd9ff).into()), ("punctuation".into(), rgba(0xccbfd9ff).into()), ("punctuation".into(), rgba(0xdf759aff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xe4b781ff).into()), ("punctuation".into(), rgba(0xe4b781ff).into()), ("something".into(), rgba(0xd59719ff).into()), ("something".into(), rgba(0x49e9a6ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into()), ("punctuation".into(), rgba(0x49ace9ff).into())] }) } }], +pub fn notctis() -> UserThemeFamily { + UserThemeFamily { + name: "Notctis".into(), + author: "Liviu Schera (liviuschera)".into(), + themes: vec![ + UserTheme { + name: "Noctis Azureus".into(), + appearance: Appearance::Dark, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0x1579b6ff).into()), + border_variant: Some(rgba(0x1579b6ff).into()), + border_focused: Some(rgba(0x08324eff).into()), + border_selected: Some(rgba(0x1579b6ff).into()), + border_transparent: Some(rgba(0x1579b6ff).into()), + border_disabled: Some(rgba(0x1579b6ff).into()), + elevated_surface_background: Some(rgba(0x051b28ff).into()), + surface_background: Some(rgba(0x051b28ff).into()), + background: Some(rgba(0x07263aff).into()), + element_background: Some(rgba(0x007e99ff).into()), + element_hover: Some(rgba(0x00558a65).into()), + element_selected: Some(rgba(0x0b3f5fff).into()), + drop_target_background: Some(rgba(0x00294dff).into()), + ghost_element_hover: Some(rgba(0x00558a65).into()), + text: Some(rgba(0xbecfdaff).into()), + tab_inactive_background: Some(rgba(0x08324eff).into()), + tab_active_background: Some(rgba(0x07263aff).into()), + editor_background: Some(rgba(0x07263aff).into()), + editor_gutter_background: Some(rgba(0x07263aff).into()), + editor_line_number: Some(rgba(0x4c6b7fff).into()), + editor_active_line_number: Some(rgba(0xbecfdaff).into()), + terminal_background: Some(rgba(0x051b28ff).into()), + terminal_ansi_bright_black: Some(rgba(0x475e6cff).into()), + terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()), + terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()), + terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()), + terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()), + terminal_ansi_bright_white: Some(rgba(0xbecfdaff).into()), + terminal_ansi_black: Some(rgba(0x28343dff).into()), + terminal_ansi_red: Some(rgba(0xe66432ff).into()), + terminal_ansi_green: Some(rgba(0x49e9a6ff).into()), + terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()), + terminal_ansi_blue: Some(rgba(0x49ace9ff).into()), + terminal_ansi_magenta: Some(rgba(0xdf759aff).into()), + terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()), + terminal_ansi_white: Some(rgba(0xaec3d0ff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xe34d1bff).into()), + error: Some(rgba(0xe34d1bff).into()), + hidden: Some(rgba(0x9fb6c6ff).into()), + warning: Some(rgba(0xffa857ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("comment".into(), rgba(0x5888a5ff).into()), + ("something".into(), rgba(0x49e9a6ff).into()), + ("punctuation".into(), rgba(0x49ace9ff).into()), + ], + }), + }, + }, + UserTheme { + name: "Noctis Bordo".into(), + appearance: Appearance::Dark, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0x997582ff).into()), + border_variant: Some(rgba(0x997582ff).into()), + border_focused: Some(rgba(0x413036ff).into()), + border_selected: Some(rgba(0x997582ff).into()), + border_transparent: Some(rgba(0x997582ff).into()), + border_disabled: Some(rgba(0x997582ff).into()), + elevated_surface_background: Some(rgba(0x272022ff).into()), + surface_background: Some(rgba(0x272022ff).into()), + background: Some(rgba(0x322a2dff).into()), + element_background: Some(rgba(0x007e99ff).into()), + element_hover: Some(rgba(0x533641ff).into()), + element_selected: Some(rgba(0x5c2e3e99).into()), + drop_target_background: Some(rgba(0x38292eff).into()), + ghost_element_hover: Some(rgba(0x533641ff).into()), + text: Some(rgba(0xcbbec2ff).into()), + tab_inactive_background: Some(rgba(0x413036ff).into()), + tab_active_background: Some(rgba(0x322a2dff).into()), + editor_background: Some(rgba(0x322a2dff).into()), + editor_gutter_background: Some(rgba(0x322a2dff).into()), + editor_line_number: Some(rgba(0x715b63ff).into()), + editor_active_line_number: Some(rgba(0xcbbec2ff).into()), + terminal_background: Some(rgba(0x272022ff).into()), + terminal_ansi_bright_black: Some(rgba(0x69545bff).into()), + terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()), + terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()), + terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()), + terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()), + terminal_ansi_bright_white: Some(rgba(0xcbbec2ff).into()), + terminal_ansi_black: Some(rgba(0x47393eff).into()), + terminal_ansi_red: Some(rgba(0xe66432ff).into()), + terminal_ansi_green: Some(rgba(0x49e9a6ff).into()), + terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()), + terminal_ansi_blue: Some(rgba(0x49ace9ff).into()), + terminal_ansi_magenta: Some(rgba(0xdf759aff).into()), + terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()), + terminal_ansi_white: Some(rgba(0xb9acb0ff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xe34d1bff).into()), + error: Some(rgba(0xe34d1bff).into()), + hidden: Some(rgba(0xbbaab0ff).into()), + warning: Some(rgba(0xffa857ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("comment".into(), rgba(0x8b737bff).into()), + ("punctuation".into(), rgba(0x49ace9ff).into()), + ("something".into(), rgba(0x49e9a6ff).into()), + ], + }), + }, + }, + UserTheme { + name: "Noctus Hibernus".into(), + appearance: Appearance::Light, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0x00c6e0ff).into()), + border_variant: Some(rgba(0x00c6e0ff).into()), + border_focused: Some(rgba(0xe0eff1ff).into()), + border_selected: Some(rgba(0x00c6e0ff).into()), + border_transparent: Some(rgba(0x00c6e0ff).into()), + border_disabled: Some(rgba(0x00c6e0ff).into()), + elevated_surface_background: Some(rgba(0xe1eeefff).into()), + surface_background: Some(rgba(0xe1eeefff).into()), + background: Some(rgba(0xf4f6f6ff).into()), + element_background: Some(rgba(0x089099ff).into()), + element_hover: Some(rgba(0xd1eafaff).into()), + element_selected: Some(rgba(0xb6e1e7ff).into()), + drop_target_background: Some(rgba(0xb1c9ccff).into()), + ghost_element_hover: Some(rgba(0xd1eafaff).into()), + text: Some(rgba(0x005661ff).into()), + tab_inactive_background: Some(rgba(0xcaedf2ff).into()), + tab_active_background: Some(rgba(0xf4f6f6ff).into()), + editor_background: Some(rgba(0xf4f6f6ff).into()), + editor_gutter_background: Some(rgba(0xf4f6f6ff).into()), + editor_line_number: Some(rgba(0xa0abacff).into()), + editor_active_line_number: Some(rgba(0x005661ff).into()), + terminal_background: Some(rgba(0xe1eeefff).into()), + terminal_ansi_bright_black: Some(rgba(0x004d57ff).into()), + terminal_ansi_bright_red: Some(rgba(0xff3f00ff).into()), + terminal_ansi_bright_green: Some(rgba(0x00d17aff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xff8c00ff).into()), + terminal_ansi_bright_blue: Some(rgba(0x0ea3ffff).into()), + terminal_ansi_bright_magenta: Some(rgba(0xff6b9eff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x00cae6ff).into()), + terminal_ansi_bright_white: Some(rgba(0xbbc3c4ff).into()), + terminal_ansi_black: Some(rgba(0x003b41ff).into()), + terminal_ansi_red: Some(rgba(0xe34d1bff).into()), + terminal_ansi_green: Some(rgba(0x00b368ff).into()), + terminal_ansi_yellow: Some(rgba(0xf49724ff).into()), + terminal_ansi_blue: Some(rgba(0x0094f0ff).into()), + terminal_ansi_magenta: Some(rgba(0xff5792ff).into()), + terminal_ansi_cyan: Some(rgba(0x00bdd6ff).into()), + terminal_ansi_white: Some(rgba(0x8ca6a6ff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xff3f00ff).into()), + error: Some(rgba(0xff3f00ff).into()), + hidden: Some(rgba(0x70838dff).into()), + warning: Some(rgba(0xe07a52ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("punctuation".into(), rgba(0x0094f0ff).into()), + ("something".into(), rgba(0x00b368ff).into()), + ("comment".into(), rgba(0x8ca6a6ff).into()), + ], + }), + }, + }, + UserTheme { + name: "Noctis Lilac".into(), + appearance: Appearance::Dark, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0xaea4f4ff).into()), + border_variant: Some(rgba(0xaea4f4ff).into()), + border_focused: Some(rgba(0xdedbf5ff).into()), + border_selected: Some(rgba(0xaea4f4ff).into()), + border_transparent: Some(rgba(0xaea4f4ff).into()), + border_disabled: Some(rgba(0xaea4f4ff).into()), + elevated_surface_background: Some(rgba(0xe9e7f3ff).into()), + surface_background: Some(rgba(0xe9e7f3ff).into()), + background: Some(rgba(0xf2f1f8ff).into()), + element_background: Some(rgba(0x8d7ffeff).into()), + element_hover: Some(rgba(0xd1cbfeff).into()), + element_selected: Some(rgba(0xbcb6e7ff).into()), + drop_target_background: Some(rgba(0xafaad4aa).into()), + ghost_element_hover: Some(rgba(0xd1cbfeff).into()), + text: Some(rgba(0x0c006bff).into()), + tab_inactive_background: Some(rgba(0xe2dff6ff).into()), + tab_active_background: Some(rgba(0xf2f1f8ff).into()), + editor_background: Some(rgba(0xf2f1f8ff).into()), + editor_gutter_background: Some(rgba(0xf2f1f8ff).into()), + editor_line_number: Some(rgba(0x9c99b0ff).into()), + editor_active_line_number: Some(rgba(0x0c006bff).into()), + terminal_background: Some(rgba(0xe9e7f3ff).into()), + terminal_ansi_bright_black: Some(rgba(0x0f0080ff).into()), + terminal_ansi_bright_red: Some(rgba(0xff3f00ff).into()), + terminal_ansi_bright_green: Some(rgba(0x00d17aff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xff8c00ff).into()), + terminal_ansi_bright_blue: Some(rgba(0x0ea3ffff).into()), + terminal_ansi_bright_magenta: Some(rgba(0xff6b9eff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x00cae6ff).into()), + terminal_ansi_bright_white: Some(rgba(0xbbc3c4ff).into()), + terminal_ansi_black: Some(rgba(0x0c006bff).into()), + terminal_ansi_red: Some(rgba(0xe34d1bff).into()), + terminal_ansi_green: Some(rgba(0x00b368ff).into()), + terminal_ansi_yellow: Some(rgba(0xf49724ff).into()), + terminal_ansi_blue: Some(rgba(0x0094f0ff).into()), + terminal_ansi_magenta: Some(rgba(0xff5792ff).into()), + terminal_ansi_cyan: Some(rgba(0x00bdd6ff).into()), + terminal_ansi_white: Some(rgba(0x8ca6a6ff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xff3f00ff).into()), + error: Some(rgba(0xff3f00ff).into()), + hidden: Some(rgba(0x74708dff).into()), + warning: Some(rgba(0xe07a52ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("comment".into(), rgba(0x9995b7ff).into()), + ("punctuation".into(), rgba(0x0094f0ff).into()), + ("something".into(), rgba(0x00b368ff).into()), + ], + }), + }, + }, + UserTheme { + name: "Noctis Lux".into(), + appearance: Appearance::Light, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0x00c6e0ff).into()), + border_variant: Some(rgba(0x00c6e0ff).into()), + border_focused: Some(rgba(0xf2eddeff).into()), + border_selected: Some(rgba(0x00c6e0ff).into()), + border_transparent: Some(rgba(0x00c6e0ff).into()), + border_disabled: Some(rgba(0x00c6e0ff).into()), + elevated_surface_background: Some(rgba(0xf6eddaff).into()), + surface_background: Some(rgba(0xf6eddaff).into()), + background: Some(rgba(0xfef8ecff).into()), + element_background: Some(rgba(0x089099ff).into()), + element_hover: Some(rgba(0xd1f2f8ff).into()), + element_selected: Some(rgba(0xb6e1e7ff).into()), + drop_target_background: Some(rgba(0xcccab1ff).into()), + ghost_element_hover: Some(rgba(0xd1f2f8ff).into()), + text: Some(rgba(0x005661ff).into()), + tab_inactive_background: Some(rgba(0xf0e9d6ff).into()), + tab_active_background: Some(rgba(0xfef8ecff).into()), + editor_background: Some(rgba(0xfef8ecff).into()), + editor_gutter_background: Some(rgba(0xfef8ecff).into()), + editor_line_number: Some(rgba(0xa0abacff).into()), + editor_active_line_number: Some(rgba(0x005661ff).into()), + terminal_background: Some(rgba(0xf6eddaff).into()), + terminal_ansi_bright_black: Some(rgba(0x004d57ff).into()), + terminal_ansi_bright_red: Some(rgba(0xff3f00ff).into()), + terminal_ansi_bright_green: Some(rgba(0x00d17aff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xff8c00ff).into()), + terminal_ansi_bright_blue: Some(rgba(0x0ea3ffff).into()), + terminal_ansi_bright_magenta: Some(rgba(0xff6b9eff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x00cae6ff).into()), + terminal_ansi_bright_white: Some(rgba(0xbbc3c4ff).into()), + terminal_ansi_black: Some(rgba(0x003b41ff).into()), + terminal_ansi_red: Some(rgba(0xe34d1bff).into()), + terminal_ansi_green: Some(rgba(0x00b368ff).into()), + terminal_ansi_yellow: Some(rgba(0xf49724ff).into()), + terminal_ansi_blue: Some(rgba(0x0094f0ff).into()), + terminal_ansi_magenta: Some(rgba(0xff5792ff).into()), + terminal_ansi_cyan: Some(rgba(0x00bdd6ff).into()), + terminal_ansi_white: Some(rgba(0x8ca6a6ff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xff3f00ff).into()), + error: Some(rgba(0xff3f00ff).into()), + hidden: Some(rgba(0x878476ff).into()), + warning: Some(rgba(0xe07a52ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("punctuation".into(), rgba(0x0094f0ff).into()), + ("comment".into(), rgba(0x8ca6a6ff).into()), + ("something".into(), rgba(0x00b368ff).into()), + ], + }), + }, + }, + UserTheme { + name: "Noctis Minimus".into(), + appearance: Appearance::Dark, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0x496c83ff).into()), + border_variant: Some(rgba(0x496c83ff).into()), + border_focused: Some(rgba(0x202d37ff).into()), + border_selected: Some(rgba(0x496c83ff).into()), + border_transparent: Some(rgba(0x496c83ff).into()), + border_disabled: Some(rgba(0x496c83ff).into()), + elevated_surface_background: Some(rgba(0x0e1920ff).into()), + surface_background: Some(rgba(0x0e1920ff).into()), + background: Some(rgba(0x1b2932ff).into()), + element_background: Some(rgba(0x2e616bff).into()), + element_hover: Some(rgba(0x00558aff).into()), + element_selected: Some(rgba(0x2c414eff).into()), + drop_target_background: Some(rgba(0x152836ff).into()), + ghost_element_hover: Some(rgba(0x00558aff).into()), + text: Some(rgba(0xc5cdd3ff).into()), + tab_inactive_background: Some(rgba(0x202d37ff).into()), + tab_active_background: Some(rgba(0x1b2932ff).into()), + editor_background: Some(rgba(0x1b2932ff).into()), + editor_gutter_background: Some(rgba(0x1b2932ff).into()), + editor_line_number: Some(rgba(0x5d6e79ff).into()), + editor_active_line_number: Some(rgba(0xc5cdd3ff).into()), + terminal_background: Some(rgba(0x0e1920ff).into()), + terminal_ansi_bright_black: Some(rgba(0x425866ff).into()), + terminal_ansi_bright_red: Some(rgba(0xca8468ff).into()), + terminal_ansi_bright_green: Some(rgba(0x84c8abff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xd1aa7bff).into()), + terminal_ansi_bright_blue: Some(rgba(0x68a4caff).into()), + terminal_ansi_bright_magenta: Some(rgba(0xc88da2ff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x84bfc8ff).into()), + terminal_ansi_bright_white: Some(rgba(0xc5d1d3ff).into()), + terminal_ansi_black: Some(rgba(0x182935ff).into()), + terminal_ansi_red: Some(rgba(0xc08872ff).into()), + terminal_ansi_green: Some(rgba(0x72c09fff).into()), + terminal_ansi_yellow: Some(rgba(0xc8a984ff).into()), + terminal_ansi_blue: Some(rgba(0x6095b7ff).into()), + terminal_ansi_magenta: Some(rgba(0xc28097ff).into()), + terminal_ansi_cyan: Some(rgba(0x72b7c0ff).into()), + terminal_ansi_white: Some(rgba(0xc5cdd3ff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xb96245ff).into()), + error: Some(rgba(0xb96245ff).into()), + hidden: Some(rgba(0x96a8b6ff).into()), + warning: Some(rgba(0xffa857ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("punctuation".into(), rgba(0x5897bfff).into()), + ("comment".into(), rgba(0x5d7787ff).into()), + ("something".into(), rgba(0x72c09fff).into()), + ], + }), + }, + }, + UserTheme { + name: "Noctis".into(), + appearance: Appearance::Dark, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0x0d6571ff).into()), + border_variant: Some(rgba(0x0d6571ff).into()), + border_focused: Some(rgba(0x063940ff).into()), + border_selected: Some(rgba(0x0d6571ff).into()), + border_transparent: Some(rgba(0x0d6571ff).into()), + border_disabled: Some(rgba(0x0d6571ff).into()), + elevated_surface_background: Some(rgba(0x03181aff).into()), + surface_background: Some(rgba(0x03181aff).into()), + background: Some(rgba(0x052428ff).into()), + element_background: Some(rgba(0x089099ff).into()), + element_hover: Some(rgba(0x0b505aff).into()), + element_selected: Some(rgba(0x0d6571ff).into()), + drop_target_background: Some(rgba(0x00404dff).into()), + ghost_element_hover: Some(rgba(0x0b505aff).into()), + text: Some(rgba(0xb1c9ccff).into()), + tab_inactive_background: Some(rgba(0x052e32ff).into()), + tab_active_background: Some(rgba(0x052428ff).into()), + editor_background: Some(rgba(0x052428ff).into()), + editor_gutter_background: Some(rgba(0x052428ff).into()), + editor_line_number: Some(rgba(0x4e6b6eff).into()), + editor_active_line_number: Some(rgba(0xb1c9ccff).into()), + terminal_background: Some(rgba(0x03181aff).into()), + terminal_ansi_bright_black: Some(rgba(0x47686cff).into()), + terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()), + terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()), + terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()), + terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()), + terminal_ansi_bright_white: Some(rgba(0xc1d4d7ff).into()), + terminal_ansi_black: Some(rgba(0x324a4dff).into()), + terminal_ansi_red: Some(rgba(0xe66432ff).into()), + terminal_ansi_green: Some(rgba(0x49e9a6ff).into()), + terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()), + terminal_ansi_blue: Some(rgba(0x49ace9ff).into()), + terminal_ansi_magenta: Some(rgba(0xdf759aff).into()), + terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()), + terminal_ansi_white: Some(rgba(0xb1c9ccff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xe34d1bff).into()), + error: Some(rgba(0xe34d1bff).into()), + hidden: Some(rgba(0x87a7abff).into()), + warning: Some(rgba(0xffa487ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("comment".into(), rgba(0x5b858bff).into()), + ("punctuation".into(), rgba(0x49ace9ff).into()), + ("something".into(), rgba(0x49e9a6ff).into()), + ], + }), + }, + }, + UserTheme { + name: "Noctis Obscuro".into(), + appearance: Appearance::Dark, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0x0d6571ff).into()), + border_variant: Some(rgba(0x0d6571ff).into()), + border_focused: Some(rgba(0x052e32ff).into()), + border_selected: Some(rgba(0x0d6571ff).into()), + border_transparent: Some(rgba(0x0d6571ff).into()), + border_disabled: Some(rgba(0x0d6571ff).into()), + elevated_surface_background: Some(rgba(0x020c0eff).into()), + surface_background: Some(rgba(0x020c0eff).into()), + background: Some(rgba(0x031316ff).into()), + element_background: Some(rgba(0x089099ff).into()), + element_hover: Some(rgba(0x0b505aff).into()), + element_selected: Some(rgba(0x0d6571ff).into()), + drop_target_background: Some(rgba(0x00404dff).into()), + ghost_element_hover: Some(rgba(0x0b505aff).into()), + text: Some(rgba(0xb1c9ccff).into()), + tab_inactive_background: Some(rgba(0x052e32ff).into()), + tab_active_background: Some(rgba(0x031316ff).into()), + editor_background: Some(rgba(0x031316ff).into()), + editor_gutter_background: Some(rgba(0x031316ff).into()), + editor_line_number: Some(rgba(0x4e6b6eff).into()), + editor_active_line_number: Some(rgba(0xb1c9ccff).into()), + terminal_background: Some(rgba(0x020c0eff).into()), + terminal_ansi_bright_black: Some(rgba(0x47686cff).into()), + terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()), + terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()), + terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()), + terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()), + terminal_ansi_bright_white: Some(rgba(0xc1d4d7ff).into()), + terminal_ansi_black: Some(rgba(0x324a4dff).into()), + terminal_ansi_red: Some(rgba(0xe66432ff).into()), + terminal_ansi_green: Some(rgba(0x49e9a6ff).into()), + terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()), + terminal_ansi_blue: Some(rgba(0x49ace9ff).into()), + terminal_ansi_magenta: Some(rgba(0xdf759aff).into()), + terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()), + terminal_ansi_white: Some(rgba(0xb1c9ccff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xe34d1bff).into()), + error: Some(rgba(0xe34d1bff).into()), + hidden: Some(rgba(0x87a7abff).into()), + warning: Some(rgba(0xffa487ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("something".into(), rgba(0x49e9a6ff).into()), + ("comment".into(), rgba(0x5b858bff).into()), + ("punctuation".into(), rgba(0x49ace9ff).into()), + ], + }), + }, + }, + UserTheme { + name: "Noctis Sereno".into(), + appearance: Appearance::Dark, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0x0d6571ff).into()), + border_variant: Some(rgba(0x0d6571ff).into()), + border_focused: Some(rgba(0x052e32ff).into()), + border_selected: Some(rgba(0x0d6571ff).into()), + border_transparent: Some(rgba(0x0d6571ff).into()), + border_disabled: Some(rgba(0x0d6571ff).into()), + elevated_surface_background: Some(rgba(0x020c0eff).into()), + surface_background: Some(rgba(0x020c0eff).into()), + background: Some(rgba(0x031316ff).into()), + element_background: Some(rgba(0x089099ff).into()), + element_hover: Some(rgba(0x0b505aff).into()), + element_selected: Some(rgba(0x0d6571ff).into()), + drop_target_background: Some(rgba(0x00404dff).into()), + ghost_element_hover: Some(rgba(0x0b505aff).into()), + text: Some(rgba(0xb1c9ccff).into()), + tab_inactive_background: Some(rgba(0x052e32ff).into()), + tab_active_background: Some(rgba(0x031316ff).into()), + editor_background: Some(rgba(0x031316ff).into()), + editor_gutter_background: Some(rgba(0x031316ff).into()), + editor_line_number: Some(rgba(0x4e6b6eff).into()), + editor_active_line_number: Some(rgba(0xb1c9ccff).into()), + terminal_background: Some(rgba(0x020c0eff).into()), + terminal_ansi_bright_black: Some(rgba(0x47686cff).into()), + terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()), + terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()), + terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()), + terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()), + terminal_ansi_bright_white: Some(rgba(0xc1d4d7ff).into()), + terminal_ansi_black: Some(rgba(0x324a4dff).into()), + terminal_ansi_red: Some(rgba(0xe66432ff).into()), + terminal_ansi_green: Some(rgba(0x49e9a6ff).into()), + terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()), + terminal_ansi_blue: Some(rgba(0x49ace9ff).into()), + terminal_ansi_magenta: Some(rgba(0xdf759aff).into()), + terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()), + terminal_ansi_white: Some(rgba(0xb1c9ccff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xe34d1bff).into()), + error: Some(rgba(0xe34d1bff).into()), + hidden: Some(rgba(0x87a7abff).into()), + warning: Some(rgba(0xffa487ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("something".into(), rgba(0x49e9a6ff).into()), + ("punctuation".into(), rgba(0x49ace9ff).into()), + ("comment".into(), rgba(0x5b858bff).into()), + ], + }), + }, + }, + UserTheme { + name: "Noctis Uva".into(), + appearance: Appearance::Dark, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0x6d66a7ff).into()), + border_variant: Some(rgba(0x6d66a7ff).into()), + border_focused: Some(rgba(0x2f2c49ff).into()), + border_selected: Some(rgba(0x6d66a7ff).into()), + border_transparent: Some(rgba(0x6d66a7ff).into()), + border_disabled: Some(rgba(0x6d66a7ff).into()), + elevated_surface_background: Some(rgba(0x1f1d30ff).into()), + surface_background: Some(rgba(0x1f1d30ff).into()), + background: Some(rgba(0x292640ff).into()), + element_background: Some(rgba(0x007e99ff).into()), + element_hover: Some(rgba(0x383866ff).into()), + element_selected: Some(rgba(0x322e5cff).into()), + drop_target_background: Some(rgba(0x202040ff).into()), + ghost_element_hover: Some(rgba(0x383866ff).into()), + text: Some(rgba(0xc5c2d6ff).into()), + tab_inactive_background: Some(rgba(0x2f2c49ff).into()), + tab_active_background: Some(rgba(0x292640ff).into()), + editor_background: Some(rgba(0x292640ff).into()), + editor_gutter_background: Some(rgba(0x292640ff).into()), + editor_line_number: Some(rgba(0x5c5973ff).into()), + editor_active_line_number: Some(rgba(0xc5c2d6ff).into()), + terminal_background: Some(rgba(0x1f1d30ff).into()), + terminal_ansi_bright_black: Some(rgba(0x504e65ff).into()), + terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()), + terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()), + terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()), + terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()), + terminal_ansi_bright_white: Some(rgba(0xc5c2d6ff).into()), + terminal_ansi_black: Some(rgba(0x302f3dff).into()), + terminal_ansi_red: Some(rgba(0xe66432ff).into()), + terminal_ansi_green: Some(rgba(0x49e9a6ff).into()), + terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()), + terminal_ansi_blue: Some(rgba(0x49ace9ff).into()), + terminal_ansi_magenta: Some(rgba(0xdf759aff).into()), + terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()), + terminal_ansi_white: Some(rgba(0xb6b3ccff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xe34d1bff).into()), + error: Some(rgba(0xe34d1bff).into()), + hidden: Some(rgba(0xa9a5c0ff).into()), + warning: Some(rgba(0xffa857ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("punctuation".into(), rgba(0x49ace9ff).into()), + ("comment".into(), rgba(0x716b93ff).into()), + ("something".into(), rgba(0x49e9a6ff).into()), + ], + }), + }, + }, + UserTheme { + name: "Noctis Viola".into(), + appearance: Appearance::Dark, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0x8666a7ff).into()), + border_variant: Some(rgba(0x8666a7ff).into()), + border_focused: Some(rgba(0x3d2e4dff).into()), + border_selected: Some(rgba(0x8666a7ff).into()), + border_transparent: Some(rgba(0x8666a7ff).into()), + border_disabled: Some(rgba(0x8666a7ff).into()), + elevated_surface_background: Some(rgba(0x291d35ff).into()), + surface_background: Some(rgba(0x291d35ff).into()), + background: Some(rgba(0x30243dff).into()), + element_background: Some(rgba(0x007e99ff).into()), + element_hover: Some(rgba(0x69438dff).into()), + element_selected: Some(rgba(0x472e60ff).into()), + drop_target_background: Some(rgba(0x302040ff).into()), + ghost_element_hover: Some(rgba(0x69438dff).into()), + text: Some(rgba(0xccbfd9ff).into()), + tab_inactive_background: Some(rgba(0x3d2e4dff).into()), + tab_active_background: Some(rgba(0x30243dff).into()), + editor_background: Some(rgba(0x30243dff).into()), + editor_gutter_background: Some(rgba(0x30243dff).into()), + editor_line_number: Some(rgba(0x665973ff).into()), + editor_active_line_number: Some(rgba(0xccbfd9ff).into()), + terminal_background: Some(rgba(0x291d35ff).into()), + terminal_ansi_bright_black: Some(rgba(0x594e65ff).into()), + terminal_ansi_bright_red: Some(rgba(0xe97749ff).into()), + terminal_ansi_bright_green: Some(rgba(0x5febb1ff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xe69532ff).into()), + terminal_ansi_bright_blue: Some(rgba(0x5fb5ebff).into()), + terminal_ansi_bright_magenta: Some(rgba(0xe697b2ff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x5fdaebff).into()), + terminal_ansi_bright_white: Some(rgba(0xccbfd9ff).into()), + terminal_ansi_black: Some(rgba(0x362f3dff).into()), + terminal_ansi_red: Some(rgba(0xe66432ff).into()), + terminal_ansi_green: Some(rgba(0x49e9a6ff).into()), + terminal_ansi_yellow: Some(rgba(0xe4b781ff).into()), + terminal_ansi_blue: Some(rgba(0x49ace9ff).into()), + terminal_ansi_magenta: Some(rgba(0xdf759aff).into()), + terminal_ansi_cyan: Some(rgba(0x49d5e9ff).into()), + terminal_ansi_white: Some(rgba(0xbfafcfff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xe34d1bff).into()), + error: Some(rgba(0xe34d1bff).into()), + hidden: Some(rgba(0xb3a5c0ff).into()), + warning: Some(rgba(0xffa857ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("something".into(), rgba(0x49e9a6ff).into()), + ("comment".into(), rgba(0x7e6499ff).into()), + ("punctuation".into(), rgba(0x49ace9ff).into()), + ], + }), + }, + }, + ], + } } - } - \ No newline at end of file diff --git a/crates/theme2/src/themes/palenight.rs b/crates/theme2/src/themes/palenight.rs index a516aa4f58a455bd4872cb7c1b9a4f1267a6beba..679fe1514c73bb3b4c6d9153315d4acdaec7afb9 100644 --- a/crates/theme2/src/themes/palenight.rs +++ b/crates/theme2/src/themes/palenight.rs @@ -1,18 +1,195 @@ +// This file was generated by the `theme_importer`. +// Be careful when modifying it by hand. - // This file was generated by the `theme_importer`. - // Be careful when modifying it by hand. +use gpui::rgba; - use gpui::rgba; +use crate::{ + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, + UserThemeStylesRefinement, +}; - use crate::{ - Appearance, ThemeColorsRefinement, StatusColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, - }; - - pub fn palenight() -> UserThemeFamily { - UserThemeFamily { - name: "Palenight".into(), - author: "Olaolu Olawuyi (whizkydee)".into(), - themes: vec![UserTheme { name: "Palenight".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x282b3bff).into()),border_variant: Some(rgba(0x282b3bff).into()),border_focused: Some(rgba(0x282b3bff).into()),border_selected: Some(rgba(0x282b3bff).into()),border_transparent: Some(rgba(0x282b3bff).into()),border_disabled: Some(rgba(0x282b3bff).into()),elevated_surface_background: Some(rgba(0x292c3eff).into()),surface_background: Some(rgba(0x292c3eff).into()),background: Some(rgba(0x292c3eff).into()),element_background: Some(rgba(0x7d56c1cc).into()),element_hover: Some(rgba(0x0000001a).into()),element_selected: Some(rgba(0x7d56c1ff).into()),drop_target_background: Some(rgba(0x2e3245ff).into()),ghost_element_hover: Some(rgba(0x0000001a).into()),text: Some(rgba(0xffffffff).into()),tab_inactive_background: Some(rgba(0x31364aff).into()),tab_active_background: Some(rgba(0x292c3eff).into()),editor_background: Some(rgba(0x292c3eff).into()),editor_gutter_background: Some(rgba(0x292c3eff).into()),editor_line_number: Some(rgba(0x4c5374ff).into()),editor_active_line_number: Some(rgba(0xbfc7d5ff).into()),terminal_ansi_bright_black: Some(rgba(0x676e95ff).into()),terminal_ansi_bright_red: Some(rgba(0xff5571ff).into()),terminal_ansi_bright_green: Some(rgba(0xc3e88dff).into()),terminal_ansi_bright_yellow: Some(rgba(0xffcb6bff).into()),terminal_ansi_bright_blue: Some(rgba(0x82aaffff).into()),terminal_ansi_bright_magenta: Some(rgba(0xc792eaff).into()),terminal_ansi_bright_cyan: Some(rgba(0x89ddffff).into()),terminal_ansi_bright_white: Some(rgba(0xffffffff).into()),terminal_ansi_black: Some(rgba(0x676e95ff).into()),terminal_ansi_red: Some(rgba(0xff5571ff).into()),terminal_ansi_green: Some(rgba(0xa9c77dff).into()),terminal_ansi_yellow: Some(rgba(0xffcb6bff).into()),terminal_ansi_blue: Some(rgba(0x82aaffff).into()),terminal_ansi_magenta: Some(rgba(0xc792eaff).into()),terminal_ansi_cyan: Some(rgba(0x89ddffff).into()),terminal_ansi_white: Some(rgba(0xffffffff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xef524fff).into()),error: Some(rgba(0xef524fff).into()),hidden: Some(rgba(0x9199c8ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x687097ff).into()), ("something".into(), rgba(0xc3e88dff).into()), ("something".into(), rgba(0xffcb6bff).into()), ("punctuation".into(), rgba(0xc792eaff).into()), ("something".into(), rgba(0xc792eaff).into()), ("punctuation".into(), rgba(0x89ddffff).into()), ("punctuation".into(), rgba(0xd3413dff).into()), ("something".into(), rgba(0xc792eaff).into()), ("something".into(), rgba(0xffcb6bff).into()), ("something".into(), rgba(0x687097ff).into()), ("something".into(), rgba(0x7fcac3ff).into())] }) } }, UserTheme { name: "Palenight Operator".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x282b3bff).into()),border_variant: Some(rgba(0x282b3bff).into()),border_focused: Some(rgba(0x282b3bff).into()),border_selected: Some(rgba(0x282b3bff).into()),border_transparent: Some(rgba(0x282b3bff).into()),border_disabled: Some(rgba(0x282b3bff).into()),elevated_surface_background: Some(rgba(0x292c3eff).into()),surface_background: Some(rgba(0x292c3eff).into()),background: Some(rgba(0x292c3eff).into()),element_background: Some(rgba(0x7d56c1cc).into()),element_hover: Some(rgba(0x0000001a).into()),element_selected: Some(rgba(0x7d56c1ff).into()),drop_target_background: Some(rgba(0x2e3245ff).into()),ghost_element_hover: Some(rgba(0x0000001a).into()),text: Some(rgba(0xffffffff).into()),tab_inactive_background: Some(rgba(0x31364aff).into()),tab_active_background: Some(rgba(0x292c3eff).into()),editor_background: Some(rgba(0x292c3eff).into()),editor_gutter_background: Some(rgba(0x292c3eff).into()),editor_line_number: Some(rgba(0x4c5374ff).into()),editor_active_line_number: Some(rgba(0xbfc7d5ff).into()),terminal_ansi_bright_black: Some(rgba(0x676e95ff).into()),terminal_ansi_bright_red: Some(rgba(0xff5571ff).into()),terminal_ansi_bright_green: Some(rgba(0xc3e88dff).into()),terminal_ansi_bright_yellow: Some(rgba(0xffcb6bff).into()),terminal_ansi_bright_blue: Some(rgba(0x82aaffff).into()),terminal_ansi_bright_magenta: Some(rgba(0xc792eaff).into()),terminal_ansi_bright_cyan: Some(rgba(0x89ddffff).into()),terminal_ansi_bright_white: Some(rgba(0xffffffff).into()),terminal_ansi_black: Some(rgba(0x676e95ff).into()),terminal_ansi_red: Some(rgba(0xff5571ff).into()),terminal_ansi_green: Some(rgba(0xa9c77dff).into()),terminal_ansi_yellow: Some(rgba(0xffcb6bff).into()),terminal_ansi_blue: Some(rgba(0x82aaffff).into()),terminal_ansi_magenta: Some(rgba(0xc792eaff).into()),terminal_ansi_cyan: Some(rgba(0x89ddffff).into()),terminal_ansi_white: Some(rgba(0xffffffff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xef524fff).into()),error: Some(rgba(0xef524fff).into()),hidden: Some(rgba(0x9199c8ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x687097ff).into()), ("something".into(), rgba(0xc3e88dff).into()), ("something".into(), rgba(0xffcb6bff).into()), ("punctuation".into(), rgba(0xc792eaff).into()), ("something".into(), rgba(0xc792eaff).into()), ("punctuation".into(), rgba(0x89ddffff).into()), ("punctuation".into(), rgba(0xd3413dff).into()), ("something".into(), rgba(0xc792eaff).into()), ("something".into(), rgba(0xffcb6bff).into()), ("something".into(), rgba(0x687097ff).into()), ("something".into(), rgba(0x7fcac3ff).into())] }) } }, UserTheme { name: "Palenight (Mild Contrast)".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x2c2f40ff).into()),border_variant: Some(rgba(0x2c2f40ff).into()),border_focused: Some(rgba(0x2c2f40ff).into()),border_selected: Some(rgba(0x2c2f40ff).into()),border_transparent: Some(rgba(0x2c2f40ff).into()),border_disabled: Some(rgba(0x2c2f40ff).into()),elevated_surface_background: Some(rgba(0x25283aff).into()),surface_background: Some(rgba(0x25283aff).into()),background: Some(rgba(0x292c3eff).into()),element_background: Some(rgba(0x7d56c1cc).into()),element_hover: Some(rgba(0x0000001a).into()),element_selected: Some(rgba(0x7d56c1ff).into()),drop_target_background: Some(rgba(0x2e3245ff).into()),ghost_element_hover: Some(rgba(0x0000001a).into()),text: Some(rgba(0xffffffff).into()),tab_inactive_background: Some(rgba(0x31364aff).into()),tab_active_background: Some(rgba(0x25283aff).into()),editor_background: Some(rgba(0x292c3eff).into()),editor_gutter_background: Some(rgba(0x292c3eff).into()),editor_line_number: Some(rgba(0x4c5374ff).into()),editor_active_line_number: Some(rgba(0xbfc7d5ff).into()),terminal_ansi_bright_black: Some(rgba(0x676e95ff).into()),terminal_ansi_bright_red: Some(rgba(0xff5571ff).into()),terminal_ansi_bright_green: Some(rgba(0xc3e88dff).into()),terminal_ansi_bright_yellow: Some(rgba(0xffcb6bff).into()),terminal_ansi_bright_blue: Some(rgba(0x82aaffff).into()),terminal_ansi_bright_magenta: Some(rgba(0xc792eaff).into()),terminal_ansi_bright_cyan: Some(rgba(0x89ddffff).into()),terminal_ansi_bright_white: Some(rgba(0xffffffff).into()),terminal_ansi_black: Some(rgba(0x676e95ff).into()),terminal_ansi_red: Some(rgba(0xff5571ff).into()),terminal_ansi_green: Some(rgba(0xa9c77dff).into()),terminal_ansi_yellow: Some(rgba(0xffcb6bff).into()),terminal_ansi_blue: Some(rgba(0x82aaffff).into()),terminal_ansi_magenta: Some(rgba(0xc792eaff).into()),terminal_ansi_cyan: Some(rgba(0x89ddffff).into()),terminal_ansi_white: Some(rgba(0xffffffff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xef524fff).into()),error: Some(rgba(0xef524fff).into()),hidden: Some(rgba(0x9199c8ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x687097ff).into()), ("something".into(), rgba(0xc3e88dff).into()), ("something".into(), rgba(0xffcb6bff).into()), ("punctuation".into(), rgba(0xc792eaff).into()), ("something".into(), rgba(0xc792eaff).into()), ("punctuation".into(), rgba(0x89ddffff).into()), ("punctuation".into(), rgba(0xd3413dff).into()), ("something".into(), rgba(0xc792eaff).into()), ("something".into(), rgba(0xffcb6bff).into()), ("something".into(), rgba(0x687097ff).into()), ("something".into(), rgba(0x7fcac3ff).into())] }) } }], +pub fn palenight() -> UserThemeFamily { + UserThemeFamily { + name: "Palenight".into(), + author: "Olaolu Olawuyi (whizkydee)".into(), + themes: vec![ + UserTheme { + name: "Palenight".into(), + appearance: Appearance::Dark, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0x282b3bff).into()), + border_variant: Some(rgba(0x282b3bff).into()), + border_focused: Some(rgba(0x282b3bff).into()), + border_selected: Some(rgba(0x282b3bff).into()), + border_transparent: Some(rgba(0x282b3bff).into()), + border_disabled: Some(rgba(0x282b3bff).into()), + elevated_surface_background: Some(rgba(0x292c3eff).into()), + surface_background: Some(rgba(0x292c3eff).into()), + background: Some(rgba(0x292c3eff).into()), + element_background: Some(rgba(0x7d56c1cc).into()), + element_hover: Some(rgba(0x0000001a).into()), + element_selected: Some(rgba(0x7d56c1ff).into()), + drop_target_background: Some(rgba(0x2e3245ff).into()), + ghost_element_hover: Some(rgba(0x0000001a).into()), + text: Some(rgba(0xffffffff).into()), + tab_inactive_background: Some(rgba(0x31364aff).into()), + tab_active_background: Some(rgba(0x292c3eff).into()), + editor_background: Some(rgba(0x292c3eff).into()), + editor_gutter_background: Some(rgba(0x292c3eff).into()), + editor_line_number: Some(rgba(0x4c5374ff).into()), + editor_active_line_number: Some(rgba(0xbfc7d5ff).into()), + terminal_ansi_bright_black: Some(rgba(0x676e95ff).into()), + terminal_ansi_bright_red: Some(rgba(0xff5571ff).into()), + terminal_ansi_bright_green: Some(rgba(0xc3e88dff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xffcb6bff).into()), + terminal_ansi_bright_blue: Some(rgba(0x82aaffff).into()), + terminal_ansi_bright_magenta: Some(rgba(0xc792eaff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x89ddffff).into()), + terminal_ansi_bright_white: Some(rgba(0xffffffff).into()), + terminal_ansi_black: Some(rgba(0x676e95ff).into()), + terminal_ansi_red: Some(rgba(0xff5571ff).into()), + terminal_ansi_green: Some(rgba(0xa9c77dff).into()), + terminal_ansi_yellow: Some(rgba(0xffcb6bff).into()), + terminal_ansi_blue: Some(rgba(0x82aaffff).into()), + terminal_ansi_magenta: Some(rgba(0xc792eaff).into()), + terminal_ansi_cyan: Some(rgba(0x89ddffff).into()), + terminal_ansi_white: Some(rgba(0xffffffff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xef524fff).into()), + error: Some(rgba(0xef524fff).into()), + hidden: Some(rgba(0x9199c8ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("punctuation".into(), rgba(0xd3413dff).into()), + ("something".into(), rgba(0x7fcac3ff).into()), + ("comment".into(), rgba(0x687097ff).into()), + ], + }), + }, + }, + UserTheme { + name: "Palenight Operator".into(), + appearance: Appearance::Dark, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0x282b3bff).into()), + border_variant: Some(rgba(0x282b3bff).into()), + border_focused: Some(rgba(0x282b3bff).into()), + border_selected: Some(rgba(0x282b3bff).into()), + border_transparent: Some(rgba(0x282b3bff).into()), + border_disabled: Some(rgba(0x282b3bff).into()), + elevated_surface_background: Some(rgba(0x292c3eff).into()), + surface_background: Some(rgba(0x292c3eff).into()), + background: Some(rgba(0x292c3eff).into()), + element_background: Some(rgba(0x7d56c1cc).into()), + element_hover: Some(rgba(0x0000001a).into()), + element_selected: Some(rgba(0x7d56c1ff).into()), + drop_target_background: Some(rgba(0x2e3245ff).into()), + ghost_element_hover: Some(rgba(0x0000001a).into()), + text: Some(rgba(0xffffffff).into()), + tab_inactive_background: Some(rgba(0x31364aff).into()), + tab_active_background: Some(rgba(0x292c3eff).into()), + editor_background: Some(rgba(0x292c3eff).into()), + editor_gutter_background: Some(rgba(0x292c3eff).into()), + editor_line_number: Some(rgba(0x4c5374ff).into()), + editor_active_line_number: Some(rgba(0xbfc7d5ff).into()), + terminal_ansi_bright_black: Some(rgba(0x676e95ff).into()), + terminal_ansi_bright_red: Some(rgba(0xff5571ff).into()), + terminal_ansi_bright_green: Some(rgba(0xc3e88dff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xffcb6bff).into()), + terminal_ansi_bright_blue: Some(rgba(0x82aaffff).into()), + terminal_ansi_bright_magenta: Some(rgba(0xc792eaff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x89ddffff).into()), + terminal_ansi_bright_white: Some(rgba(0xffffffff).into()), + terminal_ansi_black: Some(rgba(0x676e95ff).into()), + terminal_ansi_red: Some(rgba(0xff5571ff).into()), + terminal_ansi_green: Some(rgba(0xa9c77dff).into()), + terminal_ansi_yellow: Some(rgba(0xffcb6bff).into()), + terminal_ansi_blue: Some(rgba(0x82aaffff).into()), + terminal_ansi_magenta: Some(rgba(0xc792eaff).into()), + terminal_ansi_cyan: Some(rgba(0x89ddffff).into()), + terminal_ansi_white: Some(rgba(0xffffffff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xef524fff).into()), + error: Some(rgba(0xef524fff).into()), + hidden: Some(rgba(0x9199c8ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("something".into(), rgba(0x7fcac3ff).into()), + ("comment".into(), rgba(0x687097ff).into()), + ("punctuation".into(), rgba(0xd3413dff).into()), + ], + }), + }, + }, + UserTheme { + name: "Palenight (Mild Contrast)".into(), + appearance: Appearance::Dark, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0x2c2f40ff).into()), + border_variant: Some(rgba(0x2c2f40ff).into()), + border_focused: Some(rgba(0x2c2f40ff).into()), + border_selected: Some(rgba(0x2c2f40ff).into()), + border_transparent: Some(rgba(0x2c2f40ff).into()), + border_disabled: Some(rgba(0x2c2f40ff).into()), + elevated_surface_background: Some(rgba(0x25283aff).into()), + surface_background: Some(rgba(0x25283aff).into()), + background: Some(rgba(0x292c3eff).into()), + element_background: Some(rgba(0x7d56c1cc).into()), + element_hover: Some(rgba(0x0000001a).into()), + element_selected: Some(rgba(0x7d56c1ff).into()), + drop_target_background: Some(rgba(0x2e3245ff).into()), + ghost_element_hover: Some(rgba(0x0000001a).into()), + text: Some(rgba(0xffffffff).into()), + tab_inactive_background: Some(rgba(0x31364aff).into()), + tab_active_background: Some(rgba(0x25283aff).into()), + editor_background: Some(rgba(0x292c3eff).into()), + editor_gutter_background: Some(rgba(0x292c3eff).into()), + editor_line_number: Some(rgba(0x4c5374ff).into()), + editor_active_line_number: Some(rgba(0xbfc7d5ff).into()), + terminal_ansi_bright_black: Some(rgba(0x676e95ff).into()), + terminal_ansi_bright_red: Some(rgba(0xff5571ff).into()), + terminal_ansi_bright_green: Some(rgba(0xc3e88dff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xffcb6bff).into()), + terminal_ansi_bright_blue: Some(rgba(0x82aaffff).into()), + terminal_ansi_bright_magenta: Some(rgba(0xc792eaff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x89ddffff).into()), + terminal_ansi_bright_white: Some(rgba(0xffffffff).into()), + terminal_ansi_black: Some(rgba(0x676e95ff).into()), + terminal_ansi_red: Some(rgba(0xff5571ff).into()), + terminal_ansi_green: Some(rgba(0xa9c77dff).into()), + terminal_ansi_yellow: Some(rgba(0xffcb6bff).into()), + terminal_ansi_blue: Some(rgba(0x82aaffff).into()), + terminal_ansi_magenta: Some(rgba(0xc792eaff).into()), + terminal_ansi_cyan: Some(rgba(0x89ddffff).into()), + terminal_ansi_white: Some(rgba(0xffffffff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xef524fff).into()), + error: Some(rgba(0xef524fff).into()), + hidden: Some(rgba(0x9199c8ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("something".into(), rgba(0x7fcac3ff).into()), + ("comment".into(), rgba(0x687097ff).into()), + ("punctuation".into(), rgba(0xd3413dff).into()), + ], + }), + }, + }, + ], + } } - } - \ No newline at end of file diff --git a/crates/theme2/src/themes/rose_pine.rs b/crates/theme2/src/themes/rose_pine.rs index fbc06e04ddb499c4b2838e1e65eb251dcc8a8e7a..353fcd10d368a0c4fd037255c28c51751cf80d6e 100644 --- a/crates/theme2/src/themes/rose_pine.rs +++ b/crates/theme2/src/themes/rose_pine.rs @@ -1,18 +1,198 @@ +// This file was generated by the `theme_importer`. +// Be careful when modifying it by hand. - // This file was generated by the `theme_importer`. - // Be careful when modifying it by hand. +use gpui::rgba; - use gpui::rgba; +use crate::{ + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, + UserThemeStylesRefinement, +}; - use crate::{ - Appearance, ThemeColorsRefinement, StatusColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, - }; - - pub fn rose_pine() -> UserThemeFamily { - UserThemeFamily { - name: "Rose Pine".into(), - author: "Rosé Pine".into(), - themes: vec![UserTheme { name: "Rose Pine".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x000000ff).into()),border_variant: Some(rgba(0x000000ff).into()),border_focused: Some(rgba(0x6e6a8633).into()),border_selected: Some(rgba(0x000000ff).into()),border_transparent: Some(rgba(0x000000ff).into()),border_disabled: Some(rgba(0x000000ff).into()),elevated_surface_background: Some(rgba(0x1f1d2eff).into()),surface_background: Some(rgba(0x1f1d2eff).into()),background: Some(rgba(0x191724ff).into()),element_background: Some(rgba(0xebbcbaff).into()),element_hover: Some(rgba(0x6e6a861a).into()),element_selected: Some(rgba(0x6e6a8633).into()),drop_target_background: Some(rgba(0x1f1d2eff).into()),ghost_element_hover: Some(rgba(0x6e6a861a).into()),text: Some(rgba(0xe0def4ff).into()),tab_inactive_background: Some(rgba(0x000000ff).into()),tab_active_background: Some(rgba(0x6e6a861a).into()),editor_background: Some(rgba(0x191724ff).into()),editor_gutter_background: Some(rgba(0x191724ff).into()),editor_line_number: Some(rgba(0x908caaff).into()),editor_active_line_number: Some(rgba(0xe0def4ff).into()),terminal_ansi_bright_black: Some(rgba(0x908caaff).into()),terminal_ansi_bright_red: Some(rgba(0xeb6f92ff).into()),terminal_ansi_bright_green: Some(rgba(0x30738fff).into()),terminal_ansi_bright_yellow: Some(rgba(0xf5c177ff).into()),terminal_ansi_bright_blue: Some(rgba(0x9ccfd8ff).into()),terminal_ansi_bright_magenta: Some(rgba(0xc4a7e7ff).into()),terminal_ansi_bright_cyan: Some(rgba(0xebbcbaff).into()),terminal_ansi_bright_white: Some(rgba(0xe0def4ff).into()),terminal_ansi_black: Some(rgba(0x26233aff).into()),terminal_ansi_red: Some(rgba(0xeb6f92ff).into()),terminal_ansi_green: Some(rgba(0x30738fff).into()),terminal_ansi_yellow: Some(rgba(0xf5c177ff).into()),terminal_ansi_blue: Some(rgba(0x9ccfd8ff).into()),terminal_ansi_magenta: Some(rgba(0xc4a7e7ff).into()),terminal_ansi_cyan: Some(rgba(0xebbcbaff).into()),terminal_ansi_white: Some(rgba(0xe0def4ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xeb6f92ff).into()),error: Some(rgba(0xeb6f92ff).into()),hidden: Some(rgba(0x908caaff).into()),warning: Some(rgba(0xf5c177ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x6e6a86ff).into()), ("something".into(), rgba(0x30738fff).into()), ("punctuation".into(), rgba(0x908caaff).into()), ("punctuation".into(), rgba(0x30738fff).into()), ("punctuation".into(), rgba(0x6e6a86ff).into()), ("something".into(), rgba(0xf5c177ff).into()), ("something".into(), rgba(0x9ccfd8ff).into()), ("something".into(), rgba(0xebbcbaff).into())] }) } }, UserTheme { name: "Rose Moon".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x000000ff).into()),border_variant: Some(rgba(0x000000ff).into()),border_focused: Some(rgba(0x817c9c26).into()),border_selected: Some(rgba(0x000000ff).into()),border_transparent: Some(rgba(0x000000ff).into()),border_disabled: Some(rgba(0x000000ff).into()),elevated_surface_background: Some(rgba(0x2a273eff).into()),surface_background: Some(rgba(0x2a273eff).into()),background: Some(rgba(0x232136ff).into()),element_background: Some(rgba(0xea9a97ff).into()),element_hover: Some(rgba(0x817c9c14).into()),element_selected: Some(rgba(0x817c9c26).into()),drop_target_background: Some(rgba(0x2a273eff).into()),ghost_element_hover: Some(rgba(0x817c9c14).into()),text: Some(rgba(0xe0def4ff).into()),tab_inactive_background: Some(rgba(0x000000ff).into()),tab_active_background: Some(rgba(0x817c9c14).into()),editor_background: Some(rgba(0x232136ff).into()),editor_gutter_background: Some(rgba(0x232136ff).into()),editor_line_number: Some(rgba(0x908caaff).into()),editor_active_line_number: Some(rgba(0xe0def4ff).into()),terminal_ansi_bright_black: Some(rgba(0x908caaff).into()),terminal_ansi_bright_red: Some(rgba(0xeb6f92ff).into()),terminal_ansi_bright_green: Some(rgba(0x3d8fb0ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xf5c177ff).into()),terminal_ansi_bright_blue: Some(rgba(0x9ccfd8ff).into()),terminal_ansi_bright_magenta: Some(rgba(0xc4a7e7ff).into()),terminal_ansi_bright_cyan: Some(rgba(0xea9a97ff).into()),terminal_ansi_bright_white: Some(rgba(0xe0def4ff).into()),terminal_ansi_black: Some(rgba(0x393552ff).into()),terminal_ansi_red: Some(rgba(0xeb6f92ff).into()),terminal_ansi_green: Some(rgba(0x3d8fb0ff).into()),terminal_ansi_yellow: Some(rgba(0xf5c177ff).into()),terminal_ansi_blue: Some(rgba(0x9ccfd8ff).into()),terminal_ansi_magenta: Some(rgba(0xc4a7e7ff).into()),terminal_ansi_cyan: Some(rgba(0xea9a97ff).into()),terminal_ansi_white: Some(rgba(0xe0def4ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xeb6f92ff).into()),error: Some(rgba(0xeb6f92ff).into()),hidden: Some(rgba(0x908caaff).into()),warning: Some(rgba(0xf5c177ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x6e6a86ff).into()), ("something".into(), rgba(0x3d8fb0ff).into()), ("punctuation".into(), rgba(0x908caaff).into()), ("punctuation".into(), rgba(0x3d8fb0ff).into()), ("punctuation".into(), rgba(0x6e6a86ff).into()), ("something".into(), rgba(0xf5c177ff).into()), ("something".into(), rgba(0x9ccfd8ff).into()), ("something".into(), rgba(0xea9a97ff).into())] }) } }, UserTheme { name: "Rose Pine Dawn".into(), appearance: Appearance::Light, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x000000ff).into()),border_variant: Some(rgba(0x000000ff).into()),border_focused: Some(rgba(0x6e6a8614).into()),border_selected: Some(rgba(0x000000ff).into()),border_transparent: Some(rgba(0x000000ff).into()),border_disabled: Some(rgba(0x000000ff).into()),elevated_surface_background: Some(rgba(0xfffaf3ff).into()),surface_background: Some(rgba(0xfffaf3ff).into()),background: Some(rgba(0xfaf4edff).into()),element_background: Some(rgba(0xd7827dff).into()),element_hover: Some(rgba(0x6e6a860d).into()),element_selected: Some(rgba(0x6e6a8614).into()),drop_target_background: Some(rgba(0xfffaf3ff).into()),ghost_element_hover: Some(rgba(0x6e6a860d).into()),text: Some(rgba(0x575279ff).into()),tab_inactive_background: Some(rgba(0x000000ff).into()),tab_active_background: Some(rgba(0x6e6a860d).into()),editor_background: Some(rgba(0xfaf4edff).into()),editor_gutter_background: Some(rgba(0xfaf4edff).into()),editor_line_number: Some(rgba(0x797593ff).into()),editor_active_line_number: Some(rgba(0x575279ff).into()),terminal_ansi_bright_black: Some(rgba(0x797593ff).into()),terminal_ansi_bright_red: Some(rgba(0xb3627aff).into()),terminal_ansi_bright_green: Some(rgba(0x276983ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xea9d34ff).into()),terminal_ansi_bright_blue: Some(rgba(0x55949fff).into()),terminal_ansi_bright_magenta: Some(rgba(0x9079a9ff).into()),terminal_ansi_bright_cyan: Some(rgba(0xd7827dff).into()),terminal_ansi_bright_white: Some(rgba(0x575279ff).into()),terminal_ansi_black: Some(rgba(0xf2e9e1ff).into()),terminal_ansi_red: Some(rgba(0xb3627aff).into()),terminal_ansi_green: Some(rgba(0x276983ff).into()),terminal_ansi_yellow: Some(rgba(0xea9d34ff).into()),terminal_ansi_blue: Some(rgba(0x55949fff).into()),terminal_ansi_magenta: Some(rgba(0x9079a9ff).into()),terminal_ansi_cyan: Some(rgba(0xd7827dff).into()),terminal_ansi_white: Some(rgba(0x575279ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xb3627aff).into()),error: Some(rgba(0xb3627aff).into()),hidden: Some(rgba(0x797593ff).into()),warning: Some(rgba(0xea9d34ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x9893a5ff).into()), ("something".into(), rgba(0x276983ff).into()), ("punctuation".into(), rgba(0x797593ff).into()), ("punctuation".into(), rgba(0x276983ff).into()), ("punctuation".into(), rgba(0x9893a5ff).into()), ("something".into(), rgba(0xea9d34ff).into()), ("something".into(), rgba(0x55949fff).into()), ("something".into(), rgba(0xd7827dff).into())] }) } }], +pub fn rose_pine() -> UserThemeFamily { + UserThemeFamily { + name: "Rose Pine".into(), + author: "Rosé Pine".into(), + themes: vec![ + UserTheme { + name: "Rose Pine".into(), + appearance: Appearance::Dark, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0x000000ff).into()), + border_variant: Some(rgba(0x000000ff).into()), + border_focused: Some(rgba(0x6e6a8633).into()), + border_selected: Some(rgba(0x000000ff).into()), + border_transparent: Some(rgba(0x000000ff).into()), + border_disabled: Some(rgba(0x000000ff).into()), + elevated_surface_background: Some(rgba(0x1f1d2eff).into()), + surface_background: Some(rgba(0x1f1d2eff).into()), + background: Some(rgba(0x191724ff).into()), + element_background: Some(rgba(0xebbcbaff).into()), + element_hover: Some(rgba(0x6e6a861a).into()), + element_selected: Some(rgba(0x6e6a8633).into()), + drop_target_background: Some(rgba(0x1f1d2eff).into()), + ghost_element_hover: Some(rgba(0x6e6a861a).into()), + text: Some(rgba(0xe0def4ff).into()), + tab_inactive_background: Some(rgba(0x000000ff).into()), + tab_active_background: Some(rgba(0x6e6a861a).into()), + editor_background: Some(rgba(0x191724ff).into()), + editor_gutter_background: Some(rgba(0x191724ff).into()), + editor_line_number: Some(rgba(0x908caaff).into()), + editor_active_line_number: Some(rgba(0xe0def4ff).into()), + terminal_ansi_bright_black: Some(rgba(0x908caaff).into()), + terminal_ansi_bright_red: Some(rgba(0xeb6f92ff).into()), + terminal_ansi_bright_green: Some(rgba(0x30738fff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xf5c177ff).into()), + terminal_ansi_bright_blue: Some(rgba(0x9ccfd8ff).into()), + terminal_ansi_bright_magenta: Some(rgba(0xc4a7e7ff).into()), + terminal_ansi_bright_cyan: Some(rgba(0xebbcbaff).into()), + terminal_ansi_bright_white: Some(rgba(0xe0def4ff).into()), + terminal_ansi_black: Some(rgba(0x26233aff).into()), + terminal_ansi_red: Some(rgba(0xeb6f92ff).into()), + terminal_ansi_green: Some(rgba(0x30738fff).into()), + terminal_ansi_yellow: Some(rgba(0xf5c177ff).into()), + terminal_ansi_blue: Some(rgba(0x9ccfd8ff).into()), + terminal_ansi_magenta: Some(rgba(0xc4a7e7ff).into()), + terminal_ansi_cyan: Some(rgba(0xebbcbaff).into()), + terminal_ansi_white: Some(rgba(0xe0def4ff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xeb6f92ff).into()), + error: Some(rgba(0xeb6f92ff).into()), + hidden: Some(rgba(0x908caaff).into()), + warning: Some(rgba(0xf5c177ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("punctuation".into(), rgba(0x6e6a86ff).into()), + ("comment".into(), rgba(0x6e6a86ff).into()), + ("something".into(), rgba(0xebbcbaff).into()), + ], + }), + }, + }, + UserTheme { + name: "Rose Moon".into(), + appearance: Appearance::Dark, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0x000000ff).into()), + border_variant: Some(rgba(0x000000ff).into()), + border_focused: Some(rgba(0x817c9c26).into()), + border_selected: Some(rgba(0x000000ff).into()), + border_transparent: Some(rgba(0x000000ff).into()), + border_disabled: Some(rgba(0x000000ff).into()), + elevated_surface_background: Some(rgba(0x2a273eff).into()), + surface_background: Some(rgba(0x2a273eff).into()), + background: Some(rgba(0x232136ff).into()), + element_background: Some(rgba(0xea9a97ff).into()), + element_hover: Some(rgba(0x817c9c14).into()), + element_selected: Some(rgba(0x817c9c26).into()), + drop_target_background: Some(rgba(0x2a273eff).into()), + ghost_element_hover: Some(rgba(0x817c9c14).into()), + text: Some(rgba(0xe0def4ff).into()), + tab_inactive_background: Some(rgba(0x000000ff).into()), + tab_active_background: Some(rgba(0x817c9c14).into()), + editor_background: Some(rgba(0x232136ff).into()), + editor_gutter_background: Some(rgba(0x232136ff).into()), + editor_line_number: Some(rgba(0x908caaff).into()), + editor_active_line_number: Some(rgba(0xe0def4ff).into()), + terminal_ansi_bright_black: Some(rgba(0x908caaff).into()), + terminal_ansi_bright_red: Some(rgba(0xeb6f92ff).into()), + terminal_ansi_bright_green: Some(rgba(0x3d8fb0ff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xf5c177ff).into()), + terminal_ansi_bright_blue: Some(rgba(0x9ccfd8ff).into()), + terminal_ansi_bright_magenta: Some(rgba(0xc4a7e7ff).into()), + terminal_ansi_bright_cyan: Some(rgba(0xea9a97ff).into()), + terminal_ansi_bright_white: Some(rgba(0xe0def4ff).into()), + terminal_ansi_black: Some(rgba(0x393552ff).into()), + terminal_ansi_red: Some(rgba(0xeb6f92ff).into()), + terminal_ansi_green: Some(rgba(0x3d8fb0ff).into()), + terminal_ansi_yellow: Some(rgba(0xf5c177ff).into()), + terminal_ansi_blue: Some(rgba(0x9ccfd8ff).into()), + terminal_ansi_magenta: Some(rgba(0xc4a7e7ff).into()), + terminal_ansi_cyan: Some(rgba(0xea9a97ff).into()), + terminal_ansi_white: Some(rgba(0xe0def4ff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xeb6f92ff).into()), + error: Some(rgba(0xeb6f92ff).into()), + hidden: Some(rgba(0x908caaff).into()), + warning: Some(rgba(0xf5c177ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("comment".into(), rgba(0x6e6a86ff).into()), + ("something".into(), rgba(0xea9a97ff).into()), + ("punctuation".into(), rgba(0x6e6a86ff).into()), + ], + }), + }, + }, + UserTheme { + name: "Rose Pine Dawn".into(), + appearance: Appearance::Light, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0x000000ff).into()), + border_variant: Some(rgba(0x000000ff).into()), + border_focused: Some(rgba(0x6e6a8614).into()), + border_selected: Some(rgba(0x000000ff).into()), + border_transparent: Some(rgba(0x000000ff).into()), + border_disabled: Some(rgba(0x000000ff).into()), + elevated_surface_background: Some(rgba(0xfffaf3ff).into()), + surface_background: Some(rgba(0xfffaf3ff).into()), + background: Some(rgba(0xfaf4edff).into()), + element_background: Some(rgba(0xd7827dff).into()), + element_hover: Some(rgba(0x6e6a860d).into()), + element_selected: Some(rgba(0x6e6a8614).into()), + drop_target_background: Some(rgba(0xfffaf3ff).into()), + ghost_element_hover: Some(rgba(0x6e6a860d).into()), + text: Some(rgba(0x575279ff).into()), + tab_inactive_background: Some(rgba(0x000000ff).into()), + tab_active_background: Some(rgba(0x6e6a860d).into()), + editor_background: Some(rgba(0xfaf4edff).into()), + editor_gutter_background: Some(rgba(0xfaf4edff).into()), + editor_line_number: Some(rgba(0x797593ff).into()), + editor_active_line_number: Some(rgba(0x575279ff).into()), + terminal_ansi_bright_black: Some(rgba(0x797593ff).into()), + terminal_ansi_bright_red: Some(rgba(0xb3627aff).into()), + terminal_ansi_bright_green: Some(rgba(0x276983ff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xea9d34ff).into()), + terminal_ansi_bright_blue: Some(rgba(0x55949fff).into()), + terminal_ansi_bright_magenta: Some(rgba(0x9079a9ff).into()), + terminal_ansi_bright_cyan: Some(rgba(0xd7827dff).into()), + terminal_ansi_bright_white: Some(rgba(0x575279ff).into()), + terminal_ansi_black: Some(rgba(0xf2e9e1ff).into()), + terminal_ansi_red: Some(rgba(0xb3627aff).into()), + terminal_ansi_green: Some(rgba(0x276983ff).into()), + terminal_ansi_yellow: Some(rgba(0xea9d34ff).into()), + terminal_ansi_blue: Some(rgba(0x55949fff).into()), + terminal_ansi_magenta: Some(rgba(0x9079a9ff).into()), + terminal_ansi_cyan: Some(rgba(0xd7827dff).into()), + terminal_ansi_white: Some(rgba(0x575279ff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xb3627aff).into()), + error: Some(rgba(0xb3627aff).into()), + hidden: Some(rgba(0x797593ff).into()), + warning: Some(rgba(0xea9d34ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("comment".into(), rgba(0x9893a5ff).into()), + ("punctuation".into(), rgba(0x9893a5ff).into()), + ("something".into(), rgba(0xd7827dff).into()), + ], + }), + }, + }, + ], + } } - } - \ No newline at end of file diff --git a/crates/theme2/src/themes/solarized.rs b/crates/theme2/src/themes/solarized.rs index e3a15deb4861a0b6cd49eed4725b77990a8582a8..e970dd7b0c2c6dde32a89528f7234001080c0807 100644 --- a/crates/theme2/src/themes/solarized.rs +++ b/crates/theme2/src/themes/solarized.rs @@ -1,18 +1,125 @@ +// This file was generated by the `theme_importer`. +// Be careful when modifying it by hand. - // This file was generated by the `theme_importer`. - // Be careful when modifying it by hand. +use gpui::rgba; - use gpui::rgba; +use crate::{ + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, + UserThemeStylesRefinement, +}; - use crate::{ - Appearance, ThemeColorsRefinement, StatusColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, - }; - - pub fn solarized() -> UserThemeFamily { - UserThemeFamily { - name: "Solarized".into(), - author: "Ethan Schoonover (altercation)".into(), - themes: vec![UserTheme { name: "Solarized Dark".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0x003847ff).into()),border_variant: Some(rgba(0x003847ff).into()),border_focused: Some(rgba(0x29a19899).into()),border_selected: Some(rgba(0x003847ff).into()),border_transparent: Some(rgba(0x003847ff).into()),border_disabled: Some(rgba(0x003847ff).into()),background: Some(rgba(0x002a35ff).into()),element_background: Some(rgba(0x29a19899).into()),element_hover: Some(rgba(0x004353aa).into()),element_selected: Some(rgba(0x005a6fff).into()),drop_target_background: Some(rgba(0x00435388).into()),ghost_element_hover: Some(rgba(0x004353aa).into()),tab_inactive_background: Some(rgba(0x003f51ff).into()),tab_active_background: Some(rgba(0x002a36ff).into()),editor_background: Some(rgba(0x002a35ff).into()),editor_gutter_background: Some(rgba(0x002a35ff).into()),editor_line_number: Some(rgba(0x566c74ff).into()),terminal_ansi_bright_black: Some(rgba(0x586e75ff).into()),terminal_ansi_bright_red: Some(rgba(0xcb4b15ff).into()),terminal_ansi_bright_green: Some(rgba(0x859900ff).into()),terminal_ansi_bright_yellow: Some(rgba(0x657b83ff).into()),terminal_ansi_bright_blue: Some(rgba(0x839496ff).into()),terminal_ansi_bright_magenta: Some(rgba(0x6c71c4ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x93a1a1ff).into()),terminal_ansi_bright_white: Some(rgba(0x839496ff).into()),terminal_ansi_black: Some(rgba(0x063642ff).into()),terminal_ansi_red: Some(rgba(0xdc312eff).into()),terminal_ansi_green: Some(rgba(0x859900ff).into()),terminal_ansi_yellow: Some(rgba(0xb58800ff).into()),terminal_ansi_blue: Some(rgba(0x258ad2ff).into()),terminal_ansi_magenta: Some(rgba(0xd33582ff).into()),terminal_ansi_cyan: Some(rgba(0x29a198ff).into()),terminal_ansi_white: Some(rgba(0x839496ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xffeaeaff).into()),error: Some(rgba(0xffeaeaff).into()),hidden: Some(rgba(0x93a1a1ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x657b83ff).into()), ("something".into(), rgba(0x29a198ff).into()), ("something".into(), rgba(0x93a1a1ff).into()), ("punctuation".into(), rgba(0x859900ff).into()), ("punctuation".into(), rgba(0xd30001ff).into()), ("punctuation".into(), rgba(0xd30001ff).into()), ("punctuation".into(), rgba(0x657b83ff).into())] }) } }, UserTheme { name: "Solarized Light".into(), appearance: Appearance::Light, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border: Some(rgba(0xddd6c1ff).into()),border_variant: Some(rgba(0xddd6c1ff).into()),border_focused: Some(rgba(0xd3af86ff).into()),border_selected: Some(rgba(0xddd6c1ff).into()),border_transparent: Some(rgba(0xddd6c1ff).into()),border_disabled: Some(rgba(0xddd6c1ff).into()),background: Some(rgba(0xfdf6e3ff).into()),element_background: Some(rgba(0xab9d56ff).into()),element_hover: Some(rgba(0xdec98744).into()),element_selected: Some(rgba(0xdec987ff).into()),ghost_element_hover: Some(rgba(0xdec98744).into()),tab_inactive_background: Some(rgba(0xd3cbb7ff).into()),tab_active_background: Some(rgba(0xfdf6e3ff).into()),editor_background: Some(rgba(0xfdf6e3ff).into()),editor_gutter_background: Some(rgba(0xfdf6e3ff).into()),editor_line_number: Some(rgba(0x9ca8a6ff).into()),terminal_ansi_bright_black: Some(rgba(0x657b83ff).into()),terminal_ansi_bright_red: Some(rgba(0xcb4b15ff).into()),terminal_ansi_bright_green: Some(rgba(0x859900ff).into()),terminal_ansi_bright_yellow: Some(rgba(0x657b83ff).into()),terminal_ansi_bright_blue: Some(rgba(0x839496ff).into()),terminal_ansi_bright_magenta: Some(rgba(0x6c71c4ff).into()),terminal_ansi_bright_cyan: Some(rgba(0x93a1a1ff).into()),terminal_ansi_bright_white: Some(rgba(0xeee8d5ff).into()),terminal_ansi_black: Some(rgba(0x657b83ff).into()),terminal_ansi_red: Some(rgba(0xdc312eff).into()),terminal_ansi_green: Some(rgba(0x859900ff).into()),terminal_ansi_yellow: Some(rgba(0xb58800ff).into()),terminal_ansi_blue: Some(rgba(0x258ad2ff).into()),terminal_ansi_magenta: Some(rgba(0xd33582ff).into()),terminal_ansi_cyan: Some(rgba(0x29a198ff).into()),terminal_ansi_white: Some(rgba(0xeee8d5ff).into()),..Default::default()}, status: StatusColorsRefinement {hidden: Some(rgba(0x586e75ff).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x93a1a1ff).into()), ("something".into(), rgba(0x29a198ff).into()), ("something".into(), rgba(0x063642ff).into()), ("punctuation".into(), rgba(0x859900ff).into()), ("punctuation".into(), rgba(0xd30001ff).into()), ("punctuation".into(), rgba(0xd30001ff).into()), ("punctuation".into(), rgba(0x93a1a1ff).into()), ("punctuation".into(), rgba(0x93a1a1ff).into()), ("something".into(), rgba(0x657b83ff).into())] }) } }], +pub fn solarized() -> UserThemeFamily { + UserThemeFamily { + name: "Solarized".into(), + author: "Ethan Schoonover (altercation)".into(), + themes: vec![ + UserTheme { + name: "Solarized Dark".into(), + appearance: Appearance::Dark, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0x003847ff).into()), + border_variant: Some(rgba(0x003847ff).into()), + border_focused: Some(rgba(0x29a19899).into()), + border_selected: Some(rgba(0x003847ff).into()), + border_transparent: Some(rgba(0x003847ff).into()), + border_disabled: Some(rgba(0x003847ff).into()), + background: Some(rgba(0x002a35ff).into()), + element_background: Some(rgba(0x29a19899).into()), + element_hover: Some(rgba(0x004353aa).into()), + element_selected: Some(rgba(0x005a6fff).into()), + drop_target_background: Some(rgba(0x00435388).into()), + ghost_element_hover: Some(rgba(0x004353aa).into()), + tab_inactive_background: Some(rgba(0x003f51ff).into()), + tab_active_background: Some(rgba(0x002a36ff).into()), + editor_background: Some(rgba(0x002a35ff).into()), + editor_gutter_background: Some(rgba(0x002a35ff).into()), + editor_line_number: Some(rgba(0x566c74ff).into()), + terminal_ansi_bright_black: Some(rgba(0x586e75ff).into()), + terminal_ansi_bright_red: Some(rgba(0xcb4b15ff).into()), + terminal_ansi_bright_green: Some(rgba(0x859900ff).into()), + terminal_ansi_bright_yellow: Some(rgba(0x657b83ff).into()), + terminal_ansi_bright_blue: Some(rgba(0x839496ff).into()), + terminal_ansi_bright_magenta: Some(rgba(0x6c71c4ff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x93a1a1ff).into()), + terminal_ansi_bright_white: Some(rgba(0x839496ff).into()), + terminal_ansi_black: Some(rgba(0x063642ff).into()), + terminal_ansi_red: Some(rgba(0xdc312eff).into()), + terminal_ansi_green: Some(rgba(0x859900ff).into()), + terminal_ansi_yellow: Some(rgba(0xb58800ff).into()), + terminal_ansi_blue: Some(rgba(0x258ad2ff).into()), + terminal_ansi_magenta: Some(rgba(0xd33582ff).into()), + terminal_ansi_cyan: Some(rgba(0x29a198ff).into()), + terminal_ansi_white: Some(rgba(0x839496ff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xffeaeaff).into()), + error: Some(rgba(0xffeaeaff).into()), + hidden: Some(rgba(0x93a1a1ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("comment".into(), rgba(0x657b83ff).into()), + ("something".into(), rgba(0x93a1a1ff).into()), + ("punctuation".into(), rgba(0x657b83ff).into()), + ], + }), + }, + }, + UserTheme { + name: "Solarized Light".into(), + appearance: Appearance::Light, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border: Some(rgba(0xddd6c1ff).into()), + border_variant: Some(rgba(0xddd6c1ff).into()), + border_focused: Some(rgba(0xd3af86ff).into()), + border_selected: Some(rgba(0xddd6c1ff).into()), + border_transparent: Some(rgba(0xddd6c1ff).into()), + border_disabled: Some(rgba(0xddd6c1ff).into()), + background: Some(rgba(0xfdf6e3ff).into()), + element_background: Some(rgba(0xab9d56ff).into()), + element_hover: Some(rgba(0xdec98744).into()), + element_selected: Some(rgba(0xdec987ff).into()), + ghost_element_hover: Some(rgba(0xdec98744).into()), + tab_inactive_background: Some(rgba(0xd3cbb7ff).into()), + tab_active_background: Some(rgba(0xfdf6e3ff).into()), + editor_background: Some(rgba(0xfdf6e3ff).into()), + editor_gutter_background: Some(rgba(0xfdf6e3ff).into()), + editor_line_number: Some(rgba(0x9ca8a6ff).into()), + terminal_ansi_bright_black: Some(rgba(0x657b83ff).into()), + terminal_ansi_bright_red: Some(rgba(0xcb4b15ff).into()), + terminal_ansi_bright_green: Some(rgba(0x859900ff).into()), + terminal_ansi_bright_yellow: Some(rgba(0x657b83ff).into()), + terminal_ansi_bright_blue: Some(rgba(0x839496ff).into()), + terminal_ansi_bright_magenta: Some(rgba(0x6c71c4ff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x93a1a1ff).into()), + terminal_ansi_bright_white: Some(rgba(0xeee8d5ff).into()), + terminal_ansi_black: Some(rgba(0x657b83ff).into()), + terminal_ansi_red: Some(rgba(0xdc312eff).into()), + terminal_ansi_green: Some(rgba(0x859900ff).into()), + terminal_ansi_yellow: Some(rgba(0xb58800ff).into()), + terminal_ansi_blue: Some(rgba(0x258ad2ff).into()), + terminal_ansi_magenta: Some(rgba(0xd33582ff).into()), + terminal_ansi_cyan: Some(rgba(0x29a198ff).into()), + terminal_ansi_white: Some(rgba(0xeee8d5ff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + hidden: Some(rgba(0x586e75ff).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("comment".into(), rgba(0x93a1a1ff).into()), + ("punctuation".into(), rgba(0x93a1a1ff).into()), + ("something".into(), rgba(0x657b83ff).into()), + ], + }), + }, + }, + ], + } } - } - \ No newline at end of file diff --git a/crates/theme2/src/themes/synthwave_84.rs b/crates/theme2/src/themes/synthwave_84.rs index ad4677c799b3f231cf2847e52b6a15da99703527..2eef9e908fa03d9bafd555130eb623f0796bfa2a 100644 --- a/crates/theme2/src/themes/synthwave_84.rs +++ b/crates/theme2/src/themes/synthwave_84.rs @@ -1,18 +1,62 @@ +// This file was generated by the `theme_importer`. +// Be careful when modifying it by hand. - // This file was generated by the `theme_importer`. - // Be careful when modifying it by hand. +use gpui::rgba; - use gpui::rgba; +use crate::{ + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, + UserThemeStylesRefinement, +}; - use crate::{ - Appearance, ThemeColorsRefinement, StatusColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, - }; - - pub fn synthwave_84() -> UserThemeFamily { - UserThemeFamily { - name: "Synthwave 84".into(), - author: "Robb Owen (robb0wen)".into(), - themes: vec![UserTheme { name: "Synthwave 84".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement {border_focused: Some(rgba(0x1f212bff).into()),background: Some(rgba(0x252334ff).into()),element_background: Some(rgba(0x614d85ff).into()),element_hover: Some(rgba(0x37294d99).into()),element_selected: Some(rgba(0xffffff20).into()),drop_target_background: Some(rgba(0x34294f66).into()),ghost_element_hover: Some(rgba(0x37294d99).into()),text: Some(rgba(0xffffffff).into()),tab_inactive_background: Some(rgba(0x252334ff).into()),editor_background: Some(rgba(0x252334ff).into()),editor_gutter_background: Some(rgba(0x252334ff).into()),editor_line_number: Some(rgba(0xffffff73).into()),terminal_ansi_bright_red: Some(rgba(0xfe444fff).into()),terminal_ansi_bright_green: Some(rgba(0x71f1b7ff).into()),terminal_ansi_bright_yellow: Some(rgba(0xfede5cff).into()),terminal_ansi_bright_blue: Some(rgba(0x02edf9ff).into()),terminal_ansi_bright_magenta: Some(rgba(0xff7ddaff).into()),terminal_ansi_bright_cyan: Some(rgba(0x02edf9ff).into()),terminal_ansi_red: Some(rgba(0xfe444fff).into()),terminal_ansi_green: Some(rgba(0x71f1b7ff).into()),terminal_ansi_yellow: Some(rgba(0xf3e70fff).into()),terminal_ansi_blue: Some(rgba(0x02edf9ff).into()),terminal_ansi_magenta: Some(rgba(0xff7ddaff).into()),terminal_ansi_cyan: Some(rgba(0x02edf9ff).into()),..Default::default()}, status: StatusColorsRefinement {deleted: Some(rgba(0xfe444fff).into()),error: Some(rgba(0xfe444fff).into()),warning: Some(rgba(0x71f1b7bb).into()),..Default::default()}, syntax: Some(UserSyntaxTheme { highlights: vec![("comment".into(), rgba(0x848bbdff).into()), ("something".into(), rgba(0xff7ddaff).into()), ("something".into(), rgba(0xf97d71ff).into()), ("punctuation".into(), rgba(0x35f9f5ff).into()), ("something".into(), rgba(0xfe444fff).into()), ("punctuation".into(), rgba(0xfede5cff).into())] }) } }], +pub fn synthwave_84() -> UserThemeFamily { + UserThemeFamily { + name: "Synthwave 84".into(), + author: "Robb Owen (robb0wen)".into(), + themes: vec![UserTheme { + name: "Synthwave 84".into(), + appearance: Appearance::Dark, + styles: UserThemeStylesRefinement { + colors: ThemeColorsRefinement { + border_focused: Some(rgba(0x1f212bff).into()), + background: Some(rgba(0x252334ff).into()), + element_background: Some(rgba(0x614d85ff).into()), + element_hover: Some(rgba(0x37294d99).into()), + element_selected: Some(rgba(0xffffff20).into()), + drop_target_background: Some(rgba(0x34294f66).into()), + ghost_element_hover: Some(rgba(0x37294d99).into()), + text: Some(rgba(0xffffffff).into()), + tab_inactive_background: Some(rgba(0x252334ff).into()), + editor_background: Some(rgba(0x252334ff).into()), + editor_gutter_background: Some(rgba(0x252334ff).into()), + editor_line_number: Some(rgba(0xffffff73).into()), + terminal_ansi_bright_red: Some(rgba(0xfe444fff).into()), + terminal_ansi_bright_green: Some(rgba(0x71f1b7ff).into()), + terminal_ansi_bright_yellow: Some(rgba(0xfede5cff).into()), + terminal_ansi_bright_blue: Some(rgba(0x02edf9ff).into()), + terminal_ansi_bright_magenta: Some(rgba(0xff7ddaff).into()), + terminal_ansi_bright_cyan: Some(rgba(0x02edf9ff).into()), + terminal_ansi_red: Some(rgba(0xfe444fff).into()), + terminal_ansi_green: Some(rgba(0x71f1b7ff).into()), + terminal_ansi_yellow: Some(rgba(0xf3e70fff).into()), + terminal_ansi_blue: Some(rgba(0x02edf9ff).into()), + terminal_ansi_magenta: Some(rgba(0xff7ddaff).into()), + terminal_ansi_cyan: Some(rgba(0x02edf9ff).into()), + ..Default::default() + }, + status: StatusColorsRefinement { + deleted: Some(rgba(0xfe444fff).into()), + error: Some(rgba(0xfe444fff).into()), + warning: Some(rgba(0x71f1b7bb).into()), + ..Default::default() + }, + syntax: Some(UserSyntaxTheme { + highlights: vec![ + ("comment".into(), rgba(0x848bbdff).into()), + ("something".into(), rgba(0xfe444fff).into()), + ("punctuation".into(), rgba(0xfede5cff).into()), + ], + }), + }, + }], + } } - } - \ No newline at end of file diff --git a/crates/theme_importer/src/main.rs b/crates/theme_importer/src/main.rs index 531d4913faae614a4f5d0d679b5788509231c0ab..a92e753f85db5f0e396485451e22bbba5decbb5c 100644 --- a/crates/theme_importer/src/main.rs +++ b/crates/theme_importer/src/main.rs @@ -28,7 +28,7 @@ struct FamilyMetadata { pub themes: Vec, } -#[derive(Debug, Deserialize)] +#[derive(Debug, Clone, Copy, Deserialize)] #[serde(rename_all = "snake_case")] pub enum ThemeAppearanceJson { Light, diff --git a/crates/theme_importer/src/vscode.rs b/crates/theme_importer/src/vscode.rs index 9ebb0c7b528fc41c97d31c6d3c013bff1abd86a8..10d1a9c05cd6d2729e746577a4f921cbce611510 100644 --- a/crates/theme_importer/src/vscode.rs +++ b/crates/theme_importer/src/vscode.rs @@ -1,3 +1,5 @@ +use std::collections::HashMap; + use anyhow::Result; use gpui::{Hsla, Rgba}; use serde::Deserialize; @@ -439,9 +441,34 @@ impl VsCodeThemeConverter { pub fn convert(self) -> Result { let appearance = self.theme_metadata.appearance.into(); + let status_color_refinements = self.convert_status_colors()?; + let theme_colors_refinements = self.convert_theme_colors()?; + + let mut highlight_styles = HashMap::new(); + + for token_color in self.theme.token_colors { + highlight_styles.extend(token_color.highlight_styles()?); + } + + let syntax_theme = UserSyntaxTheme { + highlights: highlight_styles.into_iter().collect(), + }; + + Ok(UserTheme { + name: self.theme_metadata.name.into(), + appearance, + styles: UserThemeStylesRefinement { + colors: theme_colors_refinements, + status: status_color_refinements, + syntax: Some(syntax_theme), + }, + }) + } + + fn convert_status_colors(&self) -> Result { let vscode_colors = &self.theme.colors; - let status_color_refinements = StatusColorsRefinement { + Ok(StatusColorsRefinement { // conflict: None, // created: None, deleted: vscode_colors @@ -466,9 +493,13 @@ impl VsCodeThemeConverter { .as_ref() .traverse(|color| try_parse_color(&color))?, ..Default::default() - }; + }) + } + + fn convert_theme_colors(&self) -> Result { + let vscode_colors = &self.theme.colors; - let theme_colors_refinements = ThemeColorsRefinement { + Ok(ThemeColorsRefinement { border: vscode_colors .panel_border .as_ref() @@ -622,26 +653,6 @@ impl VsCodeThemeConverter { .as_ref() .traverse(|color| try_parse_color(&color))?, ..Default::default() - }; - - let mut highlight_styles = Vec::new(); - - for token_color in self.theme.token_colors { - highlight_styles.extend(token_color.highlight_styles()?); - } - - let syntax_theme = UserSyntaxTheme { - highlights: highlight_styles, - }; - - Ok(UserTheme { - name: self.theme_metadata.name.into(), - appearance, - styles: UserThemeStylesRefinement { - colors: theme_colors_refinements, - status: status_color_refinements, - syntax: Some(syntax_theme), - }, }) } } diff --git a/crates/theme_importer/src/vscode_syntax.rs b/crates/theme_importer/src/vscode_syntax.rs index 7891c43235695a41adbab767473a4aed59aac8c3..dc906bbc4b7edf07ce49be6a6f56eb4f77798094 100644 --- a/crates/theme_importer/src/vscode_syntax.rs +++ b/crates/theme_importer/src/vscode_syntax.rs @@ -2,11 +2,14 @@ // Map tokenColors style to HighlightStyle (fontStyle, foreground, background) // Take in the scopes from the tokenColors and try to match each to our HighlightStyles +use std::collections::HashMap; + use anyhow::Result; use serde::Deserialize; use theme::UserHighlightStyle; -use crate::{util::Traverse, vscode::try_parse_color}; +use crate::util::Traverse; +use crate::vscode::try_parse_color; #[derive(Debug, Deserialize)] #[serde(untagged)] @@ -30,13 +33,13 @@ pub struct VsCodeTokenColorSettings { } impl VsCodeTokenColor { - pub fn highlight_styles(&self) -> Result> { - let mut highlight_styles = Vec::new(); + pub fn highlight_styles(&self) -> Result> { + let mut highlight_styles = HashMap::new(); let scope = match self.scope { Some(VsCodeTokenScope::One(ref scope)) => vec![scope.clone()], Some(VsCodeTokenScope::Many(ref scopes)) => scopes.clone(), - None => return Ok(Vec::new()), + None => return Ok(HashMap::new()), }; for scope in &scope { @@ -56,7 +59,7 @@ impl VsCodeTokenColor { continue; } - highlight_styles.push((syntax_token, highlight_style)); + highlight_styles.insert(syntax_token, highlight_style); } Ok(highlight_styles) From ff19a0ca1816ae95837a7967b4494861fd2441f8 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 9 Nov 2023 12:49:16 -0500 Subject: [PATCH 19/76] Add `importing-themes` feature flag to `theme2` crate When this feature is set the `themes` module won't be compiled. This allows us to run the `theme_importer` even when the `themes` module has compile errors in it. --- crates/theme2/Cargo.toml | 1 + crates/theme2/src/registry.rs | 4 +++- crates/theme2/src/theme2.rs | 6 ++++-- crates/theme_importer/Cargo.toml | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/crates/theme2/Cargo.toml b/crates/theme2/Cargo.toml index 45ba4587bab8d5953b39469c5e2382d11b38db57..22bea20e164c6898ad1a55dca3067abacf3f4d5e 100644 --- a/crates/theme2/Cargo.toml +++ b/crates/theme2/Cargo.toml @@ -6,6 +6,7 @@ publish = false [features] default = ["stories"] +importing-themes = [] stories = ["dep:itertools"] test-support = [ "gpui/test-support", diff --git a/crates/theme2/src/registry.rs b/crates/theme2/src/registry.rs index d95283fc122da532b2139129e536fe66b3196b28..49546973c8aa5bdc9e0b5bd3eb63532636904af7 100644 --- a/crates/theme2/src/registry.rs +++ b/crates/theme2/src/registry.rs @@ -83,7 +83,9 @@ impl Default for ThemeRegistry { }; this.insert_theme_families([zed_pro_family()]); - // this.insert_user_theme_familes(crate::all_user_themes()); + + #[cfg(not(feature = "importing-themes"))] + this.insert_user_theme_familes(crate::all_user_themes()); this } diff --git a/crates/theme2/src/theme2.rs b/crates/theme2/src/theme2.rs index 16e0db09faec0281e44859a74e392e01fb8ecd24..7e2085de4e7249ccb1925f1f0c23555f81dd08fc 100644 --- a/crates/theme2/src/theme2.rs +++ b/crates/theme2/src/theme2.rs @@ -6,7 +6,8 @@ mod registry; mod scale; mod settings; mod syntax; -// mod themes; +#[cfg(not(feature = "importing-themes"))] +mod themes; mod user_theme; use std::sync::Arc; @@ -20,7 +21,8 @@ pub use registry::*; pub use scale::*; pub use settings::*; pub use syntax::*; -// pub use themes::*; +#[cfg(not(feature = "importing-themes"))] +pub use themes::*; pub use user_theme::*; use gpui::{AppContext, Hsla, SharedString}; diff --git a/crates/theme_importer/Cargo.toml b/crates/theme_importer/Cargo.toml index 1c86349e968bad43da86d286cd30cf58e3cd743b..1109a60977ace0bb5decae880d4761580411732c 100644 --- a/crates/theme_importer/Cargo.toml +++ b/crates/theme_importer/Cargo.toml @@ -14,5 +14,5 @@ log.workspace = true rust-embed.workspace = true serde.workspace = true simplelog = "0.9" -theme = { package = "theme2", path = "../theme2" } +theme = { package = "theme2", path = "../theme2", features = ["importing-themes"] } uuid.workspace = true From a1d9f351dbb33cb2a38884df8095aa3c33260226 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Thu, 9 Nov 2023 18:51:37 +0100 Subject: [PATCH 20/76] Some more woogaloo around action dispatch Co-authored-by: Conrad --- .../command_palette2/src/command_palette.rs | 3 ++ crates/gpui2/src/action.rs | 14 ++++++ crates/gpui2/src/window.rs | 47 +++++++++++++++---- 3 files changed, 54 insertions(+), 10 deletions(-) diff --git a/crates/command_palette2/src/command_palette.rs b/crates/command_palette2/src/command_palette.rs index 46b099ea3c2d5e10c2fd9e1250e6351842f9bddb..508891be9eb60b5837caf5900aa12663e128faa6 100644 --- a/crates/command_palette2/src/command_palette.rs +++ b/crates/command_palette2/src/command_palette.rs @@ -33,6 +33,9 @@ pub fn init(cx: &mut AppContext) { return None; }; + let available_actions = cx.available_actions(); + dbg!(&available_actions); + Some(cx.build_view(|cx| { let delegate = CommandPaletteDelegate::new(cx.view().downgrade(), focus_handle); diff --git a/crates/gpui2/src/action.rs b/crates/gpui2/src/action.rs index 5cd5eb4cdbc11e9a63acf65ecfc4fc3db05bd70e..3a1832e58ca181a444674087c96cd82a278847e5 100644 --- a/crates/gpui2/src/action.rs +++ b/crates/gpui2/src/action.rs @@ -114,6 +114,7 @@ lazy_static! { #[derive(Default)] struct ActionRegistry { builders_by_name: HashMap, + builders_by_type_id: HashMap, all_names: Vec, // So we can return a static slice. } @@ -122,9 +123,22 @@ pub fn register_action() { let name = A::qualified_name(); let mut lock = ACTION_REGISTRY.write(); lock.builders_by_name.insert(name.clone(), A::build); + lock.builders_by_type_id.insert(TypeId::of::(), A::build); lock.all_names.push(name); } +/// Construct an action based on its name and optional JSON parameters sourced from the keymap. +pub fn build_action_from_type(type_id: &TypeId) -> Result> { + let lock = ACTION_REGISTRY.read(); + + let build_action = lock + .builders_by_type_id + .get(type_id) + .ok_or_else(|| anyhow!("no action type registered for {:?}", type_id))?; + + (build_action)(None) +} + /// Construct an action based on its name and optional JSON parameters sourced from the keymap. pub fn build_action(name: &str, params: Option) -> Result> { let lock = ACTION_REGISTRY.read(); diff --git a/crates/gpui2/src/window.rs b/crates/gpui2/src/window.rs index ac7dcf02569e4db6c3c8f92658d95088dcdc4ba5..123a516b021dc013ec129c80b1998ffd01173cf9 100644 --- a/crates/gpui2/src/window.rs +++ b/crates/gpui2/src/window.rs @@ -1,14 +1,15 @@ use crate::{ - px, size, Action, AnyBox, AnyDrag, AnyView, AppContext, AsyncWindowContext, AvailableSpace, - Bounds, BoxShadow, Context, Corners, CursorStyle, DevicePixels, DispatchContext, DisplayId, - Edges, Effect, Entity, EntityId, EventEmitter, FileDropEvent, FocusEvent, FontId, - GlobalElementId, GlyphId, Hsla, ImageData, InputEvent, IsZero, KeyListener, KeyMatch, - KeyMatcher, Keystroke, LayoutId, Model, ModelContext, Modifiers, MonochromeSprite, MouseButton, - MouseDownEvent, MouseMoveEvent, MouseUpEvent, Path, Pixels, PlatformAtlas, PlatformDisplay, - PlatformInputHandler, PlatformWindow, Point, PolychromeSprite, PromptLevel, Quad, Render, - RenderGlyphParams, RenderImageParams, RenderSvgParams, ScaledPixels, SceneBuilder, Shadow, - SharedString, Size, Style, SubscriberSet, Subscription, TaffyLayoutEngine, Task, Underline, - UnderlineStyle, View, VisualContext, WeakView, WindowBounds, WindowOptions, SUBPIXEL_VARIANTS, + build_action_from_type, px, size, Action, AnyBox, AnyDrag, AnyView, AppContext, + AsyncWindowContext, AvailableSpace, Bounds, BoxShadow, Context, Corners, CursorStyle, + DevicePixels, DispatchContext, DisplayId, Edges, Effect, Entity, EntityId, EventEmitter, + FileDropEvent, FocusEvent, FontId, GlobalElementId, GlyphId, Hsla, ImageData, InputEvent, + IsZero, KeyListener, KeyMatch, KeyMatcher, Keystroke, LayoutId, Model, ModelContext, Modifiers, + MonochromeSprite, MouseButton, MouseDownEvent, MouseMoveEvent, MouseUpEvent, Path, Pixels, + PlatformAtlas, PlatformDisplay, PlatformInputHandler, PlatformWindow, Point, PolychromeSprite, + PromptLevel, Quad, Render, RenderGlyphParams, RenderImageParams, RenderSvgParams, ScaledPixels, + SceneBuilder, Shadow, SharedString, Size, Style, SubscriberSet, Subscription, + TaffyLayoutEngine, Task, Underline, UnderlineStyle, View, VisualContext, WeakView, + WindowBounds, WindowOptions, SUBPIXEL_VARIANTS, }; use anyhow::{anyhow, Result}; use collections::HashMap; @@ -1295,6 +1296,32 @@ impl<'a> WindowContext<'a> { self.window.platform_window.prompt(level, msg, answers) } + pub fn available_actions(&mut self) -> Vec> { + let key_dispatch_stack = &self.window.current_frame.key_dispatch_stack; + let mut actions = Vec::new(); + dbg!(key_dispatch_stack.len()); + for frame in key_dispatch_stack { + match frame { + // todo!factor out a KeyDispatchStackFrame::Action + KeyDispatchStackFrame::Listener { + event_type, + listener: _, + } => { + match build_action_from_type(event_type) { + Ok(action) => { + actions.push(action); + } + Err(err) => { + dbg!(err); + } // we'll hit his if TypeId == KeyDown + } + } + KeyDispatchStackFrame::Context(_) => {} + } + } + actions + } + fn dispatch_action( &mut self, action: Box, From 3c689ba33e58de7613e685d14248d71a6e9335aa Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Thu, 9 Nov 2023 08:25:21 -0700 Subject: [PATCH 21/76] Fix escape in GoToLine with new event emitter --- crates/go_to_line2/src/go_to_line.rs | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/crates/go_to_line2/src/go_to_line.rs b/crates/go_to_line2/src/go_to_line.rs index c65373e6acc0c1af750173caa8a648eb9881be7b..8f0d94f3e8a25b79f48d1d5a2b81cc1b34e6d39c 100644 --- a/crates/go_to_line2/src/go_to_line.rs +++ b/crates/go_to_line2/src/go_to_line.rs @@ -37,12 +37,6 @@ pub struct GoToLine { _subscriptions: Vec, } -pub enum Event { - Dismissed, -} - -impl EventEmitter for GoToLine {} - impl EventEmitter for GoToLine {} impl GoToLine { @@ -78,7 +72,6 @@ impl GoToLine { fn release(&mut self, cx: &mut WindowContext) { let scroll_position = self.prev_scroll_position.take(); self.active_editor.update(cx, |editor, cx| { - editor.focus(cx); editor.highlight_rows(None); if let Some(scroll_position) = scroll_position { editor.set_scroll_position(scroll_position, cx); @@ -95,7 +88,7 @@ impl GoToLine { ) { match event { // todo!() this isn't working... - editor::Event::Blurred => cx.emit(Event::Dismissed), + editor::Event::Blurred => cx.emit(ModalEvent::Dismissed), editor::Event::BufferEdited { .. } => self.highlight_current_line(cx), _ => {} } @@ -130,22 +123,28 @@ impl GoToLine { } fn cancel(&mut self, _: &menu::Cancel, cx: &mut ViewContext) { - cx.emit(Event::Dismissed); + self.active_editor.update(cx, |editor, cx| { + editor.focus(cx); + cx.notify(); + }); + cx.emit(ModalEvent::Dismissed); } fn confirm(&mut self, _: &menu::Confirm, cx: &mut ViewContext) { if let Some(point) = self.point_from_query(cx) { - self.active_editor.update(cx, |active_editor, cx| { - let snapshot = active_editor.snapshot(cx).display_snapshot; + self.active_editor.update(cx, |editor, cx| { + let snapshot = editor.snapshot(cx).display_snapshot; let point = snapshot.buffer_snapshot.clip_point(point, Bias::Left); - active_editor.change_selections(Some(Autoscroll::center()), cx, |s| { + editor.change_selections(Some(Autoscroll::center()), cx, |s| { s.select_ranges([point..point]) }); + editor.focus(cx); + cx.notify(); }); self.prev_scroll_position.take(); } - cx.emit(Event::Dismissed); + cx.emit(ModalEvent::Dismissed); } } From 34e31fd4895b42f0dba750562d5a2be210bd02a4 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 9 Nov 2023 12:59:20 -0500 Subject: [PATCH 22/76] Properly emit `UserHighlightStyle`s --- crates/theme2/src/themes/andromeda.rs | 52 +++- crates/theme2/src/themes/ayu.rs | 76 +++++- crates/theme2/src/themes/dracula.rs | 28 ++- crates/theme2/src/themes/gruvbox.rs | 148 ++++++++++-- crates/theme2/src/themes/night_owl.rs | 52 +++- crates/theme2/src/themes/nord.rs | 28 ++- crates/theme2/src/themes/notctis.rs | 268 ++++++++++++++++++--- crates/theme2/src/themes/palenight.rs | 76 +++++- crates/theme2/src/themes/rose_pine.rs | 76 +++++- crates/theme2/src/themes/solarized.rs | 52 +++- crates/theme2/src/themes/synthwave_84.rs | 28 ++- crates/theme_importer/src/main.rs | 3 +- crates/theme_importer/src/theme_printer.rs | 29 ++- 13 files changed, 786 insertions(+), 130 deletions(-) diff --git a/crates/theme2/src/themes/andromeda.rs b/crates/theme2/src/themes/andromeda.rs index 00973f0f51676bd13fedfb1e33b5da048517893d..e48f58a7a2b6e7f8e6aca3461e15fc73bedd6660 100644 --- a/crates/theme2/src/themes/andromeda.rs +++ b/crates/theme2/src/themes/andromeda.rs @@ -4,8 +4,8 @@ use gpui::rgba; use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, - UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, + UserTheme, UserThemeFamily, UserThemeStylesRefinement, }; pub fn andromeda() -> UserThemeFamily { @@ -61,9 +61,27 @@ pub fn andromeda() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("comment".into(), rgba(0x9fa0a6cc).into()), - ("something".into(), rgba(0x95e072ff).into()), - ("punctuation".into(), rgba(0x95e072ff).into()), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x95e072ff).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x95e072ff).into()), + ..Default::default() + }, + ), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x9fa0a6cc).into()), + ..Default::default() + }, + ), ], }), }, @@ -116,9 +134,27 @@ pub fn andromeda() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("punctuation".into(), rgba(0x95e072ff).into()), - ("comment".into(), rgba(0x9fa0a6cc).into()), - ("something".into(), rgba(0x95e072ff).into()), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x95e072ff).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x95e072ff).into()), + ..Default::default() + }, + ), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x9fa0a6cc).into()), + ..Default::default() + }, + ), ], }), }, diff --git a/crates/theme2/src/themes/ayu.rs b/crates/theme2/src/themes/ayu.rs index 47d50d96c457e5834b64eca44fc187ecd09d1f2c..0401ff46a255eed7ec1e086faa77c88a1be2cca9 100644 --- a/crates/theme2/src/themes/ayu.rs +++ b/crates/theme2/src/themes/ayu.rs @@ -4,8 +4,8 @@ use gpui::rgba; use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, - UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, + UserTheme, UserThemeFamily, UserThemeStylesRefinement, }; pub fn ayu() -> UserThemeFamily { @@ -65,9 +65,27 @@ pub fn ayu() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("something".into(), rgba(0xfa8d3eff).into()), - ("punctuation".into(), rgba(0x787b8099).into()), - ("comment".into(), rgba(0x787b8099).into()), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0xfa8d3eff).into()), + ..Default::default() + }, + ), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x787b8099).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x787b8099).into()), + ..Default::default() + }, + ), ], }), }, @@ -124,9 +142,27 @@ pub fn ayu() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("something".into(), rgba(0xffad65ff).into()), - ("comment".into(), rgba(0xb8cfe680).into()), - ("punctuation".into(), rgba(0xb8cfe680).into()), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0xb8cfe680).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0xffad65ff).into()), + ..Default::default() + }, + ), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0xb8cfe680).into()), + ..Default::default() + }, + ), ], }), }, @@ -183,9 +219,27 @@ pub fn ayu() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("comment".into(), rgba(0xabb5be8c).into()), - ("something".into(), rgba(0xff8f3fff).into()), - ("punctuation".into(), rgba(0xabb5be8c).into()), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0xabb5be8c).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0xabb5be8c).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0xff8f3fff).into()), + ..Default::default() + }, + ), ], }), }, diff --git a/crates/theme2/src/themes/dracula.rs b/crates/theme2/src/themes/dracula.rs index d8b97589ab734857ff12a8d26f96df0b5ae6bebe..716ece161e9d0ad60c6460a2f7f767b35bae15c3 100644 --- a/crates/theme2/src/themes/dracula.rs +++ b/crates/theme2/src/themes/dracula.rs @@ -4,8 +4,8 @@ use gpui::rgba; use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, - UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, + UserTheme, UserThemeFamily, UserThemeStylesRefinement, }; pub fn dracula() -> UserThemeFamily { @@ -66,9 +66,27 @@ pub fn dracula() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("comment".into(), rgba(0x6272a4ff).into()), - ("something".into(), rgba(0xf8f8f2ff).into()), - ("punctuation".into(), rgba(0xff79c6ff).into()), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x6272a4ff).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0xff79c6ff).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0xf8f8f2ff).into()), + ..Default::default() + }, + ), ], }), }, diff --git a/crates/theme2/src/themes/gruvbox.rs b/crates/theme2/src/themes/gruvbox.rs index a7a3a42f19d87a77f47d791d3e294cb1fcaf64be..1d4da9922edf0120f01a68f9170afb73852c1d97 100644 --- a/crates/theme2/src/themes/gruvbox.rs +++ b/crates/theme2/src/themes/gruvbox.rs @@ -4,8 +4,8 @@ use gpui::rgba; use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, - UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, + UserTheme, UserThemeFamily, UserThemeStylesRefinement, }; pub fn gruvbox() -> UserThemeFamily { @@ -64,9 +64,27 @@ pub fn gruvbox() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("comment".into(), rgba(0x928374ff).into()), - ("something".into(), rgba(0x83a598ff).into()), - ("punctuation".into(), rgba(0x83a598ff).into()), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x928374ff).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x83a598ff).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x83a598ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -122,9 +140,27 @@ pub fn gruvbox() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("something".into(), rgba(0x83a598ff).into()), - ("comment".into(), rgba(0x928374ff).into()), - ("punctuation".into(), rgba(0x83a598ff).into()), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x83a598ff).into()), + ..Default::default() + }, + ), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x928374ff).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x83a598ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -180,9 +216,27 @@ pub fn gruvbox() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("comment".into(), rgba(0x928374ff).into()), - ("something".into(), rgba(0x83a598ff).into()), - ("punctuation".into(), rgba(0x83a598ff).into()), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x83a598ff).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x83a598ff).into()), + ..Default::default() + }, + ), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x928374ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -238,9 +292,27 @@ pub fn gruvbox() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("comment".into(), rgba(0x928374ff).into()), - ("something".into(), rgba(0x066578ff).into()), - ("punctuation".into(), rgba(0x066578ff).into()), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x928374ff).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x066578ff).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x066578ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -296,9 +368,27 @@ pub fn gruvbox() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("something".into(), rgba(0x066578ff).into()), - ("comment".into(), rgba(0x928374ff).into()), - ("punctuation".into(), rgba(0x066578ff).into()), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x066578ff).into()), + ..Default::default() + }, + ), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x928374ff).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x066578ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -354,9 +444,27 @@ pub fn gruvbox() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("something".into(), rgba(0x066578ff).into()), - ("comment".into(), rgba(0x928374ff).into()), - ("punctuation".into(), rgba(0x066578ff).into()), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x928374ff).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x066578ff).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x066578ff).into()), + ..Default::default() + }, + ), ], }), }, diff --git a/crates/theme2/src/themes/night_owl.rs b/crates/theme2/src/themes/night_owl.rs index a0a11b9aa1f3813c6d9a130c8d94259beb9f5ebd..2d5b1bd26be88354a08a68219376d6ebe5145a73 100644 --- a/crates/theme2/src/themes/night_owl.rs +++ b/crates/theme2/src/themes/night_owl.rs @@ -4,8 +4,8 @@ use gpui::rgba; use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, - UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, + UserTheme, UserThemeFamily, UserThemeStylesRefinement, }; pub fn night_owl() -> UserThemeFamily { @@ -65,9 +65,27 @@ pub fn night_owl() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("comment".into(), rgba(0x637777ff).into()), - ("something".into(), rgba(0x7fcac3ff).into()), - ("punctuation".into(), rgba(0xd3413dff).into()), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0xd3413dff).into()), + ..Default::default() + }, + ), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x637777ff).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x7fcac3ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -125,9 +143,27 @@ pub fn night_owl() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("comment".into(), rgba(0x989fb1ff).into()), - ("something".into(), rgba(0x0b969bff).into()), - ("punctuation".into(), rgba(0xd3413dff).into()), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x0b969bff).into()), + ..Default::default() + }, + ), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x989fb1ff).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0xd3413dff).into()), + ..Default::default() + }, + ), ], }), }, diff --git a/crates/theme2/src/themes/nord.rs b/crates/theme2/src/themes/nord.rs index eb0deed4f090eecbf1f05e49519cc3e21d04eecc..1a6e942b1fc4548a599abc9c89ed03ba0f8cc37b 100644 --- a/crates/theme2/src/themes/nord.rs +++ b/crates/theme2/src/themes/nord.rs @@ -4,8 +4,8 @@ use gpui::rgba; use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, - UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, + UserTheme, UserThemeFamily, UserThemeStylesRefinement, }; pub fn nord() -> UserThemeFamily { @@ -66,9 +66,27 @@ pub fn nord() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("comment".into(), rgba(0x606e87ff).into()), - ("punctuation".into(), rgba(0x81a1c1ff).into()), - ("something".into(), rgba(0xa3be8cff).into()), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0xa3be8cff).into()), + ..Default::default() + }, + ), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x606e87ff).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x81a1c1ff).into()), + ..Default::default() + }, + ), ], }), }, diff --git a/crates/theme2/src/themes/notctis.rs b/crates/theme2/src/themes/notctis.rs index 437fa982984c0e863c299b6764e1104468a921d0..cab9f39530748793421386aa58a7d55ae805900e 100644 --- a/crates/theme2/src/themes/notctis.rs +++ b/crates/theme2/src/themes/notctis.rs @@ -4,8 +4,8 @@ use gpui::rgba; use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, - UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, + UserTheme, UserThemeFamily, UserThemeStylesRefinement, }; pub fn notctis() -> UserThemeFamily { @@ -67,9 +67,27 @@ pub fn notctis() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("comment".into(), rgba(0x5888a5ff).into()), - ("something".into(), rgba(0x49e9a6ff).into()), - ("punctuation".into(), rgba(0x49ace9ff).into()), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x49ace9ff).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x49e9a6ff).into()), + ..Default::default() + }, + ), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x5888a5ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -128,9 +146,27 @@ pub fn notctis() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("comment".into(), rgba(0x8b737bff).into()), - ("punctuation".into(), rgba(0x49ace9ff).into()), - ("something".into(), rgba(0x49e9a6ff).into()), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x8b737bff).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x49e9a6ff).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x49ace9ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -189,9 +225,27 @@ pub fn notctis() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("punctuation".into(), rgba(0x0094f0ff).into()), - ("something".into(), rgba(0x00b368ff).into()), - ("comment".into(), rgba(0x8ca6a6ff).into()), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x00b368ff).into()), + ..Default::default() + }, + ), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x8ca6a6ff).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x0094f0ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -250,9 +304,27 @@ pub fn notctis() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("comment".into(), rgba(0x9995b7ff).into()), - ("punctuation".into(), rgba(0x0094f0ff).into()), - ("something".into(), rgba(0x00b368ff).into()), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x00b368ff).into()), + ..Default::default() + }, + ), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x9995b7ff).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x0094f0ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -311,9 +383,27 @@ pub fn notctis() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("punctuation".into(), rgba(0x0094f0ff).into()), - ("comment".into(), rgba(0x8ca6a6ff).into()), - ("something".into(), rgba(0x00b368ff).into()), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x0094f0ff).into()), + ..Default::default() + }, + ), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x8ca6a6ff).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x00b368ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -372,9 +462,27 @@ pub fn notctis() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("punctuation".into(), rgba(0x5897bfff).into()), - ("comment".into(), rgba(0x5d7787ff).into()), - ("something".into(), rgba(0x72c09fff).into()), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x72c09fff).into()), + ..Default::default() + }, + ), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x5d7787ff).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x5897bfff).into()), + ..Default::default() + }, + ), ], }), }, @@ -433,9 +541,27 @@ pub fn notctis() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("comment".into(), rgba(0x5b858bff).into()), - ("punctuation".into(), rgba(0x49ace9ff).into()), - ("something".into(), rgba(0x49e9a6ff).into()), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x49e9a6ff).into()), + ..Default::default() + }, + ), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x5b858bff).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x49ace9ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -494,9 +620,27 @@ pub fn notctis() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("something".into(), rgba(0x49e9a6ff).into()), - ("comment".into(), rgba(0x5b858bff).into()), - ("punctuation".into(), rgba(0x49ace9ff).into()), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x5b858bff).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x49ace9ff).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x49e9a6ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -555,9 +699,27 @@ pub fn notctis() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("something".into(), rgba(0x49e9a6ff).into()), - ("punctuation".into(), rgba(0x49ace9ff).into()), - ("comment".into(), rgba(0x5b858bff).into()), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x5b858bff).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x49e9a6ff).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x49ace9ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -616,9 +778,27 @@ pub fn notctis() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("punctuation".into(), rgba(0x49ace9ff).into()), - ("comment".into(), rgba(0x716b93ff).into()), - ("something".into(), rgba(0x49e9a6ff).into()), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x49e9a6ff).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x49ace9ff).into()), + ..Default::default() + }, + ), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x716b93ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -677,9 +857,27 @@ pub fn notctis() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("something".into(), rgba(0x49e9a6ff).into()), - ("comment".into(), rgba(0x7e6499ff).into()), - ("punctuation".into(), rgba(0x49ace9ff).into()), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x7e6499ff).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x49e9a6ff).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x49ace9ff).into()), + ..Default::default() + }, + ), ], }), }, diff --git a/crates/theme2/src/themes/palenight.rs b/crates/theme2/src/themes/palenight.rs index 679fe1514c73bb3b4c6d9153315d4acdaec7afb9..94e002478262a59a12ab3aef46a84b58d92f9858 100644 --- a/crates/theme2/src/themes/palenight.rs +++ b/crates/theme2/src/themes/palenight.rs @@ -4,8 +4,8 @@ use gpui::rgba; use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, - UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, + UserTheme, UserThemeFamily, UserThemeStylesRefinement, }; pub fn palenight() -> UserThemeFamily { @@ -65,9 +65,27 @@ pub fn palenight() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("punctuation".into(), rgba(0xd3413dff).into()), - ("something".into(), rgba(0x7fcac3ff).into()), - ("comment".into(), rgba(0x687097ff).into()), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x687097ff).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x7fcac3ff).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0xd3413dff).into()), + ..Default::default() + }, + ), ], }), }, @@ -124,9 +142,27 @@ pub fn palenight() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("something".into(), rgba(0x7fcac3ff).into()), - ("comment".into(), rgba(0x687097ff).into()), - ("punctuation".into(), rgba(0xd3413dff).into()), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x7fcac3ff).into()), + ..Default::default() + }, + ), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x687097ff).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0xd3413dff).into()), + ..Default::default() + }, + ), ], }), }, @@ -183,9 +219,27 @@ pub fn palenight() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("something".into(), rgba(0x7fcac3ff).into()), - ("comment".into(), rgba(0x687097ff).into()), - ("punctuation".into(), rgba(0xd3413dff).into()), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x687097ff).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x7fcac3ff).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0xd3413dff).into()), + ..Default::default() + }, + ), ], }), }, diff --git a/crates/theme2/src/themes/rose_pine.rs b/crates/theme2/src/themes/rose_pine.rs index 353fcd10d368a0c4fd037255c28c51751cf80d6e..6d5f6b256ddd0e7bd871181ef5d4fd2f63ffdf75 100644 --- a/crates/theme2/src/themes/rose_pine.rs +++ b/crates/theme2/src/themes/rose_pine.rs @@ -4,8 +4,8 @@ use gpui::rgba; use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, - UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, + UserTheme, UserThemeFamily, UserThemeStylesRefinement, }; pub fn rose_pine() -> UserThemeFamily { @@ -66,9 +66,27 @@ pub fn rose_pine() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("punctuation".into(), rgba(0x6e6a86ff).into()), - ("comment".into(), rgba(0x6e6a86ff).into()), - ("something".into(), rgba(0xebbcbaff).into()), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x6e6a86ff).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0xebbcbaff).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x6e6a86ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -126,9 +144,27 @@ pub fn rose_pine() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("comment".into(), rgba(0x6e6a86ff).into()), - ("something".into(), rgba(0xea9a97ff).into()), - ("punctuation".into(), rgba(0x6e6a86ff).into()), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x6e6a86ff).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0xea9a97ff).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x6e6a86ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -186,9 +222,27 @@ pub fn rose_pine() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("comment".into(), rgba(0x9893a5ff).into()), - ("punctuation".into(), rgba(0x9893a5ff).into()), - ("something".into(), rgba(0xd7827dff).into()), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x9893a5ff).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x9893a5ff).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0xd7827dff).into()), + ..Default::default() + }, + ), ], }), }, diff --git a/crates/theme2/src/themes/solarized.rs b/crates/theme2/src/themes/solarized.rs index e970dd7b0c2c6dde32a89528f7234001080c0807..538beff8ba1c2ac4dd9db04d13dc36cd1b3d38ae 100644 --- a/crates/theme2/src/themes/solarized.rs +++ b/crates/theme2/src/themes/solarized.rs @@ -4,8 +4,8 @@ use gpui::rgba; use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, - UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, + UserTheme, UserThemeFamily, UserThemeStylesRefinement, }; pub fn solarized() -> UserThemeFamily { @@ -61,9 +61,27 @@ pub fn solarized() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("comment".into(), rgba(0x657b83ff).into()), - ("something".into(), rgba(0x93a1a1ff).into()), - ("punctuation".into(), rgba(0x657b83ff).into()), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x657b83ff).into()), + ..Default::default() + }, + ), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x657b83ff).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x93a1a1ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -113,9 +131,27 @@ pub fn solarized() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("comment".into(), rgba(0x93a1a1ff).into()), - ("punctuation".into(), rgba(0x93a1a1ff).into()), - ("something".into(), rgba(0x657b83ff).into()), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x93a1a1ff).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0x93a1a1ff).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0x657b83ff).into()), + ..Default::default() + }, + ), ], }), }, diff --git a/crates/theme2/src/themes/synthwave_84.rs b/crates/theme2/src/themes/synthwave_84.rs index 2eef9e908fa03d9bafd555130eb623f0796bfa2a..eec0fe4e143cc581f720a760b12c8c50b61e2777 100644 --- a/crates/theme2/src/themes/synthwave_84.rs +++ b/crates/theme2/src/themes/synthwave_84.rs @@ -4,8 +4,8 @@ use gpui::rgba; use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserTheme, UserThemeFamily, - UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, + UserTheme, UserThemeFamily, UserThemeStylesRefinement, }; pub fn synthwave_84() -> UserThemeFamily { @@ -51,9 +51,27 @@ pub fn synthwave_84() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ - ("comment".into(), rgba(0x848bbdff).into()), - ("something".into(), rgba(0xfe444fff).into()), - ("punctuation".into(), rgba(0xfede5cff).into()), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x848bbdff).into()), + ..Default::default() + }, + ), + ( + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0xfede5cff).into()), + ..Default::default() + }, + ), + ( + "something".into(), + UserHighlightStyle { + color: Some(rgba(0xfe444fff).into()), + ..Default::default() + }, + ), ], }), }, diff --git a/crates/theme_importer/src/main.rs b/crates/theme_importer/src/main.rs index a92e753f85db5f0e396485451e22bbba5decbb5c..052ee5cf3afecbacdd5bb0fa30c8ce2294b72d2e 100644 --- a/crates/theme_importer/src/main.rs +++ b/crates/theme_importer/src/main.rs @@ -160,7 +160,8 @@ fn main() -> Result<()> { use gpui::rgba; use crate::{{ - Appearance, ThemeColorsRefinement, StatusColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, + UserTheme, UserThemeFamily, UserThemeStylesRefinement, }}; pub fn {theme_family_slug}() -> UserThemeFamily {{ diff --git a/crates/theme_importer/src/theme_printer.rs b/crates/theme_importer/src/theme_printer.rs index e114584d836deeec05def5433f4eb20158eb66b7..f99030b4aa3a6a1de66e9a0187b6cf190a3c5783 100644 --- a/crates/theme_importer/src/theme_printer.rs +++ b/crates/theme_importer/src/theme_printer.rs @@ -3,7 +3,8 @@ use std::fmt::{self, Debug}; use gpui::{Hsla, Rgba}; use theme::{ Appearance, PlayerColor, PlayerColors, StatusColorsRefinement, SystemColors, - ThemeColorsRefinement, UserSyntaxTheme, UserTheme, UserThemeFamily, UserThemeStylesRefinement, + ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, UserTheme, UserThemeFamily, + UserThemeStylesRefinement, }; struct RawSyntaxPrinter<'a>(&'a str); @@ -350,7 +351,7 @@ impl<'a> Debug for UserSyntaxThemePrinter<'a> { .highlights .iter() .map(|(token, highlight)| { - (IntoPrinter(token), HslaPrinter(highlight.color.unwrap())) + (IntoPrinter(token), UserHighlightStylePrinter(&highlight)) }) .collect(), ), @@ -358,3 +359,27 @@ impl<'a> Debug for UserSyntaxThemePrinter<'a> { .finish() } } + +pub struct UserHighlightStylePrinter<'a>(&'a UserHighlightStyle); + +impl<'a> Debug for UserHighlightStylePrinter<'a> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let fields = vec![("color", self.0.color)]; + + f.write_str("UserHighlightStyle {")?; + + for (field_name, value) in fields { + if let Some(color) = value { + f.write_str(field_name)?; + f.write_str(": ")?; + f.write_str("Some(")?; + HslaPrinter(color).fmt(f)?; + f.write_str(")")?; + f.write_str(",")?; + } + } + + f.write_str("..Default::default()")?; + f.write_str("}") + } +} From b029083441bcb130762467e14f931d206498d489 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 9 Nov 2023 19:03:10 +0100 Subject: [PATCH 23/76] Start on rendering context menu in editor2 Co-Authored-By: Nathan Co-Authored-By: Mikayla --- crates/editor2/src/editor.rs | 59 ++++++++--------- crates/editor2/src/element.rs | 118 +++++++++++++++++----------------- crates/gpui2/src/window.rs | 22 ++++--- 3 files changed, 100 insertions(+), 99 deletions(-) diff --git a/crates/editor2/src/editor.rs b/crates/editor2/src/editor.rs index 752696bcaef3752a8acf0df0516c1ed742978a9e..11ec3e0879c0c0f2a4071e76e0949ab869bc9927 100644 --- a/crates/editor2/src/editor.rs +++ b/crates/editor2/src/editor.rs @@ -920,15 +920,14 @@ impl ContextMenu { fn render( &self, cursor_position: DisplayPoint, - style: EditorStyle, + style: &EditorStyle, workspace: Option>, cx: &mut ViewContext, ) -> (DisplayPoint, AnyElement) { - todo!() - // match self { - // ContextMenu::Completions(menu) => (cursor_position, menu.render(style, workspace, cx)), - // ContextMenu::CodeActions(menu) => menu.render(cursor_position, style, cx), - // } + match self { + ContextMenu::Completions(menu) => (cursor_position, menu.render(style, workspace, cx)), + ContextMenu::CodeActions(menu) => menu.render(cursor_position, style, cx), + } } } @@ -1253,13 +1252,13 @@ impl CompletionsMenu { fn render( &self, - style: EditorStyle, + style: &EditorStyle, workspace: Option>, cx: &mut ViewContext, - ) { + ) -> AnyElement { todo!("old implementation below") } - // ) -> AnyElement { + // enum CompletionTag {} // let settings = EditorSettings>(cx); @@ -1572,7 +1571,7 @@ impl CodeActionsMenu { fn render( &self, mut cursor_position: DisplayPoint, - style: EditorStyle, + style: &EditorStyle, cx: &mut ViewContext, ) -> (DisplayPoint, AnyElement) { todo!("old version below") @@ -4480,29 +4479,27 @@ impl Editor { // } pub fn context_menu_visible(&self) -> bool { - false - // todo!("context menu") - // self.context_menu - // .read() - // .as_ref() - // .map_or(false, |menu| menu.visible()) + self.context_menu + .read() + .as_ref() + .map_or(false, |menu| menu.visible()) } - // pub fn render_context_menu( - // &self, - // cursor_position: DisplayPoint, - // style: EditorStyle, - // cx: &mut ViewContext, - // ) -> Option<(DisplayPoint, AnyElement)> { - // self.context_menu.read().as_ref().map(|menu| { - // menu.render( - // cursor_position, - // style, - // self.workspace.as_ref().map(|(w, _)| w.clone()), - // cx, - // ) - // }) - // } + pub fn render_context_menu( + &self, + cursor_position: DisplayPoint, + style: &EditorStyle, + cx: &mut ViewContext, + ) -> Option<(DisplayPoint, AnyElement)> { + self.context_menu.read().as_ref().map(|menu| { + menu.render( + cursor_position, + style, + self.workspace.as_ref().map(|(w, _)| w.clone()), + cx, + ) + }) + } fn hide_context_menu(&mut self, cx: &mut ViewContext) -> Option { cx.notify(); diff --git a/crates/editor2/src/element.rs b/crates/editor2/src/element.rs index a447b5647c48eefd9b9c10f9e130d7d8e4d705a6..c444da718cbccb177c91b5241f53cc125c6c6430 100644 --- a/crates/editor2/src/element.rs +++ b/crates/editor2/src/element.rs @@ -603,7 +603,7 @@ impl EditorElement { fn paint_text( &mut self, bounds: Bounds, - layout: &LayoutState, + layout: &mut LayoutState, editor: &mut Editor, cx: &mut ViewContext, ) { @@ -794,48 +794,46 @@ impl EditorElement { ) } - cx.stack(0, |cx| { + cx.with_z_index(0, |cx| { for cursor in cursors { cursor.paint(content_origin, cx); } }); - // cx.scene().push_layer(Some(bounds)); - - // cx.scene().pop_layer(); - - // if let Some((position, context_menu)) = layout.context_menu.as_mut() { - // cx.scene().push_stacking_context(None, None); - // let cursor_row_layout = - // &layout.position_map.line_layouts[(position.row() - start_row) as usize].line; - // let x = cursor_row_layout.x_for_index(position.column() as usize) - scroll_left; - // let y = (position.row() + 1) as f32 * layout.position_map.line_height - scroll_top; - // let mut list_origin = content_origin + point(x, y); - // let list_width = context_menu.size().x; - // let list_height = context_menu.size().y; - - // // Snap the right edge of the list to the right edge of the window if - // // its horizontal bounds overflow. - // if list_origin.x + list_width > cx.window_size().x { - // list_origin.set_x((cx.window_size().x - list_width).max(0.)); - // } - // if list_origin.y + list_height > bounds.max_y { - // list_origin - // .set_y(list_origin.y - layout.position_map.line_height - list_height); - // } + if let Some((position, context_menu)) = layout.context_menu.as_mut() { + cx.with_z_index(1, |cx| { + let line_height = self.style.text.line_height_in_pixels(cx.rem_size()); + let available_space = size( + AvailableSpace::Definite(cx.viewport_size().width * 0.7), + AvailableSpace::Definite( + (12. * line_height).min((bounds.size.height - line_height) / 2.), + ), + ); + let context_menu_size = context_menu.measure(available_space, editor, cx); + + let cursor_row_layout = &layout.position_map.line_layouts + [(position.row() - start_row) as usize] + .line; + let x = cursor_row_layout.x_for_index(position.column() as usize) - scroll_left; + let y = + (position.row() + 1) as f32 * layout.position_map.line_height - scroll_top; + let mut list_origin = content_origin + point(x, y); + let list_width = context_menu_size.width; + let list_height = context_menu_size.height; + + // Snap the right edge of the list to the right edge of the window if + // its horizontal bounds overflow. + if list_origin.x + list_width > cx.viewport_size().width { + list_origin.x = (cx.viewport_size().width - list_width).max(Pixels::ZERO); + } - // context_menu.paint( - // list_origin, - // Bounds::::from_points( - // gpui::Point::::zero(), - // point(f32::MAX, f32::MAX), - // ), // Let content bleed outside of editor - // editor, - // cx, - // ); + if list_origin.y + list_height > bounds.lower_right().y { + list_origin.y -= layout.position_map.line_height - list_height; + } - // cx.scene().pop_stacking_context(); - // } + context_menu.draw(list_origin, available_space, editor, cx); + }) + } // if let Some((position, hover_popovers)) = layout.hover_popovers.as_mut() { // cx.scene().push_stacking_context(None, None); @@ -1781,15 +1779,14 @@ impl EditorElement { snapshot = editor.snapshot(cx); } - // todo!("context menu") - // let mut context_menu = None; + let mut context_menu = None; let mut code_actions_indicator = None; if let Some(newest_selection_head) = newest_selection_head { if (start_row..end_row).contains(&newest_selection_head.row()) { - // if editor.context_menu_visible() { - // context_menu = - // editor.render_context_menu(newest_selection_head, style.clone(), cx); - // } + if editor.context_menu_visible() { + context_menu = + editor.render_context_menu(newest_selection_head, &self.style, cx); + } let active = matches!( editor.context_menu.read().as_ref(), @@ -1939,7 +1936,7 @@ impl EditorElement { display_hunks, // blocks, selections, - // context_menu, + context_menu, code_actions_indicator, // fold_indicators, tab_invisible, @@ -2501,21 +2498,24 @@ impl Element for EditorElement { size: layout.text_size, }; - cx.with_content_mask(ContentMask { bounds }, |cx| { - self.paint_mouse_listeners( - bounds, - gutter_bounds, - text_bounds, - &layout.position_map, - cx, - ); - self.paint_background(gutter_bounds, text_bounds, &layout, cx); - if layout.gutter_size.width > Pixels::ZERO { - self.paint_gutter(gutter_bounds, &mut layout, editor, cx); - } - self.paint_text(text_bounds, &layout, editor, cx); - let input_handler = ElementInputHandler::new(bounds, cx); - cx.handle_input(&editor.focus_handle, input_handler); + // We call with_z_index to establish a new stacking context. + cx.with_z_index(0, |cx| { + cx.with_content_mask(ContentMask { bounds }, |cx| { + self.paint_mouse_listeners( + bounds, + gutter_bounds, + text_bounds, + &layout.position_map, + cx, + ); + self.paint_background(gutter_bounds, text_bounds, &layout, cx); + if layout.gutter_size.width > Pixels::ZERO { + self.paint_gutter(gutter_bounds, &mut layout, editor, cx); + } + self.paint_text(text_bounds, &mut layout, editor, cx); + let input_handler = ElementInputHandler::new(bounds, cx); + cx.handle_input(&editor.focus_handle, input_handler); + }); }); } } @@ -3141,7 +3141,7 @@ pub struct LayoutState { show_scrollbars: bool, is_singleton: bool, max_row: u32, - // context_menu: Option<(DisplayPoint, AnyElement)>, + context_menu: Option<(DisplayPoint, AnyElement)>, code_actions_indicator: Option, // hover_popovers: Option<(DisplayPoint, Vec>)>, // fold_indicators: Vec>>, diff --git a/crates/gpui2/src/window.rs b/crates/gpui2/src/window.rs index 7b5ce5b7fc418d612a90f64c23ebf44ecc6a1b10..4c81bae5f329358fe6b9ae4349a636f56fc34b6c 100644 --- a/crates/gpui2/src/window.rs +++ b/crates/gpui2/src/window.rs @@ -200,7 +200,7 @@ pub struct Window { display_id: DisplayId, sprite_atlas: Arc, rem_size: Pixels, - content_size: Size, + viewport_size: Size, pub(crate) layout_engine: TaffyLayoutEngine, pub(crate) root_view: Option, pub(crate) element_id_stack: GlobalElementId, @@ -299,7 +299,7 @@ impl Window { display_id, sprite_atlas, rem_size: px(16.), - content_size, + viewport_size: content_size, layout_engine: TaffyLayoutEngine::new(), root_view: None, element_id_stack: GlobalElementId::default(), @@ -609,7 +609,7 @@ impl<'a> WindowContext<'a> { fn window_bounds_changed(&mut self) { self.window.scale_factor = self.window.platform_window.scale_factor(); - self.window.content_size = self.window.platform_window.content_size(); + self.window.viewport_size = self.window.platform_window.content_size(); self.window.bounds = self.window.platform_window.bounds(); self.window.display_id = self.window.platform_window.display().id(); self.window.dirty = true; @@ -624,6 +624,10 @@ impl<'a> WindowContext<'a> { self.window.bounds } + pub fn viewport_size(&self) -> Size { + self.window.viewport_size + } + pub fn is_window_active(&self) -> bool { self.window.active } @@ -717,7 +721,7 @@ impl<'a> WindowContext<'a> { /// Called during painting to invoke the given closure in a new stacking context. The given /// z-index is interpreted relative to the previous call to `stack`. - pub fn stack(&mut self, z_index: u32, f: impl FnOnce(&mut Self) -> R) -> R { + pub fn with_z_index(&mut self, z_index: u32, f: impl FnOnce(&mut Self) -> R) -> R { self.window.current_frame.z_index_stack.push(z_index); let result = f(self); self.window.current_frame.z_index_stack.pop(); @@ -1015,13 +1019,13 @@ impl<'a> WindowContext<'a> { self.start_frame(); - self.stack(0, |cx| { - let available_space = cx.window.content_size.map(Into::into); + self.with_z_index(0, |cx| { + let available_space = cx.window.viewport_size.map(Into::into); root_view.draw(available_space, cx); }); if let Some(active_drag) = self.app.active_drag.take() { - self.stack(1, |cx| { + self.with_z_index(1, |cx| { let offset = cx.mouse_position() - active_drag.cursor_offset; cx.with_element_offset(Some(offset), |cx| { let available_space = @@ -1031,7 +1035,7 @@ impl<'a> WindowContext<'a> { }); }); } else if let Some(active_tooltip) = self.app.active_tooltip.take() { - self.stack(1, |cx| { + self.with_z_index(1, |cx| { cx.with_element_offset(Some(active_tooltip.cursor_offset), |cx| { let available_space = size(AvailableSpace::MinContent, AvailableSpace::MinContent); @@ -1686,7 +1690,7 @@ pub trait BorrowWindow: BorrowMut + BorrowMut { .unwrap_or_else(|| ContentMask { bounds: Bounds { origin: Point::default(), - size: self.window().content_size, + size: self.window().viewport_size, }, }) } From 1f0fccc353da22c38244940f738e5ae65db89f22 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 9 Nov 2023 13:07:32 -0500 Subject: [PATCH 24/76] Reorganize `theme_importer` --- crates/theme_importer/src/main.rs | 3 +- crates/theme_importer/src/vscode.rs | 663 +----------------- crates/theme_importer/src/vscode/converter.rs | 248 +++++++ .../{vscode_syntax.rs => vscode/syntax.rs} | 0 crates/theme_importer/src/vscode/theme.rs | 412 +++++++++++ 5 files changed, 667 insertions(+), 659 deletions(-) create mode 100644 crates/theme_importer/src/vscode/converter.rs rename crates/theme_importer/src/{vscode_syntax.rs => vscode/syntax.rs} (100%) create mode 100644 crates/theme_importer/src/vscode/theme.rs diff --git a/crates/theme_importer/src/main.rs b/crates/theme_importer/src/main.rs index 052ee5cf3afecbacdd5bb0fa30c8ce2294b72d2e..02ff4d834ea8a3e294c93b2e2b2fc6c9ac13940c 100644 --- a/crates/theme_importer/src/main.rs +++ b/crates/theme_importer/src/main.rs @@ -1,7 +1,6 @@ mod theme_printer; mod util; mod vscode; -mod vscode_syntax; use std::fs::{self, File}; use std::io::Write; @@ -16,10 +15,10 @@ use log::LevelFilter; use serde::Deserialize; use simplelog::SimpleLogger; use theme::{Appearance, UserThemeFamily}; -use vscode::VsCodeThemeConverter; use crate::theme_printer::UserThemeFamilyPrinter; use crate::vscode::VsCodeTheme; +use crate::vscode::VsCodeThemeConverter; #[derive(Debug, Deserialize)] struct FamilyMetadata { diff --git a/crates/theme_importer/src/vscode.rs b/crates/theme_importer/src/vscode.rs index 10d1a9c05cd6d2729e746577a4f921cbce611510..6933bbaa8f10a232c084e3b1806c0e57f53b7348 100644 --- a/crates/theme_importer/src/vscode.rs +++ b/crates/theme_importer/src/vscode.rs @@ -1,658 +1,7 @@ -use std::collections::HashMap; +mod converter; +mod syntax; +mod theme; -use anyhow::Result; -use gpui::{Hsla, Rgba}; -use serde::Deserialize; -use theme::{ - StatusColorsRefinement, ThemeColorsRefinement, UserSyntaxTheme, UserTheme, - UserThemeStylesRefinement, -}; - -use crate::util::Traverse; -use crate::vscode_syntax::VsCodeTokenColor; -use crate::ThemeMetadata; - -#[derive(Deserialize, Debug)] -pub struct VsCodeTheme { - #[serde(rename = "$schema")] - pub schema: Option, - pub name: Option, - pub author: Option, - pub maintainers: Option>, - #[serde(rename = "semanticClass")] - pub semantic_class: Option, - #[serde(rename = "semanticHighlighting")] - pub semantic_highlighting: Option, - pub colors: VsCodeColors, - #[serde(rename = "tokenColors")] - pub token_colors: Vec, -} - -#[derive(Debug, Deserialize)] -pub struct VsCodeColors { - #[serde(rename = "terminal.background")] - pub terminal_background: Option, - #[serde(rename = "terminal.foreground")] - pub terminal_foreground: Option, - #[serde(rename = "terminal.ansiBrightBlack")] - pub terminal_ansi_bright_black: Option, - #[serde(rename = "terminal.ansiBrightRed")] - pub terminal_ansi_bright_red: Option, - #[serde(rename = "terminal.ansiBrightGreen")] - pub terminal_ansi_bright_green: Option, - #[serde(rename = "terminal.ansiBrightYellow")] - pub terminal_ansi_bright_yellow: Option, - #[serde(rename = "terminal.ansiBrightBlue")] - pub terminal_ansi_bright_blue: Option, - #[serde(rename = "terminal.ansiBrightMagenta")] - pub terminal_ansi_bright_magenta: Option, - #[serde(rename = "terminal.ansiBrightCyan")] - pub terminal_ansi_bright_cyan: Option, - #[serde(rename = "terminal.ansiBrightWhite")] - pub terminal_ansi_bright_white: Option, - #[serde(rename = "terminal.ansiBlack")] - pub terminal_ansi_black: Option, - #[serde(rename = "terminal.ansiRed")] - pub terminal_ansi_red: Option, - #[serde(rename = "terminal.ansiGreen")] - pub terminal_ansi_green: Option, - #[serde(rename = "terminal.ansiYellow")] - pub terminal_ansi_yellow: Option, - #[serde(rename = "terminal.ansiBlue")] - pub terminal_ansi_blue: Option, - #[serde(rename = "terminal.ansiMagenta")] - pub terminal_ansi_magenta: Option, - #[serde(rename = "terminal.ansiCyan")] - pub terminal_ansi_cyan: Option, - #[serde(rename = "terminal.ansiWhite")] - pub terminal_ansi_white: Option, - #[serde(rename = "focusBorder")] - pub focus_border: Option, - pub foreground: Option, - #[serde(rename = "selection.background")] - pub selection_background: Option, - #[serde(rename = "errorForeground")] - pub error_foreground: Option, - #[serde(rename = "button.background")] - pub button_background: Option, - #[serde(rename = "button.foreground")] - pub button_foreground: Option, - #[serde(rename = "button.secondaryBackground")] - pub button_secondary_background: Option, - #[serde(rename = "button.secondaryForeground")] - pub button_secondary_foreground: Option, - #[serde(rename = "button.secondaryHoverBackground")] - pub button_secondary_hover_background: Option, - #[serde(rename = "dropdown.background")] - pub dropdown_background: Option, - #[serde(rename = "dropdown.border")] - pub dropdown_border: Option, - #[serde(rename = "dropdown.foreground")] - pub dropdown_foreground: Option, - #[serde(rename = "input.background")] - pub input_background: Option, - #[serde(rename = "input.foreground")] - pub input_foreground: Option, - #[serde(rename = "input.border")] - pub input_border: Option, - #[serde(rename = "input.placeholderForeground")] - pub input_placeholder_foreground: Option, - #[serde(rename = "inputOption.activeBorder")] - pub input_option_active_border: Option, - #[serde(rename = "inputValidation.infoBorder")] - pub input_validation_info_border: Option, - #[serde(rename = "inputValidation.warningBorder")] - pub input_validation_warning_border: Option, - #[serde(rename = "inputValidation.errorBorder")] - pub input_validation_error_border: Option, - #[serde(rename = "badge.foreground")] - pub badge_foreground: Option, - #[serde(rename = "badge.background")] - pub badge_background: Option, - #[serde(rename = "progressBar.background")] - pub progress_bar_background: Option, - #[serde(rename = "list.activeSelectionBackground")] - pub list_active_selection_background: Option, - #[serde(rename = "list.activeSelectionForeground")] - pub list_active_selection_foreground: Option, - #[serde(rename = "list.dropBackground")] - pub list_drop_background: Option, - #[serde(rename = "list.focusBackground")] - pub list_focus_background: Option, - #[serde(rename = "list.highlightForeground")] - pub list_highlight_foreground: Option, - #[serde(rename = "list.hoverBackground")] - pub list_hover_background: Option, - #[serde(rename = "list.inactiveSelectionBackground")] - pub list_inactive_selection_background: Option, - #[serde(rename = "list.warningForeground")] - pub list_warning_foreground: Option, - #[serde(rename = "list.errorForeground")] - pub list_error_foreground: Option, - #[serde(rename = "activityBar.background")] - pub activity_bar_background: Option, - #[serde(rename = "activityBar.inactiveForeground")] - pub activity_bar_inactive_foreground: Option, - #[serde(rename = "activityBar.foreground")] - pub activity_bar_foreground: Option, - #[serde(rename = "activityBar.activeBorder")] - pub activity_bar_active_border: Option, - #[serde(rename = "activityBar.activeBackground")] - pub activity_bar_active_background: Option, - #[serde(rename = "activityBarBadge.background")] - pub activity_bar_badge_background: Option, - #[serde(rename = "activityBarBadge.foreground")] - pub activity_bar_badge_foreground: Option, - #[serde(rename = "sideBar.background")] - pub side_bar_background: Option, - #[serde(rename = "sideBarTitle.foreground")] - pub side_bar_title_foreground: Option, - #[serde(rename = "sideBarSectionHeader.background")] - pub side_bar_section_header_background: Option, - #[serde(rename = "sideBarSectionHeader.border")] - pub side_bar_section_header_border: Option, - #[serde(rename = "editorGroup.border")] - pub editor_group_border: Option, - #[serde(rename = "editorGroup.dropBackground")] - pub editor_group_drop_background: Option, - #[serde(rename = "editorGroupHeader.tabsBackground")] - pub editor_group_header_tabs_background: Option, - #[serde(rename = "tab.activeBackground")] - pub tab_active_background: Option, - #[serde(rename = "tab.activeForeground")] - pub tab_active_foreground: Option, - #[serde(rename = "tab.border")] - pub tab_border: Option, - #[serde(rename = "tab.activeBorderTop")] - pub tab_active_border_top: Option, - #[serde(rename = "tab.inactiveBackground")] - pub tab_inactive_background: Option, - #[serde(rename = "tab.inactiveForeground")] - pub tab_inactive_foreground: Option, - #[serde(rename = "editor.foreground")] - pub editor_foreground: Option, - #[serde(rename = "editor.background")] - pub editor_background: Option, - #[serde(rename = "editorLineNumber.foreground")] - pub editor_line_number_foreground: Option, - #[serde(rename = "editor.selectionBackground")] - pub editor_selection_background: Option, - #[serde(rename = "editor.selectionHighlightBackground")] - pub editor_selection_highlight_background: Option, - #[serde(rename = "editor.foldBackground")] - pub editor_fold_background: Option, - #[serde(rename = "editor.wordHighlightBackground")] - pub editor_word_highlight_background: Option, - #[serde(rename = "editor.wordHighlightStrongBackground")] - pub editor_word_highlight_strong_background: Option, - #[serde(rename = "editor.findMatchBackground")] - pub editor_find_match_background: Option, - #[serde(rename = "editor.findMatchHighlightBackground")] - pub editor_find_match_highlight_background: Option, - #[serde(rename = "editor.findRangeHighlightBackground")] - pub editor_find_range_highlight_background: Option, - #[serde(rename = "editor.hoverHighlightBackground")] - pub editor_hover_highlight_background: Option, - #[serde(rename = "editor.lineHighlightBorder")] - pub editor_line_highlight_border: Option, - #[serde(rename = "editorLink.activeForeground")] - pub editor_link_active_foreground: Option, - #[serde(rename = "editor.rangeHighlightBackground")] - pub editor_range_highlight_background: Option, - #[serde(rename = "editor.snippetTabstopHighlightBackground")] - pub editor_snippet_tabstop_highlight_background: Option, - #[serde(rename = "editor.snippetTabstopHighlightBorder")] - pub editor_snippet_tabstop_highlight_border: Option, - #[serde(rename = "editor.snippetFinalTabstopHighlightBackground")] - pub editor_snippet_final_tabstop_highlight_background: Option, - #[serde(rename = "editor.snippetFinalTabstopHighlightBorder")] - pub editor_snippet_final_tabstop_highlight_border: Option, - #[serde(rename = "editorWhitespace.foreground")] - pub editor_whitespace_foreground: Option, - #[serde(rename = "editorIndentGuide.background")] - pub editor_indent_guide_background: Option, - #[serde(rename = "editorIndentGuide.activeBackground")] - pub editor_indent_guide_active_background: Option, - #[serde(rename = "editorRuler.foreground")] - pub editor_ruler_foreground: Option, - #[serde(rename = "editorCodeLens.foreground")] - pub editor_code_lens_foreground: Option, - #[serde(rename = "editorBracketHighlight.foreground1")] - pub editor_bracket_highlight_foreground1: Option, - #[serde(rename = "editorBracketHighlight.foreground2")] - pub editor_bracket_highlight_foreground2: Option, - #[serde(rename = "editorBracketHighlight.foreground3")] - pub editor_bracket_highlight_foreground3: Option, - #[serde(rename = "editorBracketHighlight.foreground4")] - pub editor_bracket_highlight_foreground4: Option, - #[serde(rename = "editorBracketHighlight.foreground5")] - pub editor_bracket_highlight_foreground5: Option, - #[serde(rename = "editorBracketHighlight.foreground6")] - pub editor_bracket_highlight_foreground6: Option, - #[serde(rename = "editorBracketHighlight.unexpectedBracket.foreground")] - pub editor_bracket_highlight_unexpected_bracket_foreground: Option, - #[serde(rename = "editorOverviewRuler.border")] - pub editor_overview_ruler_border: Option, - #[serde(rename = "editorOverviewRuler.selectionHighlightForeground")] - pub editor_overview_ruler_selection_highlight_foreground: Option, - #[serde(rename = "editorOverviewRuler.wordHighlightForeground")] - pub editor_overview_ruler_word_highlight_foreground: Option, - #[serde(rename = "editorOverviewRuler.wordHighlightStrongForeground")] - pub editor_overview_ruler_word_highlight_strong_foreground: Option, - #[serde(rename = "editorOverviewRuler.modifiedForeground")] - pub editor_overview_ruler_modified_foreground: Option, - #[serde(rename = "editorOverviewRuler.addedForeground")] - pub editor_overview_ruler_added_foreground: Option, - #[serde(rename = "editorOverviewRuler.deletedForeground")] - pub editor_overview_ruler_deleted_foreground: Option, - #[serde(rename = "editorOverviewRuler.errorForeground")] - pub editor_overview_ruler_error_foreground: Option, - #[serde(rename = "editorOverviewRuler.warningForeground")] - pub editor_overview_ruler_warning_foreground: Option, - #[serde(rename = "editorOverviewRuler.infoForeground")] - pub editor_overview_ruler_info_foreground: Option, - #[serde(rename = "editorError.foreground")] - pub editor_error_foreground: Option, - #[serde(rename = "editorWarning.foreground")] - pub editor_warning_foreground: Option, - #[serde(rename = "editorGutter.modifiedBackground")] - pub editor_gutter_modified_background: Option, - #[serde(rename = "editorGutter.addedBackground")] - pub editor_gutter_added_background: Option, - #[serde(rename = "editorGutter.deletedBackground")] - pub editor_gutter_deleted_background: Option, - #[serde(rename = "gitDecoration.modifiedResourceForeground")] - pub git_decoration_modified_resource_foreground: Option, - #[serde(rename = "gitDecoration.deletedResourceForeground")] - pub git_decoration_deleted_resource_foreground: Option, - #[serde(rename = "gitDecoration.untrackedResourceForeground")] - pub git_decoration_untracked_resource_foreground: Option, - #[serde(rename = "gitDecoration.ignoredResourceForeground")] - pub git_decoration_ignored_resource_foreground: Option, - #[serde(rename = "gitDecoration.conflictingResourceForeground")] - pub git_decoration_conflicting_resource_foreground: Option, - #[serde(rename = "diffEditor.insertedTextBackground")] - pub diff_editor_inserted_text_background: Option, - #[serde(rename = "diffEditor.removedTextBackground")] - pub diff_editor_removed_text_background: Option, - #[serde(rename = "inlineChat.regionHighlight")] - pub inline_chat_region_highlight: Option, - #[serde(rename = "editorWidget.background")] - pub editor_widget_background: Option, - #[serde(rename = "editorSuggestWidget.background")] - pub editor_suggest_widget_background: Option, - #[serde(rename = "editorSuggestWidget.foreground")] - pub editor_suggest_widget_foreground: Option, - #[serde(rename = "editorSuggestWidget.selectedBackground")] - pub editor_suggest_widget_selected_background: Option, - #[serde(rename = "editorHoverWidget.background")] - pub editor_hover_widget_background: Option, - #[serde(rename = "editorHoverWidget.border")] - pub editor_hover_widget_border: Option, - #[serde(rename = "editorMarkerNavigation.background")] - pub editor_marker_navigation_background: Option, - #[serde(rename = "peekView.border")] - pub peek_view_border: Option, - #[serde(rename = "peekViewEditor.background")] - pub peek_view_editor_background: Option, - #[serde(rename = "peekViewEditor.matchHighlightBackground")] - pub peek_view_editor_match_highlight_background: Option, - #[serde(rename = "peekViewResult.background")] - pub peek_view_result_background: Option, - #[serde(rename = "peekViewResult.fileForeground")] - pub peek_view_result_file_foreground: Option, - #[serde(rename = "peekViewResult.lineForeground")] - pub peek_view_result_line_foreground: Option, - #[serde(rename = "peekViewResult.matchHighlightBackground")] - pub peek_view_result_match_highlight_background: Option, - #[serde(rename = "peekViewResult.selectionBackground")] - pub peek_view_result_selection_background: Option, - #[serde(rename = "peekViewResult.selectionForeground")] - pub peek_view_result_selection_foreground: Option, - #[serde(rename = "peekViewTitle.background")] - pub peek_view_title_background: Option, - #[serde(rename = "peekViewTitleDescription.foreground")] - pub peek_view_title_description_foreground: Option, - #[serde(rename = "peekViewTitleLabel.foreground")] - pub peek_view_title_label_foreground: Option, - #[serde(rename = "merge.currentHeaderBackground")] - pub merge_current_header_background: Option, - #[serde(rename = "merge.incomingHeaderBackground")] - pub merge_incoming_header_background: Option, - #[serde(rename = "editorOverviewRuler.currentContentForeground")] - pub editor_overview_ruler_current_content_foreground: Option, - #[serde(rename = "editorOverviewRuler.incomingContentForeground")] - pub editor_overview_ruler_incoming_content_foreground: Option, - #[serde(rename = "panel.background")] - pub panel_background: Option, - #[serde(rename = "panel.border")] - pub panel_border: Option, - #[serde(rename = "panelTitle.activeBorder")] - pub panel_title_active_border: Option, - #[serde(rename = "panelTitle.activeForeground")] - pub panel_title_active_foreground: Option, - #[serde(rename = "panelTitle.inactiveForeground")] - pub panel_title_inactive_foreground: Option, - #[serde(rename = "statusBar.background")] - pub status_bar_background: Option, - #[serde(rename = "statusBar.foreground")] - pub status_bar_foreground: Option, - #[serde(rename = "statusBar.debuggingBackground")] - pub status_bar_debugging_background: Option, - #[serde(rename = "statusBar.debuggingForeground")] - pub status_bar_debugging_foreground: Option, - #[serde(rename = "statusBar.noFolderBackground")] - pub status_bar_no_folder_background: Option, - #[serde(rename = "statusBar.noFolderForeground")] - pub status_bar_no_folder_foreground: Option, - #[serde(rename = "statusBarItem.prominentBackground")] - pub status_bar_item_prominent_background: Option, - #[serde(rename = "statusBarItem.prominentHoverBackground")] - pub status_bar_item_prominent_hover_background: Option, - #[serde(rename = "statusBarItem.remoteForeground")] - pub status_bar_item_remote_foreground: Option, - #[serde(rename = "statusBarItem.remoteBackground")] - pub status_bar_item_remote_background: Option, - #[serde(rename = "titleBar.activeBackground")] - pub title_bar_active_background: Option, - #[serde(rename = "titleBar.activeForeground")] - pub title_bar_active_foreground: Option, - #[serde(rename = "titleBar.inactiveBackground")] - pub title_bar_inactive_background: Option, - #[serde(rename = "titleBar.inactiveForeground")] - pub title_bar_inactive_foreground: Option, - #[serde(rename = "extensionButton.prominentForeground")] - pub extension_button_prominent_foreground: Option, - #[serde(rename = "extensionButton.prominentBackground")] - pub extension_button_prominent_background: Option, - #[serde(rename = "extensionButton.prominentHoverBackground")] - pub extension_button_prominent_hover_background: Option, - #[serde(rename = "pickerGroup.border")] - pub picker_group_border: Option, - #[serde(rename = "pickerGroup.foreground")] - pub picker_group_foreground: Option, - #[serde(rename = "debugToolBar.background")] - pub debug_tool_bar_background: Option, - #[serde(rename = "walkThrough.embeddedEditorBackground")] - pub walk_through_embedded_editor_background: Option, - #[serde(rename = "settings.headerForeground")] - pub settings_header_foreground: Option, - #[serde(rename = "settings.modifiedItemIndicator")] - pub settings_modified_item_indicator: Option, - #[serde(rename = "settings.dropdownBackground")] - pub settings_dropdown_background: Option, - #[serde(rename = "settings.dropdownForeground")] - pub settings_dropdown_foreground: Option, - #[serde(rename = "settings.dropdownBorder")] - pub settings_dropdown_border: Option, - #[serde(rename = "settings.checkboxBackground")] - pub settings_checkbox_background: Option, - #[serde(rename = "settings.checkboxForeground")] - pub settings_checkbox_foreground: Option, - #[serde(rename = "settings.checkboxBorder")] - pub settings_checkbox_border: Option, - #[serde(rename = "settings.textInputBackground")] - pub settings_text_input_background: Option, - #[serde(rename = "settings.textInputForeground")] - pub settings_text_input_foreground: Option, - #[serde(rename = "settings.textInputBorder")] - pub settings_text_input_border: Option, - #[serde(rename = "settings.numberInputBackground")] - pub settings_number_input_background: Option, - #[serde(rename = "settings.numberInputForeground")] - pub settings_number_input_foreground: Option, - #[serde(rename = "settings.numberInputBorder")] - pub settings_number_input_border: Option, - #[serde(rename = "breadcrumb.foreground")] - pub breadcrumb_foreground: Option, - #[serde(rename = "breadcrumb.background")] - pub breadcrumb_background: Option, - #[serde(rename = "breadcrumb.focusForeground")] - pub breadcrumb_focus_foreground: Option, - #[serde(rename = "breadcrumb.activeSelectionForeground")] - pub breadcrumb_active_selection_foreground: Option, - #[serde(rename = "breadcrumbPicker.background")] - pub breadcrumb_picker_background: Option, - #[serde(rename = "listFilterWidget.background")] - pub list_filter_widget_background: Option, - #[serde(rename = "listFilterWidget.outline")] - pub list_filter_widget_outline: Option, - #[serde(rename = "listFilterWidget.noMatchesOutline")] - pub list_filter_widget_no_matches_outline: Option, -} - -pub(crate) fn try_parse_color(color: &str) -> Result { - Ok(Rgba::try_from(color)?.into()) -} - -pub struct VsCodeThemeConverter { - theme: VsCodeTheme, - theme_metadata: ThemeMetadata, -} - -impl VsCodeThemeConverter { - pub fn new(theme: VsCodeTheme, theme_metadata: ThemeMetadata) -> Self { - Self { - theme, - theme_metadata, - } - } - - pub fn convert(self) -> Result { - let appearance = self.theme_metadata.appearance.into(); - - let status_color_refinements = self.convert_status_colors()?; - let theme_colors_refinements = self.convert_theme_colors()?; - - let mut highlight_styles = HashMap::new(); - - for token_color in self.theme.token_colors { - highlight_styles.extend(token_color.highlight_styles()?); - } - - let syntax_theme = UserSyntaxTheme { - highlights: highlight_styles.into_iter().collect(), - }; - - Ok(UserTheme { - name: self.theme_metadata.name.into(), - appearance, - styles: UserThemeStylesRefinement { - colors: theme_colors_refinements, - status: status_color_refinements, - syntax: Some(syntax_theme), - }, - }) - } - - fn convert_status_colors(&self) -> Result { - let vscode_colors = &self.theme.colors; - - Ok(StatusColorsRefinement { - // conflict: None, - // created: None, - deleted: vscode_colors - .error_foreground - .as_ref() - .traverse(|color| try_parse_color(&color))?, - error: vscode_colors - .error_foreground - .as_ref() - .traverse(|color| try_parse_color(&color))?, - hidden: vscode_colors - .tab_inactive_foreground - .as_ref() - .traverse(|color| try_parse_color(&color))?, - // ignored: None, - // info: None, - // modified: None, - // renamed: None, - // success: None, - warning: vscode_colors - .list_warning_foreground - .as_ref() - .traverse(|color| try_parse_color(&color))?, - ..Default::default() - }) - } - - fn convert_theme_colors(&self) -> Result { - let vscode_colors = &self.theme.colors; - - Ok(ThemeColorsRefinement { - border: vscode_colors - .panel_border - .as_ref() - .traverse(|color| try_parse_color(&color))?, - border_variant: vscode_colors - .panel_border - .as_ref() - .traverse(|color| try_parse_color(&color))?, - border_focused: vscode_colors - .focus_border - .as_ref() - .traverse(|color| try_parse_color(&color))?, - border_disabled: vscode_colors - .panel_border - .as_ref() - .traverse(|color| try_parse_color(&color))?, - border_selected: vscode_colors - .panel_border - .as_ref() - .traverse(|color| try_parse_color(&color))?, - border_transparent: vscode_colors - .panel_border - .as_ref() - .traverse(|color| try_parse_color(&color))?, - elevated_surface_background: vscode_colors - .panel_background - .as_ref() - .traverse(|color| try_parse_color(&color))?, - surface_background: vscode_colors - .panel_background - .as_ref() - .traverse(|color| try_parse_color(&color))?, - background: vscode_colors - .editor_background - .as_ref() - .traverse(|color| try_parse_color(&color))?, - element_background: vscode_colors - .button_background - .as_ref() - .traverse(|color| try_parse_color(&color))?, - element_hover: vscode_colors - .list_hover_background - .as_ref() - .traverse(|color| try_parse_color(&color))?, - element_selected: vscode_colors - .list_active_selection_background - .as_ref() - .traverse(|color| try_parse_color(&color))?, - ghost_element_hover: vscode_colors - .list_hover_background - .as_ref() - .traverse(|color| try_parse_color(&color))?, - drop_target_background: vscode_colors - .list_drop_background - .as_ref() - .traverse(|color| try_parse_color(&color))?, - text: vscode_colors - .foreground - .as_ref() - .traverse(|color| try_parse_color(&color))?, - tab_active_background: vscode_colors - .tab_active_background - .as_ref() - .traverse(|color| try_parse_color(&color))?, - tab_inactive_background: vscode_colors - .tab_inactive_background - .as_ref() - .traverse(|color| try_parse_color(&color))?, - editor_background: vscode_colors - .editor_background - .as_ref() - .traverse(|color| try_parse_color(&color))?, - editor_gutter_background: vscode_colors - .editor_background - .as_ref() - .traverse(|color| try_parse_color(&color))?, - editor_line_number: vscode_colors - .editor_line_number_foreground - .as_ref() - .traverse(|color| try_parse_color(&color))?, - editor_active_line_number: vscode_colors - .editor_foreground - .as_ref() - .traverse(|color| try_parse_color(&color))?, - terminal_background: vscode_colors - .terminal_background - .as_ref() - .traverse(|color| try_parse_color(&color))?, - terminal_ansi_bright_black: vscode_colors - .terminal_ansi_bright_black - .as_ref() - .traverse(|color| try_parse_color(&color))?, - terminal_ansi_bright_red: vscode_colors - .terminal_ansi_bright_red - .as_ref() - .traverse(|color| try_parse_color(&color))?, - terminal_ansi_bright_green: vscode_colors - .terminal_ansi_bright_green - .as_ref() - .traverse(|color| try_parse_color(&color))?, - terminal_ansi_bright_yellow: vscode_colors - .terminal_ansi_bright_yellow - .as_ref() - .traverse(|color| try_parse_color(&color))?, - terminal_ansi_bright_blue: vscode_colors - .terminal_ansi_bright_blue - .as_ref() - .traverse(|color| try_parse_color(&color))?, - terminal_ansi_bright_magenta: vscode_colors - .terminal_ansi_bright_magenta - .as_ref() - .traverse(|color| try_parse_color(&color))?, - terminal_ansi_bright_cyan: vscode_colors - .terminal_ansi_bright_cyan - .as_ref() - .traverse(|color| try_parse_color(&color))?, - terminal_ansi_bright_white: vscode_colors - .terminal_ansi_bright_white - .as_ref() - .traverse(|color| try_parse_color(&color))?, - terminal_ansi_black: vscode_colors - .terminal_ansi_black - .as_ref() - .traverse(|color| try_parse_color(&color))?, - terminal_ansi_red: vscode_colors - .terminal_ansi_red - .as_ref() - .traverse(|color| try_parse_color(&color))?, - terminal_ansi_green: vscode_colors - .terminal_ansi_green - .as_ref() - .traverse(|color| try_parse_color(&color))?, - terminal_ansi_yellow: vscode_colors - .terminal_ansi_yellow - .as_ref() - .traverse(|color| try_parse_color(&color))?, - terminal_ansi_blue: vscode_colors - .terminal_ansi_blue - .as_ref() - .traverse(|color| try_parse_color(&color))?, - terminal_ansi_magenta: vscode_colors - .terminal_ansi_magenta - .as_ref() - .traverse(|color| try_parse_color(&color))?, - terminal_ansi_cyan: vscode_colors - .terminal_ansi_cyan - .as_ref() - .traverse(|color| try_parse_color(&color))?, - terminal_ansi_white: vscode_colors - .terminal_ansi_white - .as_ref() - .traverse(|color| try_parse_color(&color))?, - ..Default::default() - }) - } -} +pub use converter::*; +pub use syntax::*; +pub use theme::*; diff --git a/crates/theme_importer/src/vscode/converter.rs b/crates/theme_importer/src/vscode/converter.rs new file mode 100644 index 0000000000000000000000000000000000000000..b203807dbcc9fc441284e257876679ae02534ab3 --- /dev/null +++ b/crates/theme_importer/src/vscode/converter.rs @@ -0,0 +1,248 @@ +use std::collections::HashMap; + +use anyhow::Result; +use gpui::{Hsla, Rgba}; +use theme::{ + StatusColorsRefinement, ThemeColorsRefinement, UserSyntaxTheme, UserTheme, + UserThemeStylesRefinement, +}; + +use crate::util::Traverse; +use crate::vscode::VsCodeTheme; +use crate::ThemeMetadata; + +pub(crate) fn try_parse_color(color: &str) -> Result { + Ok(Rgba::try_from(color)?.into()) +} + +pub struct VsCodeThemeConverter { + theme: VsCodeTheme, + theme_metadata: ThemeMetadata, +} + +impl VsCodeThemeConverter { + pub fn new(theme: VsCodeTheme, theme_metadata: ThemeMetadata) -> Self { + Self { + theme, + theme_metadata, + } + } + + pub fn convert(self) -> Result { + let appearance = self.theme_metadata.appearance.into(); + + let status_color_refinements = self.convert_status_colors()?; + let theme_colors_refinements = self.convert_theme_colors()?; + + let mut highlight_styles = HashMap::new(); + + for token_color in self.theme.token_colors { + highlight_styles.extend(token_color.highlight_styles()?); + } + + let syntax_theme = UserSyntaxTheme { + highlights: highlight_styles.into_iter().collect(), + }; + + Ok(UserTheme { + name: self.theme_metadata.name.into(), + appearance, + styles: UserThemeStylesRefinement { + colors: theme_colors_refinements, + status: status_color_refinements, + syntax: Some(syntax_theme), + }, + }) + } + + fn convert_status_colors(&self) -> Result { + let vscode_colors = &self.theme.colors; + + Ok(StatusColorsRefinement { + // conflict: None, + // created: None, + deleted: vscode_colors + .error_foreground + .as_ref() + .traverse(|color| try_parse_color(&color))?, + error: vscode_colors + .error_foreground + .as_ref() + .traverse(|color| try_parse_color(&color))?, + hidden: vscode_colors + .tab_inactive_foreground + .as_ref() + .traverse(|color| try_parse_color(&color))?, + // ignored: None, + // info: None, + // modified: None, + // renamed: None, + // success: None, + warning: vscode_colors + .list_warning_foreground + .as_ref() + .traverse(|color| try_parse_color(&color))?, + ..Default::default() + }) + } + + fn convert_theme_colors(&self) -> Result { + let vscode_colors = &self.theme.colors; + + Ok(ThemeColorsRefinement { + border: vscode_colors + .panel_border + .as_ref() + .traverse(|color| try_parse_color(&color))?, + border_variant: vscode_colors + .panel_border + .as_ref() + .traverse(|color| try_parse_color(&color))?, + border_focused: vscode_colors + .focus_border + .as_ref() + .traverse(|color| try_parse_color(&color))?, + border_disabled: vscode_colors + .panel_border + .as_ref() + .traverse(|color| try_parse_color(&color))?, + border_selected: vscode_colors + .panel_border + .as_ref() + .traverse(|color| try_parse_color(&color))?, + border_transparent: vscode_colors + .panel_border + .as_ref() + .traverse(|color| try_parse_color(&color))?, + elevated_surface_background: vscode_colors + .panel_background + .as_ref() + .traverse(|color| try_parse_color(&color))?, + surface_background: vscode_colors + .panel_background + .as_ref() + .traverse(|color| try_parse_color(&color))?, + background: vscode_colors + .editor_background + .as_ref() + .traverse(|color| try_parse_color(&color))?, + element_background: vscode_colors + .button_background + .as_ref() + .traverse(|color| try_parse_color(&color))?, + element_hover: vscode_colors + .list_hover_background + .as_ref() + .traverse(|color| try_parse_color(&color))?, + element_selected: vscode_colors + .list_active_selection_background + .as_ref() + .traverse(|color| try_parse_color(&color))?, + ghost_element_hover: vscode_colors + .list_hover_background + .as_ref() + .traverse(|color| try_parse_color(&color))?, + drop_target_background: vscode_colors + .list_drop_background + .as_ref() + .traverse(|color| try_parse_color(&color))?, + text: vscode_colors + .foreground + .as_ref() + .traverse(|color| try_parse_color(&color))?, + tab_active_background: vscode_colors + .tab_active_background + .as_ref() + .traverse(|color| try_parse_color(&color))?, + tab_inactive_background: vscode_colors + .tab_inactive_background + .as_ref() + .traverse(|color| try_parse_color(&color))?, + editor_background: vscode_colors + .editor_background + .as_ref() + .traverse(|color| try_parse_color(&color))?, + editor_gutter_background: vscode_colors + .editor_background + .as_ref() + .traverse(|color| try_parse_color(&color))?, + editor_line_number: vscode_colors + .editor_line_number_foreground + .as_ref() + .traverse(|color| try_parse_color(&color))?, + editor_active_line_number: vscode_colors + .editor_foreground + .as_ref() + .traverse(|color| try_parse_color(&color))?, + terminal_background: vscode_colors + .terminal_background + .as_ref() + .traverse(|color| try_parse_color(&color))?, + terminal_ansi_bright_black: vscode_colors + .terminal_ansi_bright_black + .as_ref() + .traverse(|color| try_parse_color(&color))?, + terminal_ansi_bright_red: vscode_colors + .terminal_ansi_bright_red + .as_ref() + .traverse(|color| try_parse_color(&color))?, + terminal_ansi_bright_green: vscode_colors + .terminal_ansi_bright_green + .as_ref() + .traverse(|color| try_parse_color(&color))?, + terminal_ansi_bright_yellow: vscode_colors + .terminal_ansi_bright_yellow + .as_ref() + .traverse(|color| try_parse_color(&color))?, + terminal_ansi_bright_blue: vscode_colors + .terminal_ansi_bright_blue + .as_ref() + .traverse(|color| try_parse_color(&color))?, + terminal_ansi_bright_magenta: vscode_colors + .terminal_ansi_bright_magenta + .as_ref() + .traverse(|color| try_parse_color(&color))?, + terminal_ansi_bright_cyan: vscode_colors + .terminal_ansi_bright_cyan + .as_ref() + .traverse(|color| try_parse_color(&color))?, + terminal_ansi_bright_white: vscode_colors + .terminal_ansi_bright_white + .as_ref() + .traverse(|color| try_parse_color(&color))?, + terminal_ansi_black: vscode_colors + .terminal_ansi_black + .as_ref() + .traverse(|color| try_parse_color(&color))?, + terminal_ansi_red: vscode_colors + .terminal_ansi_red + .as_ref() + .traverse(|color| try_parse_color(&color))?, + terminal_ansi_green: vscode_colors + .terminal_ansi_green + .as_ref() + .traverse(|color| try_parse_color(&color))?, + terminal_ansi_yellow: vscode_colors + .terminal_ansi_yellow + .as_ref() + .traverse(|color| try_parse_color(&color))?, + terminal_ansi_blue: vscode_colors + .terminal_ansi_blue + .as_ref() + .traverse(|color| try_parse_color(&color))?, + terminal_ansi_magenta: vscode_colors + .terminal_ansi_magenta + .as_ref() + .traverse(|color| try_parse_color(&color))?, + terminal_ansi_cyan: vscode_colors + .terminal_ansi_cyan + .as_ref() + .traverse(|color| try_parse_color(&color))?, + terminal_ansi_white: vscode_colors + .terminal_ansi_white + .as_ref() + .traverse(|color| try_parse_color(&color))?, + ..Default::default() + }) + } +} diff --git a/crates/theme_importer/src/vscode_syntax.rs b/crates/theme_importer/src/vscode/syntax.rs similarity index 100% rename from crates/theme_importer/src/vscode_syntax.rs rename to crates/theme_importer/src/vscode/syntax.rs diff --git a/crates/theme_importer/src/vscode/theme.rs b/crates/theme_importer/src/vscode/theme.rs new file mode 100644 index 0000000000000000000000000000000000000000..76e3c02b34aa5134d4ddd8ab861527e0690aec51 --- /dev/null +++ b/crates/theme_importer/src/vscode/theme.rs @@ -0,0 +1,412 @@ +use serde::Deserialize; + +use crate::vscode::VsCodeTokenColor; + +#[derive(Deserialize, Debug)] +pub struct VsCodeTheme { + #[serde(rename = "$schema")] + pub schema: Option, + pub name: Option, + pub author: Option, + pub maintainers: Option>, + #[serde(rename = "semanticClass")] + pub semantic_class: Option, + #[serde(rename = "semanticHighlighting")] + pub semantic_highlighting: Option, + pub colors: VsCodeColors, + #[serde(rename = "tokenColors")] + pub token_colors: Vec, +} + +#[derive(Debug, Deserialize)] +pub struct VsCodeColors { + #[serde(rename = "terminal.background")] + pub terminal_background: Option, + #[serde(rename = "terminal.foreground")] + pub terminal_foreground: Option, + #[serde(rename = "terminal.ansiBrightBlack")] + pub terminal_ansi_bright_black: Option, + #[serde(rename = "terminal.ansiBrightRed")] + pub terminal_ansi_bright_red: Option, + #[serde(rename = "terminal.ansiBrightGreen")] + pub terminal_ansi_bright_green: Option, + #[serde(rename = "terminal.ansiBrightYellow")] + pub terminal_ansi_bright_yellow: Option, + #[serde(rename = "terminal.ansiBrightBlue")] + pub terminal_ansi_bright_blue: Option, + #[serde(rename = "terminal.ansiBrightMagenta")] + pub terminal_ansi_bright_magenta: Option, + #[serde(rename = "terminal.ansiBrightCyan")] + pub terminal_ansi_bright_cyan: Option, + #[serde(rename = "terminal.ansiBrightWhite")] + pub terminal_ansi_bright_white: Option, + #[serde(rename = "terminal.ansiBlack")] + pub terminal_ansi_black: Option, + #[serde(rename = "terminal.ansiRed")] + pub terminal_ansi_red: Option, + #[serde(rename = "terminal.ansiGreen")] + pub terminal_ansi_green: Option, + #[serde(rename = "terminal.ansiYellow")] + pub terminal_ansi_yellow: Option, + #[serde(rename = "terminal.ansiBlue")] + pub terminal_ansi_blue: Option, + #[serde(rename = "terminal.ansiMagenta")] + pub terminal_ansi_magenta: Option, + #[serde(rename = "terminal.ansiCyan")] + pub terminal_ansi_cyan: Option, + #[serde(rename = "terminal.ansiWhite")] + pub terminal_ansi_white: Option, + #[serde(rename = "focusBorder")] + pub focus_border: Option, + pub foreground: Option, + #[serde(rename = "selection.background")] + pub selection_background: Option, + #[serde(rename = "errorForeground")] + pub error_foreground: Option, + #[serde(rename = "button.background")] + pub button_background: Option, + #[serde(rename = "button.foreground")] + pub button_foreground: Option, + #[serde(rename = "button.secondaryBackground")] + pub button_secondary_background: Option, + #[serde(rename = "button.secondaryForeground")] + pub button_secondary_foreground: Option, + #[serde(rename = "button.secondaryHoverBackground")] + pub button_secondary_hover_background: Option, + #[serde(rename = "dropdown.background")] + pub dropdown_background: Option, + #[serde(rename = "dropdown.border")] + pub dropdown_border: Option, + #[serde(rename = "dropdown.foreground")] + pub dropdown_foreground: Option, + #[serde(rename = "input.background")] + pub input_background: Option, + #[serde(rename = "input.foreground")] + pub input_foreground: Option, + #[serde(rename = "input.border")] + pub input_border: Option, + #[serde(rename = "input.placeholderForeground")] + pub input_placeholder_foreground: Option, + #[serde(rename = "inputOption.activeBorder")] + pub input_option_active_border: Option, + #[serde(rename = "inputValidation.infoBorder")] + pub input_validation_info_border: Option, + #[serde(rename = "inputValidation.warningBorder")] + pub input_validation_warning_border: Option, + #[serde(rename = "inputValidation.errorBorder")] + pub input_validation_error_border: Option, + #[serde(rename = "badge.foreground")] + pub badge_foreground: Option, + #[serde(rename = "badge.background")] + pub badge_background: Option, + #[serde(rename = "progressBar.background")] + pub progress_bar_background: Option, + #[serde(rename = "list.activeSelectionBackground")] + pub list_active_selection_background: Option, + #[serde(rename = "list.activeSelectionForeground")] + pub list_active_selection_foreground: Option, + #[serde(rename = "list.dropBackground")] + pub list_drop_background: Option, + #[serde(rename = "list.focusBackground")] + pub list_focus_background: Option, + #[serde(rename = "list.highlightForeground")] + pub list_highlight_foreground: Option, + #[serde(rename = "list.hoverBackground")] + pub list_hover_background: Option, + #[serde(rename = "list.inactiveSelectionBackground")] + pub list_inactive_selection_background: Option, + #[serde(rename = "list.warningForeground")] + pub list_warning_foreground: Option, + #[serde(rename = "list.errorForeground")] + pub list_error_foreground: Option, + #[serde(rename = "activityBar.background")] + pub activity_bar_background: Option, + #[serde(rename = "activityBar.inactiveForeground")] + pub activity_bar_inactive_foreground: Option, + #[serde(rename = "activityBar.foreground")] + pub activity_bar_foreground: Option, + #[serde(rename = "activityBar.activeBorder")] + pub activity_bar_active_border: Option, + #[serde(rename = "activityBar.activeBackground")] + pub activity_bar_active_background: Option, + #[serde(rename = "activityBarBadge.background")] + pub activity_bar_badge_background: Option, + #[serde(rename = "activityBarBadge.foreground")] + pub activity_bar_badge_foreground: Option, + #[serde(rename = "sideBar.background")] + pub side_bar_background: Option, + #[serde(rename = "sideBarTitle.foreground")] + pub side_bar_title_foreground: Option, + #[serde(rename = "sideBarSectionHeader.background")] + pub side_bar_section_header_background: Option, + #[serde(rename = "sideBarSectionHeader.border")] + pub side_bar_section_header_border: Option, + #[serde(rename = "editorGroup.border")] + pub editor_group_border: Option, + #[serde(rename = "editorGroup.dropBackground")] + pub editor_group_drop_background: Option, + #[serde(rename = "editorGroupHeader.tabsBackground")] + pub editor_group_header_tabs_background: Option, + #[serde(rename = "tab.activeBackground")] + pub tab_active_background: Option, + #[serde(rename = "tab.activeForeground")] + pub tab_active_foreground: Option, + #[serde(rename = "tab.border")] + pub tab_border: Option, + #[serde(rename = "tab.activeBorderTop")] + pub tab_active_border_top: Option, + #[serde(rename = "tab.inactiveBackground")] + pub tab_inactive_background: Option, + #[serde(rename = "tab.inactiveForeground")] + pub tab_inactive_foreground: Option, + #[serde(rename = "editor.foreground")] + pub editor_foreground: Option, + #[serde(rename = "editor.background")] + pub editor_background: Option, + #[serde(rename = "editorLineNumber.foreground")] + pub editor_line_number_foreground: Option, + #[serde(rename = "editor.selectionBackground")] + pub editor_selection_background: Option, + #[serde(rename = "editor.selectionHighlightBackground")] + pub editor_selection_highlight_background: Option, + #[serde(rename = "editor.foldBackground")] + pub editor_fold_background: Option, + #[serde(rename = "editor.wordHighlightBackground")] + pub editor_word_highlight_background: Option, + #[serde(rename = "editor.wordHighlightStrongBackground")] + pub editor_word_highlight_strong_background: Option, + #[serde(rename = "editor.findMatchBackground")] + pub editor_find_match_background: Option, + #[serde(rename = "editor.findMatchHighlightBackground")] + pub editor_find_match_highlight_background: Option, + #[serde(rename = "editor.findRangeHighlightBackground")] + pub editor_find_range_highlight_background: Option, + #[serde(rename = "editor.hoverHighlightBackground")] + pub editor_hover_highlight_background: Option, + #[serde(rename = "editor.lineHighlightBorder")] + pub editor_line_highlight_border: Option, + #[serde(rename = "editorLink.activeForeground")] + pub editor_link_active_foreground: Option, + #[serde(rename = "editor.rangeHighlightBackground")] + pub editor_range_highlight_background: Option, + #[serde(rename = "editor.snippetTabstopHighlightBackground")] + pub editor_snippet_tabstop_highlight_background: Option, + #[serde(rename = "editor.snippetTabstopHighlightBorder")] + pub editor_snippet_tabstop_highlight_border: Option, + #[serde(rename = "editor.snippetFinalTabstopHighlightBackground")] + pub editor_snippet_final_tabstop_highlight_background: Option, + #[serde(rename = "editor.snippetFinalTabstopHighlightBorder")] + pub editor_snippet_final_tabstop_highlight_border: Option, + #[serde(rename = "editorWhitespace.foreground")] + pub editor_whitespace_foreground: Option, + #[serde(rename = "editorIndentGuide.background")] + pub editor_indent_guide_background: Option, + #[serde(rename = "editorIndentGuide.activeBackground")] + pub editor_indent_guide_active_background: Option, + #[serde(rename = "editorRuler.foreground")] + pub editor_ruler_foreground: Option, + #[serde(rename = "editorCodeLens.foreground")] + pub editor_code_lens_foreground: Option, + #[serde(rename = "editorBracketHighlight.foreground1")] + pub editor_bracket_highlight_foreground1: Option, + #[serde(rename = "editorBracketHighlight.foreground2")] + pub editor_bracket_highlight_foreground2: Option, + #[serde(rename = "editorBracketHighlight.foreground3")] + pub editor_bracket_highlight_foreground3: Option, + #[serde(rename = "editorBracketHighlight.foreground4")] + pub editor_bracket_highlight_foreground4: Option, + #[serde(rename = "editorBracketHighlight.foreground5")] + pub editor_bracket_highlight_foreground5: Option, + #[serde(rename = "editorBracketHighlight.foreground6")] + pub editor_bracket_highlight_foreground6: Option, + #[serde(rename = "editorBracketHighlight.unexpectedBracket.foreground")] + pub editor_bracket_highlight_unexpected_bracket_foreground: Option, + #[serde(rename = "editorOverviewRuler.border")] + pub editor_overview_ruler_border: Option, + #[serde(rename = "editorOverviewRuler.selectionHighlightForeground")] + pub editor_overview_ruler_selection_highlight_foreground: Option, + #[serde(rename = "editorOverviewRuler.wordHighlightForeground")] + pub editor_overview_ruler_word_highlight_foreground: Option, + #[serde(rename = "editorOverviewRuler.wordHighlightStrongForeground")] + pub editor_overview_ruler_word_highlight_strong_foreground: Option, + #[serde(rename = "editorOverviewRuler.modifiedForeground")] + pub editor_overview_ruler_modified_foreground: Option, + #[serde(rename = "editorOverviewRuler.addedForeground")] + pub editor_overview_ruler_added_foreground: Option, + #[serde(rename = "editorOverviewRuler.deletedForeground")] + pub editor_overview_ruler_deleted_foreground: Option, + #[serde(rename = "editorOverviewRuler.errorForeground")] + pub editor_overview_ruler_error_foreground: Option, + #[serde(rename = "editorOverviewRuler.warningForeground")] + pub editor_overview_ruler_warning_foreground: Option, + #[serde(rename = "editorOverviewRuler.infoForeground")] + pub editor_overview_ruler_info_foreground: Option, + #[serde(rename = "editorError.foreground")] + pub editor_error_foreground: Option, + #[serde(rename = "editorWarning.foreground")] + pub editor_warning_foreground: Option, + #[serde(rename = "editorGutter.modifiedBackground")] + pub editor_gutter_modified_background: Option, + #[serde(rename = "editorGutter.addedBackground")] + pub editor_gutter_added_background: Option, + #[serde(rename = "editorGutter.deletedBackground")] + pub editor_gutter_deleted_background: Option, + #[serde(rename = "gitDecoration.modifiedResourceForeground")] + pub git_decoration_modified_resource_foreground: Option, + #[serde(rename = "gitDecoration.deletedResourceForeground")] + pub git_decoration_deleted_resource_foreground: Option, + #[serde(rename = "gitDecoration.untrackedResourceForeground")] + pub git_decoration_untracked_resource_foreground: Option, + #[serde(rename = "gitDecoration.ignoredResourceForeground")] + pub git_decoration_ignored_resource_foreground: Option, + #[serde(rename = "gitDecoration.conflictingResourceForeground")] + pub git_decoration_conflicting_resource_foreground: Option, + #[serde(rename = "diffEditor.insertedTextBackground")] + pub diff_editor_inserted_text_background: Option, + #[serde(rename = "diffEditor.removedTextBackground")] + pub diff_editor_removed_text_background: Option, + #[serde(rename = "inlineChat.regionHighlight")] + pub inline_chat_region_highlight: Option, + #[serde(rename = "editorWidget.background")] + pub editor_widget_background: Option, + #[serde(rename = "editorSuggestWidget.background")] + pub editor_suggest_widget_background: Option, + #[serde(rename = "editorSuggestWidget.foreground")] + pub editor_suggest_widget_foreground: Option, + #[serde(rename = "editorSuggestWidget.selectedBackground")] + pub editor_suggest_widget_selected_background: Option, + #[serde(rename = "editorHoverWidget.background")] + pub editor_hover_widget_background: Option, + #[serde(rename = "editorHoverWidget.border")] + pub editor_hover_widget_border: Option, + #[serde(rename = "editorMarkerNavigation.background")] + pub editor_marker_navigation_background: Option, + #[serde(rename = "peekView.border")] + pub peek_view_border: Option, + #[serde(rename = "peekViewEditor.background")] + pub peek_view_editor_background: Option, + #[serde(rename = "peekViewEditor.matchHighlightBackground")] + pub peek_view_editor_match_highlight_background: Option, + #[serde(rename = "peekViewResult.background")] + pub peek_view_result_background: Option, + #[serde(rename = "peekViewResult.fileForeground")] + pub peek_view_result_file_foreground: Option, + #[serde(rename = "peekViewResult.lineForeground")] + pub peek_view_result_line_foreground: Option, + #[serde(rename = "peekViewResult.matchHighlightBackground")] + pub peek_view_result_match_highlight_background: Option, + #[serde(rename = "peekViewResult.selectionBackground")] + pub peek_view_result_selection_background: Option, + #[serde(rename = "peekViewResult.selectionForeground")] + pub peek_view_result_selection_foreground: Option, + #[serde(rename = "peekViewTitle.background")] + pub peek_view_title_background: Option, + #[serde(rename = "peekViewTitleDescription.foreground")] + pub peek_view_title_description_foreground: Option, + #[serde(rename = "peekViewTitleLabel.foreground")] + pub peek_view_title_label_foreground: Option, + #[serde(rename = "merge.currentHeaderBackground")] + pub merge_current_header_background: Option, + #[serde(rename = "merge.incomingHeaderBackground")] + pub merge_incoming_header_background: Option, + #[serde(rename = "editorOverviewRuler.currentContentForeground")] + pub editor_overview_ruler_current_content_foreground: Option, + #[serde(rename = "editorOverviewRuler.incomingContentForeground")] + pub editor_overview_ruler_incoming_content_foreground: Option, + #[serde(rename = "panel.background")] + pub panel_background: Option, + #[serde(rename = "panel.border")] + pub panel_border: Option, + #[serde(rename = "panelTitle.activeBorder")] + pub panel_title_active_border: Option, + #[serde(rename = "panelTitle.activeForeground")] + pub panel_title_active_foreground: Option, + #[serde(rename = "panelTitle.inactiveForeground")] + pub panel_title_inactive_foreground: Option, + #[serde(rename = "statusBar.background")] + pub status_bar_background: Option, + #[serde(rename = "statusBar.foreground")] + pub status_bar_foreground: Option, + #[serde(rename = "statusBar.debuggingBackground")] + pub status_bar_debugging_background: Option, + #[serde(rename = "statusBar.debuggingForeground")] + pub status_bar_debugging_foreground: Option, + #[serde(rename = "statusBar.noFolderBackground")] + pub status_bar_no_folder_background: Option, + #[serde(rename = "statusBar.noFolderForeground")] + pub status_bar_no_folder_foreground: Option, + #[serde(rename = "statusBarItem.prominentBackground")] + pub status_bar_item_prominent_background: Option, + #[serde(rename = "statusBarItem.prominentHoverBackground")] + pub status_bar_item_prominent_hover_background: Option, + #[serde(rename = "statusBarItem.remoteForeground")] + pub status_bar_item_remote_foreground: Option, + #[serde(rename = "statusBarItem.remoteBackground")] + pub status_bar_item_remote_background: Option, + #[serde(rename = "titleBar.activeBackground")] + pub title_bar_active_background: Option, + #[serde(rename = "titleBar.activeForeground")] + pub title_bar_active_foreground: Option, + #[serde(rename = "titleBar.inactiveBackground")] + pub title_bar_inactive_background: Option, + #[serde(rename = "titleBar.inactiveForeground")] + pub title_bar_inactive_foreground: Option, + #[serde(rename = "extensionButton.prominentForeground")] + pub extension_button_prominent_foreground: Option, + #[serde(rename = "extensionButton.prominentBackground")] + pub extension_button_prominent_background: Option, + #[serde(rename = "extensionButton.prominentHoverBackground")] + pub extension_button_prominent_hover_background: Option, + #[serde(rename = "pickerGroup.border")] + pub picker_group_border: Option, + #[serde(rename = "pickerGroup.foreground")] + pub picker_group_foreground: Option, + #[serde(rename = "debugToolBar.background")] + pub debug_tool_bar_background: Option, + #[serde(rename = "walkThrough.embeddedEditorBackground")] + pub walk_through_embedded_editor_background: Option, + #[serde(rename = "settings.headerForeground")] + pub settings_header_foreground: Option, + #[serde(rename = "settings.modifiedItemIndicator")] + pub settings_modified_item_indicator: Option, + #[serde(rename = "settings.dropdownBackground")] + pub settings_dropdown_background: Option, + #[serde(rename = "settings.dropdownForeground")] + pub settings_dropdown_foreground: Option, + #[serde(rename = "settings.dropdownBorder")] + pub settings_dropdown_border: Option, + #[serde(rename = "settings.checkboxBackground")] + pub settings_checkbox_background: Option, + #[serde(rename = "settings.checkboxForeground")] + pub settings_checkbox_foreground: Option, + #[serde(rename = "settings.checkboxBorder")] + pub settings_checkbox_border: Option, + #[serde(rename = "settings.textInputBackground")] + pub settings_text_input_background: Option, + #[serde(rename = "settings.textInputForeground")] + pub settings_text_input_foreground: Option, + #[serde(rename = "settings.textInputBorder")] + pub settings_text_input_border: Option, + #[serde(rename = "settings.numberInputBackground")] + pub settings_number_input_background: Option, + #[serde(rename = "settings.numberInputForeground")] + pub settings_number_input_foreground: Option, + #[serde(rename = "settings.numberInputBorder")] + pub settings_number_input_border: Option, + #[serde(rename = "breadcrumb.foreground")] + pub breadcrumb_foreground: Option, + #[serde(rename = "breadcrumb.background")] + pub breadcrumb_background: Option, + #[serde(rename = "breadcrumb.focusForeground")] + pub breadcrumb_focus_foreground: Option, + #[serde(rename = "breadcrumb.activeSelectionForeground")] + pub breadcrumb_active_selection_foreground: Option, + #[serde(rename = "breadcrumbPicker.background")] + pub breadcrumb_picker_background: Option, + #[serde(rename = "listFilterWidget.background")] + pub list_filter_widget_background: Option, + #[serde(rename = "listFilterWidget.outline")] + pub list_filter_widget_outline: Option, + #[serde(rename = "listFilterWidget.noMatchesOutline")] + pub list_filter_widget_no_matches_outline: Option, +} From 1a0ddc424bd21f2e2e9de02a73f776054d87c13e Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 9 Nov 2023 19:11:17 +0100 Subject: [PATCH 25/76] WIP --- crates/editor2/src/editor.rs | 43 ++++++++--------------- crates/gpui2/src/elements/uniform_list.rs | 2 +- 2 files changed, 15 insertions(+), 30 deletions(-) diff --git a/crates/editor2/src/editor.rs b/crates/editor2/src/editor.rs index 11ec3e0879c0c0f2a4071e76e0949ab869bc9927..5185df9b2f67255824a10fbc8b8023e1e25f615f 100644 --- a/crates/editor2/src/editor.rs +++ b/crates/editor2/src/editor.rs @@ -42,7 +42,8 @@ use gpui::{ action, actions, point, px, relative, rems, size, AnyElement, AppContext, BackgroundExecutor, Bounds, ClipboardItem, Component, Context, DispatchContext, EventEmitter, FocusHandle, FontFeatures, FontStyle, FontWeight, HighlightStyle, Hsla, InputHandler, Model, Pixels, Render, - Subscription, Task, TextStyle, View, ViewContext, VisualContext, WeakView, WindowContext, + Subscription, Task, TextStyle, UniformListScrollHandle, View, ViewContext, VisualContext, + WeakView, WindowContext, }; use highlight_matching_bracket::refresh_matching_bracket_highlights; use hover_popover::{hide_hover, HoverState}; @@ -940,29 +941,13 @@ struct CompletionsMenu { match_candidates: Arc<[StringMatchCandidate]>, matches: Arc<[StringMatch]>, selected_item: usize, - list: UniformListState, -} - -// todo!(this is fake) -#[derive(Clone, Default)] -struct UniformListState; - -// todo!(this is fake) -impl UniformListState { - pub fn scroll_to(&mut self, target: ScrollTarget) {} -} - -// todo!(this is somewhat fake) -#[derive(Debug)] -pub enum ScrollTarget { - Show(usize), - Center(usize), + scroll_handle: UniformListScrollHandle, } impl CompletionsMenu { fn select_first(&mut self, project: Option<&Model>, cx: &mut ViewContext) { self.selected_item = 0; - self.list.scroll_to(ScrollTarget::Show(self.selected_item)); + self.scroll_handle.scroll_to_item(self.selected_item); self.attempt_resolve_selected_completion_documentation(project, cx); cx.notify(); } @@ -973,7 +958,7 @@ impl CompletionsMenu { } else { self.selected_item = self.matches.len() - 1; } - self.list.scroll_to(ScrollTarget::Show(self.selected_item)); + self.scroll_handle.scroll_to_item(self.selected_item); self.attempt_resolve_selected_completion_documentation(project, cx); cx.notify(); } @@ -984,14 +969,14 @@ impl CompletionsMenu { } else { self.selected_item = 0; } - self.list.scroll_to(ScrollTarget::Show(self.selected_item)); + self.scroll_handle.scroll_to_item(self.selected_item); self.attempt_resolve_selected_completion_documentation(project, cx); cx.notify(); } fn select_last(&mut self, project: Option<&Model>, cx: &mut ViewContext) { self.selected_item = self.matches.len() - 1; - self.list.scroll_to(ScrollTarget::Show(self.selected_item)); + self.scroll_handle.scroll_to_item(self.selected_item); self.attempt_resolve_selected_completion_documentation(project, cx); cx.notify(); } @@ -1527,14 +1512,14 @@ struct CodeActionsMenu { actions: Arc<[CodeAction]>, buffer: Model, selected_item: usize, - list: UniformListState, + scroll_handle: UniformListScrollHandle, deployed_from_indicator: bool, } impl CodeActionsMenu { fn select_first(&mut self, cx: &mut ViewContext) { self.selected_item = 0; - self.list.scroll_to(ScrollTarget::Show(self.selected_item)); + self.scroll_handle.scroll_to_item(self.selected_item); cx.notify() } @@ -1544,7 +1529,7 @@ impl CodeActionsMenu { } else { self.selected_item = self.actions.len() - 1; } - self.list.scroll_to(ScrollTarget::Show(self.selected_item)); + self.scroll_handle.scroll_to_item(self.selected_item); cx.notify(); } @@ -1554,13 +1539,13 @@ impl CodeActionsMenu { } else { self.selected_item = 0; } - self.list.scroll_to(ScrollTarget::Show(self.selected_item)); + self.scroll_handle.scroll_to_item(self.selected_item); cx.notify(); } fn select_last(&mut self, cx: &mut ViewContext) { self.selected_item = self.actions.len() - 1; - self.list.scroll_to(ScrollTarget::Show(self.selected_item)); + self.scroll_handle.scroll_to_item(self.selected_item); cx.notify() } @@ -3660,7 +3645,7 @@ impl Editor { completions: Arc::new(RwLock::new(completions.into())), matches: Vec::new().into(), selected_item: 0, - list: Default::default(), + scroll_handle: UniformListScrollHandle::new(), }; menu.filter(query.as_deref(), cx.background_executor().clone()) .await; @@ -3873,7 +3858,7 @@ impl Editor { buffer, actions, selected_item: Default::default(), - list: Default::default(), + scroll_handle: UniformListScrollHandle::default(), deployed_from_indicator, })); } diff --git a/crates/gpui2/src/elements/uniform_list.rs b/crates/gpui2/src/elements/uniform_list.rs index a4524d5496b63cacd631ff1ab414dede29bc6086..679c420cc33edef9658326239a6e18d8c4182e98 100644 --- a/crates/gpui2/src/elements/uniform_list.rs +++ b/crates/gpui2/src/elements/uniform_list.rs @@ -50,7 +50,7 @@ pub struct UniformList { scroll_handle: Option, } -#[derive(Clone)] +#[derive(Clone, Default)] pub struct UniformListScrollHandle(Arc>>); #[derive(Clone, Debug)] From 978cff8095ba497daeaf37e320366833f6994ce6 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 9 Nov 2023 13:12:36 -0500 Subject: [PATCH 26/76] Use `IndexMap` for a deterministic order when importing syntax colors --- Cargo.lock | 1 + crates/theme2/src/themes/andromeda.rs | 16 +-- crates/theme2/src/themes/ayu.rs | 20 ++-- crates/theme2/src/themes/dracula.rs | 8 +- crates/theme2/src/themes/gruvbox.rs | 30 +++--- crates/theme2/src/themes/night_owl.rs | 20 ++-- crates/theme2/src/themes/nord.rs | 12 +-- crates/theme2/src/themes/notctis.rs | 100 +++++++++--------- crates/theme2/src/themes/palenight.rs | 8 +- crates/theme2/src/themes/rose_pine.rs | 8 +- crates/theme2/src/themes/solarized.rs | 18 ++-- crates/theme2/src/themes/synthwave_84.rs | 8 +- crates/theme_importer/Cargo.toml | 1 + crates/theme_importer/src/vscode/converter.rs | 5 +- crates/theme_importer/src/vscode/syntax.rs | 9 +- 15 files changed, 132 insertions(+), 132 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 52a4bae21f7d2676245a7d88b0986ea8bb00904d..ba76a5db4af8e07d7e0f6fdb4ea7b9bcd3da7bd3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9134,6 +9134,7 @@ dependencies = [ "anyhow", "convert_case 0.6.0", "gpui2", + "indexmap 1.9.3", "log", "rust-embed", "serde", diff --git a/crates/theme2/src/themes/andromeda.rs b/crates/theme2/src/themes/andromeda.rs index e48f58a7a2b6e7f8e6aca3461e15fc73bedd6660..5d1afae99ce82407e1e2074274bdd045817e29f4 100644 --- a/crates/theme2/src/themes/andromeda.rs +++ b/crates/theme2/src/themes/andromeda.rs @@ -62,9 +62,9 @@ pub fn andromeda() -> UserThemeFamily { syntax: Some(UserSyntaxTheme { highlights: vec![ ( - "punctuation".into(), + "comment".into(), UserHighlightStyle { - color: Some(rgba(0x95e072ff).into()), + color: Some(rgba(0x9fa0a6cc).into()), ..Default::default() }, ), @@ -76,9 +76,9 @@ pub fn andromeda() -> UserThemeFamily { }, ), ( - "comment".into(), + "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x9fa0a6cc).into()), + color: Some(rgba(0x95e072ff).into()), ..Default::default() }, ), @@ -135,9 +135,9 @@ pub fn andromeda() -> UserThemeFamily { syntax: Some(UserSyntaxTheme { highlights: vec![ ( - "punctuation".into(), + "comment".into(), UserHighlightStyle { - color: Some(rgba(0x95e072ff).into()), + color: Some(rgba(0x9fa0a6cc).into()), ..Default::default() }, ), @@ -149,9 +149,9 @@ pub fn andromeda() -> UserThemeFamily { }, ), ( - "comment".into(), + "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x9fa0a6cc).into()), + color: Some(rgba(0x95e072ff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/ayu.rs b/crates/theme2/src/themes/ayu.rs index 0401ff46a255eed7ec1e086faa77c88a1be2cca9..632b060fea70d6c9ece5ce20ae4e49e07505d731 100644 --- a/crates/theme2/src/themes/ayu.rs +++ b/crates/theme2/src/themes/ayu.rs @@ -66,16 +66,16 @@ pub fn ayu() -> UserThemeFamily { syntax: Some(UserSyntaxTheme { highlights: vec![ ( - "something".into(), + "comment".into(), UserHighlightStyle { - color: Some(rgba(0xfa8d3eff).into()), + color: Some(rgba(0x787b8099).into()), ..Default::default() }, ), ( - "comment".into(), + "something".into(), UserHighlightStyle { - color: Some(rgba(0x787b8099).into()), + color: Some(rgba(0xfa8d3eff).into()), ..Default::default() }, ), @@ -143,7 +143,7 @@ pub fn ayu() -> UserThemeFamily { syntax: Some(UserSyntaxTheme { highlights: vec![ ( - "punctuation".into(), + "comment".into(), UserHighlightStyle { color: Some(rgba(0xb8cfe680).into()), ..Default::default() @@ -157,7 +157,7 @@ pub fn ayu() -> UserThemeFamily { }, ), ( - "comment".into(), + "punctuation".into(), UserHighlightStyle { color: Some(rgba(0xb8cfe680).into()), ..Default::default() @@ -227,16 +227,16 @@ pub fn ayu() -> UserThemeFamily { }, ), ( - "punctuation".into(), + "something".into(), UserHighlightStyle { - color: Some(rgba(0xabb5be8c).into()), + color: Some(rgba(0xff8f3fff).into()), ..Default::default() }, ), ( - "something".into(), + "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0xff8f3fff).into()), + color: Some(rgba(0xabb5be8c).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/dracula.rs b/crates/theme2/src/themes/dracula.rs index 716ece161e9d0ad60c6460a2f7f767b35bae15c3..07342b6e6bb7888c06007638d6c7c96fc9f4fba3 100644 --- a/crates/theme2/src/themes/dracula.rs +++ b/crates/theme2/src/themes/dracula.rs @@ -74,16 +74,16 @@ pub fn dracula() -> UserThemeFamily { }, ), ( - "punctuation".into(), + "something".into(), UserHighlightStyle { - color: Some(rgba(0xff79c6ff).into()), + color: Some(rgba(0xf8f8f2ff).into()), ..Default::default() }, ), ( - "something".into(), + "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0xf8f8f2ff).into()), + color: Some(rgba(0xff79c6ff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/gruvbox.rs b/crates/theme2/src/themes/gruvbox.rs index 1d4da9922edf0120f01a68f9170afb73852c1d97..542b0816bb4ba12f9d4712e5043bc3ba9f3ea261 100644 --- a/crates/theme2/src/themes/gruvbox.rs +++ b/crates/theme2/src/themes/gruvbox.rs @@ -72,14 +72,14 @@ pub fn gruvbox() -> UserThemeFamily { }, ), ( - "punctuation".into(), + "something".into(), UserHighlightStyle { color: Some(rgba(0x83a598ff).into()), ..Default::default() }, ), ( - "something".into(), + "punctuation".into(), UserHighlightStyle { color: Some(rgba(0x83a598ff).into()), ..Default::default() @@ -141,21 +141,21 @@ pub fn gruvbox() -> UserThemeFamily { syntax: Some(UserSyntaxTheme { highlights: vec![ ( - "punctuation".into(), + "comment".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0x928374ff).into()), ..Default::default() }, ), ( - "comment".into(), + "something".into(), UserHighlightStyle { - color: Some(rgba(0x928374ff).into()), + color: Some(rgba(0x83a598ff).into()), ..Default::default() }, ), ( - "something".into(), + "punctuation".into(), UserHighlightStyle { color: Some(rgba(0x83a598ff).into()), ..Default::default() @@ -217,9 +217,9 @@ pub fn gruvbox() -> UserThemeFamily { syntax: Some(UserSyntaxTheme { highlights: vec![ ( - "punctuation".into(), + "comment".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0x928374ff).into()), ..Default::default() }, ), @@ -231,9 +231,9 @@ pub fn gruvbox() -> UserThemeFamily { }, ), ( - "comment".into(), + "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x928374ff).into()), + color: Some(rgba(0x83a598ff).into()), ..Default::default() }, ), @@ -369,16 +369,16 @@ pub fn gruvbox() -> UserThemeFamily { syntax: Some(UserSyntaxTheme { highlights: vec![ ( - "something".into(), + "comment".into(), UserHighlightStyle { - color: Some(rgba(0x066578ff).into()), + color: Some(rgba(0x928374ff).into()), ..Default::default() }, ), ( - "comment".into(), + "something".into(), UserHighlightStyle { - color: Some(rgba(0x928374ff).into()), + color: Some(rgba(0x066578ff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/night_owl.rs b/crates/theme2/src/themes/night_owl.rs index 2d5b1bd26be88354a08a68219376d6ebe5145a73..37b835119efb84d24d3d54347a05026e6ce88f2a 100644 --- a/crates/theme2/src/themes/night_owl.rs +++ b/crates/theme2/src/themes/night_owl.rs @@ -66,23 +66,23 @@ pub fn night_owl() -> UserThemeFamily { syntax: Some(UserSyntaxTheme { highlights: vec![ ( - "punctuation".into(), + "comment".into(), UserHighlightStyle { - color: Some(rgba(0xd3413dff).into()), + color: Some(rgba(0x637777ff).into()), ..Default::default() }, ), ( - "comment".into(), + "something".into(), UserHighlightStyle { - color: Some(rgba(0x637777ff).into()), + color: Some(rgba(0x7fcac3ff).into()), ..Default::default() }, ), ( - "something".into(), + "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x7fcac3ff).into()), + color: Some(rgba(0xd3413dff).into()), ..Default::default() }, ), @@ -144,16 +144,16 @@ pub fn night_owl() -> UserThemeFamily { syntax: Some(UserSyntaxTheme { highlights: vec![ ( - "something".into(), + "comment".into(), UserHighlightStyle { - color: Some(rgba(0x0b969bff).into()), + color: Some(rgba(0x989fb1ff).into()), ..Default::default() }, ), ( - "comment".into(), + "something".into(), UserHighlightStyle { - color: Some(rgba(0x989fb1ff).into()), + color: Some(rgba(0x0b969bff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/nord.rs b/crates/theme2/src/themes/nord.rs index 1a6e942b1fc4548a599abc9c89ed03ba0f8cc37b..4069fb3063f4cb0797a24a1b3a8d8a435e3c2164 100644 --- a/crates/theme2/src/themes/nord.rs +++ b/crates/theme2/src/themes/nord.rs @@ -67,23 +67,23 @@ pub fn nord() -> UserThemeFamily { syntax: Some(UserSyntaxTheme { highlights: vec![ ( - "something".into(), + "comment".into(), UserHighlightStyle { - color: Some(rgba(0xa3be8cff).into()), + color: Some(rgba(0x606e87ff).into()), ..Default::default() }, ), ( - "comment".into(), + "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x606e87ff).into()), + color: Some(rgba(0x81a1c1ff).into()), ..Default::default() }, ), ( - "punctuation".into(), + "something".into(), UserHighlightStyle { - color: Some(rgba(0x81a1c1ff).into()), + color: Some(rgba(0xa3be8cff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/notctis.rs b/crates/theme2/src/themes/notctis.rs index cab9f39530748793421386aa58a7d55ae805900e..ec4ca8527ee31b4d030bc3c8e748e1ea5ffae1ee 100644 --- a/crates/theme2/src/themes/notctis.rs +++ b/crates/theme2/src/themes/notctis.rs @@ -68,23 +68,23 @@ pub fn notctis() -> UserThemeFamily { syntax: Some(UserSyntaxTheme { highlights: vec![ ( - "punctuation".into(), + "comment".into(), UserHighlightStyle { - color: Some(rgba(0x49ace9ff).into()), + color: Some(rgba(0x5888a5ff).into()), ..Default::default() }, ), ( - "something".into(), + "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x49e9a6ff).into()), + color: Some(rgba(0x49ace9ff).into()), ..Default::default() }, ), ( - "comment".into(), + "something".into(), UserHighlightStyle { - color: Some(rgba(0x5888a5ff).into()), + color: Some(rgba(0x49e9a6ff).into()), ..Default::default() }, ), @@ -154,16 +154,16 @@ pub fn notctis() -> UserThemeFamily { }, ), ( - "something".into(), + "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x49e9a6ff).into()), + color: Some(rgba(0x49ace9ff).into()), ..Default::default() }, ), ( - "punctuation".into(), + "something".into(), UserHighlightStyle { - color: Some(rgba(0x49ace9ff).into()), + color: Some(rgba(0x49e9a6ff).into()), ..Default::default() }, ), @@ -226,23 +226,23 @@ pub fn notctis() -> UserThemeFamily { syntax: Some(UserSyntaxTheme { highlights: vec![ ( - "something".into(), + "comment".into(), UserHighlightStyle { - color: Some(rgba(0x00b368ff).into()), + color: Some(rgba(0x8ca6a6ff).into()), ..Default::default() }, ), ( - "comment".into(), + "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x8ca6a6ff).into()), + color: Some(rgba(0x0094f0ff).into()), ..Default::default() }, ), ( - "punctuation".into(), + "something".into(), UserHighlightStyle { - color: Some(rgba(0x0094f0ff).into()), + color: Some(rgba(0x00b368ff).into()), ..Default::default() }, ), @@ -305,23 +305,23 @@ pub fn notctis() -> UserThemeFamily { syntax: Some(UserSyntaxTheme { highlights: vec![ ( - "something".into(), + "comment".into(), UserHighlightStyle { - color: Some(rgba(0x00b368ff).into()), + color: Some(rgba(0x9995b7ff).into()), ..Default::default() }, ), ( - "comment".into(), + "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x9995b7ff).into()), + color: Some(rgba(0x0094f0ff).into()), ..Default::default() }, ), ( - "punctuation".into(), + "something".into(), UserHighlightStyle { - color: Some(rgba(0x0094f0ff).into()), + color: Some(rgba(0x00b368ff).into()), ..Default::default() }, ), @@ -384,16 +384,16 @@ pub fn notctis() -> UserThemeFamily { syntax: Some(UserSyntaxTheme { highlights: vec![ ( - "punctuation".into(), + "comment".into(), UserHighlightStyle { - color: Some(rgba(0x0094f0ff).into()), + color: Some(rgba(0x8ca6a6ff).into()), ..Default::default() }, ), ( - "comment".into(), + "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x8ca6a6ff).into()), + color: Some(rgba(0x0094f0ff).into()), ..Default::default() }, ), @@ -463,23 +463,23 @@ pub fn notctis() -> UserThemeFamily { syntax: Some(UserSyntaxTheme { highlights: vec![ ( - "something".into(), + "comment".into(), UserHighlightStyle { - color: Some(rgba(0x72c09fff).into()), + color: Some(rgba(0x5d7787ff).into()), ..Default::default() }, ), ( - "comment".into(), + "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x5d7787ff).into()), + color: Some(rgba(0x5897bfff).into()), ..Default::default() }, ), ( - "punctuation".into(), + "something".into(), UserHighlightStyle { - color: Some(rgba(0x5897bfff).into()), + color: Some(rgba(0x72c09fff).into()), ..Default::default() }, ), @@ -542,23 +542,23 @@ pub fn notctis() -> UserThemeFamily { syntax: Some(UserSyntaxTheme { highlights: vec![ ( - "something".into(), + "comment".into(), UserHighlightStyle { - color: Some(rgba(0x49e9a6ff).into()), + color: Some(rgba(0x5b858bff).into()), ..Default::default() }, ), ( - "comment".into(), + "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x5b858bff).into()), + color: Some(rgba(0x49ace9ff).into()), ..Default::default() }, ), ( - "punctuation".into(), + "something".into(), UserHighlightStyle { - color: Some(rgba(0x49ace9ff).into()), + color: Some(rgba(0x49e9a6ff).into()), ..Default::default() }, ), @@ -707,16 +707,16 @@ pub fn notctis() -> UserThemeFamily { }, ), ( - "something".into(), + "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x49e9a6ff).into()), + color: Some(rgba(0x49ace9ff).into()), ..Default::default() }, ), ( - "punctuation".into(), + "something".into(), UserHighlightStyle { - color: Some(rgba(0x49ace9ff).into()), + color: Some(rgba(0x49e9a6ff).into()), ..Default::default() }, ), @@ -779,9 +779,9 @@ pub fn notctis() -> UserThemeFamily { syntax: Some(UserSyntaxTheme { highlights: vec![ ( - "something".into(), + "comment".into(), UserHighlightStyle { - color: Some(rgba(0x49e9a6ff).into()), + color: Some(rgba(0x716b93ff).into()), ..Default::default() }, ), @@ -793,9 +793,9 @@ pub fn notctis() -> UserThemeFamily { }, ), ( - "comment".into(), + "something".into(), UserHighlightStyle { - color: Some(rgba(0x716b93ff).into()), + color: Some(rgba(0x49e9a6ff).into()), ..Default::default() }, ), @@ -865,16 +865,16 @@ pub fn notctis() -> UserThemeFamily { }, ), ( - "something".into(), + "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x49e9a6ff).into()), + color: Some(rgba(0x49ace9ff).into()), ..Default::default() }, ), ( - "punctuation".into(), + "something".into(), UserHighlightStyle { - color: Some(rgba(0x49ace9ff).into()), + color: Some(rgba(0x49e9a6ff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/palenight.rs b/crates/theme2/src/themes/palenight.rs index 94e002478262a59a12ab3aef46a84b58d92f9858..a371f1f117ddceb673f1e9f3e02594fd45f72b0e 100644 --- a/crates/theme2/src/themes/palenight.rs +++ b/crates/theme2/src/themes/palenight.rs @@ -143,16 +143,16 @@ pub fn palenight() -> UserThemeFamily { syntax: Some(UserSyntaxTheme { highlights: vec![ ( - "something".into(), + "comment".into(), UserHighlightStyle { - color: Some(rgba(0x7fcac3ff).into()), + color: Some(rgba(0x687097ff).into()), ..Default::default() }, ), ( - "comment".into(), + "something".into(), UserHighlightStyle { - color: Some(rgba(0x687097ff).into()), + color: Some(rgba(0x7fcac3ff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/rose_pine.rs b/crates/theme2/src/themes/rose_pine.rs index 6d5f6b256ddd0e7bd871181ef5d4fd2f63ffdf75..9a029f4ba7e54b60a762dd8337beebd9807fa544 100644 --- a/crates/theme2/src/themes/rose_pine.rs +++ b/crates/theme2/src/themes/rose_pine.rs @@ -230,16 +230,16 @@ pub fn rose_pine() -> UserThemeFamily { }, ), ( - "punctuation".into(), + "something".into(), UserHighlightStyle { - color: Some(rgba(0x9893a5ff).into()), + color: Some(rgba(0xd7827dff).into()), ..Default::default() }, ), ( - "something".into(), + "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0xd7827dff).into()), + color: Some(rgba(0x9893a5ff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/solarized.rs b/crates/theme2/src/themes/solarized.rs index 538beff8ba1c2ac4dd9db04d13dc36cd1b3d38ae..58a4e3d3cbb00d4426211dfd61837476d273473f 100644 --- a/crates/theme2/src/themes/solarized.rs +++ b/crates/theme2/src/themes/solarized.rs @@ -62,23 +62,23 @@ pub fn solarized() -> UserThemeFamily { syntax: Some(UserSyntaxTheme { highlights: vec![ ( - "punctuation".into(), + "comment".into(), UserHighlightStyle { color: Some(rgba(0x657b83ff).into()), ..Default::default() }, ), ( - "comment".into(), + "something".into(), UserHighlightStyle { - color: Some(rgba(0x657b83ff).into()), + color: Some(rgba(0x93a1a1ff).into()), ..Default::default() }, ), ( - "something".into(), + "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x93a1a1ff).into()), + color: Some(rgba(0x657b83ff).into()), ..Default::default() }, ), @@ -139,16 +139,16 @@ pub fn solarized() -> UserThemeFamily { }, ), ( - "punctuation".into(), + "something".into(), UserHighlightStyle { - color: Some(rgba(0x93a1a1ff).into()), + color: Some(rgba(0x657b83ff).into()), ..Default::default() }, ), ( - "something".into(), + "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x657b83ff).into()), + color: Some(rgba(0x93a1a1ff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/synthwave_84.rs b/crates/theme2/src/themes/synthwave_84.rs index eec0fe4e143cc581f720a760b12c8c50b61e2777..269828fd5bbb935360cc0795695a1a4db0dad109 100644 --- a/crates/theme2/src/themes/synthwave_84.rs +++ b/crates/theme2/src/themes/synthwave_84.rs @@ -59,16 +59,16 @@ pub fn synthwave_84() -> UserThemeFamily { }, ), ( - "punctuation".into(), + "something".into(), UserHighlightStyle { - color: Some(rgba(0xfede5cff).into()), + color: Some(rgba(0xfe444fff).into()), ..Default::default() }, ), ( - "something".into(), + "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0xfe444fff).into()), + color: Some(rgba(0xfede5cff).into()), ..Default::default() }, ), diff --git a/crates/theme_importer/Cargo.toml b/crates/theme_importer/Cargo.toml index 1109a60977ace0bb5decae880d4761580411732c..28ae305735393bfb1cb3f8e3acd53a5c42a7246b 100644 --- a/crates/theme_importer/Cargo.toml +++ b/crates/theme_importer/Cargo.toml @@ -10,6 +10,7 @@ publish = false anyhow.workspace = true convert_case = "0.6.0" gpui = { package = "gpui2", path = "../gpui2" } +indexmap = "1.6.2" log.workspace = true rust-embed.workspace = true serde.workspace = true diff --git a/crates/theme_importer/src/vscode/converter.rs b/crates/theme_importer/src/vscode/converter.rs index b203807dbcc9fc441284e257876679ae02534ab3..d0fe5fb3d997fa497597cc9ce5b8717d420c40e2 100644 --- a/crates/theme_importer/src/vscode/converter.rs +++ b/crates/theme_importer/src/vscode/converter.rs @@ -1,7 +1,6 @@ -use std::collections::HashMap; - use anyhow::Result; use gpui::{Hsla, Rgba}; +use indexmap::IndexMap; use theme::{ StatusColorsRefinement, ThemeColorsRefinement, UserSyntaxTheme, UserTheme, UserThemeStylesRefinement, @@ -34,7 +33,7 @@ impl VsCodeThemeConverter { let status_color_refinements = self.convert_status_colors()?; let theme_colors_refinements = self.convert_theme_colors()?; - let mut highlight_styles = HashMap::new(); + let mut highlight_styles = IndexMap::new(); for token_color in self.theme.token_colors { highlight_styles.extend(token_color.highlight_styles()?); diff --git a/crates/theme_importer/src/vscode/syntax.rs b/crates/theme_importer/src/vscode/syntax.rs index dc906bbc4b7edf07ce49be6a6f56eb4f77798094..8f98ebad974a8701cb3881e8357d822900acafda 100644 --- a/crates/theme_importer/src/vscode/syntax.rs +++ b/crates/theme_importer/src/vscode/syntax.rs @@ -2,9 +2,8 @@ // Map tokenColors style to HighlightStyle (fontStyle, foreground, background) // Take in the scopes from the tokenColors and try to match each to our HighlightStyles -use std::collections::HashMap; - use anyhow::Result; +use indexmap::IndexMap; use serde::Deserialize; use theme::UserHighlightStyle; @@ -33,13 +32,13 @@ pub struct VsCodeTokenColorSettings { } impl VsCodeTokenColor { - pub fn highlight_styles(&self) -> Result> { - let mut highlight_styles = HashMap::new(); + pub fn highlight_styles(&self) -> Result> { + let mut highlight_styles = IndexMap::new(); let scope = match self.scope { Some(VsCodeTokenScope::One(ref scope)) => vec![scope.clone()], Some(VsCodeTokenScope::Many(ref scopes)) => scopes.clone(), - None => return Ok(HashMap::new()), + None => return Ok(IndexMap::new()), }; for scope in &scope { From ff053890cfc2e374aa4f18c1f9145dafc02be64f Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Thu, 9 Nov 2023 13:46:08 -0500 Subject: [PATCH 27/76] Extend UserSyntax to allow font_style and font_weight to be specified Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com> --- crates/theme2/src/themes/ayu.rs | 3 ++ crates/theme2/src/themes/gruvbox.rs | 6 ++++ crates/theme2/src/themes/night_owl.rs | 2 ++ crates/theme2/src/themes/palenight.rs | 3 ++ crates/theme2/src/themes/rose_pine.rs | 6 ++++ crates/theme2/src/themes/solarized.rs | 3 ++ crates/theme2/src/themes/synthwave_84.rs | 1 + crates/theme2/src/user_theme.rs | 35 +++++++++++++++++- crates/theme_importer/src/theme_printer.rs | 36 +++++++++++++------ crates/theme_importer/src/vscode/converter.rs | 19 ++++++++-- crates/theme_importer/src/vscode/syntax.rs | 12 ++++++- 11 files changed, 111 insertions(+), 15 deletions(-) diff --git a/crates/theme2/src/themes/ayu.rs b/crates/theme2/src/themes/ayu.rs index 632b060fea70d6c9ece5ce20ae4e49e07505d731..14a8e47daf6743499298ca41a526dd95c92c98f5 100644 --- a/crates/theme2/src/themes/ayu.rs +++ b/crates/theme2/src/themes/ayu.rs @@ -69,6 +69,7 @@ pub fn ayu() -> UserThemeFamily { "comment".into(), UserHighlightStyle { color: Some(rgba(0x787b8099).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -146,6 +147,7 @@ pub fn ayu() -> UserThemeFamily { "comment".into(), UserHighlightStyle { color: Some(rgba(0xb8cfe680).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -223,6 +225,7 @@ pub fn ayu() -> UserThemeFamily { "comment".into(), UserHighlightStyle { color: Some(rgba(0xabb5be8c).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/gruvbox.rs b/crates/theme2/src/themes/gruvbox.rs index 542b0816bb4ba12f9d4712e5043bc3ba9f3ea261..453ff7b42ae0d8155fc3688b39c0bb119b3522ad 100644 --- a/crates/theme2/src/themes/gruvbox.rs +++ b/crates/theme2/src/themes/gruvbox.rs @@ -68,6 +68,7 @@ pub fn gruvbox() -> UserThemeFamily { "comment".into(), UserHighlightStyle { color: Some(rgba(0x928374ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -144,6 +145,7 @@ pub fn gruvbox() -> UserThemeFamily { "comment".into(), UserHighlightStyle { color: Some(rgba(0x928374ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -220,6 +222,7 @@ pub fn gruvbox() -> UserThemeFamily { "comment".into(), UserHighlightStyle { color: Some(rgba(0x928374ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -296,6 +299,7 @@ pub fn gruvbox() -> UserThemeFamily { "comment".into(), UserHighlightStyle { color: Some(rgba(0x928374ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -372,6 +376,7 @@ pub fn gruvbox() -> UserThemeFamily { "comment".into(), UserHighlightStyle { color: Some(rgba(0x928374ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -448,6 +453,7 @@ pub fn gruvbox() -> UserThemeFamily { "comment".into(), UserHighlightStyle { color: Some(rgba(0x928374ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/night_owl.rs b/crates/theme2/src/themes/night_owl.rs index 37b835119efb84d24d3d54347a05026e6ce88f2a..acebba8bfe73068efec084babc6098dbe2142898 100644 --- a/crates/theme2/src/themes/night_owl.rs +++ b/crates/theme2/src/themes/night_owl.rs @@ -69,6 +69,7 @@ pub fn night_owl() -> UserThemeFamily { "comment".into(), UserHighlightStyle { color: Some(rgba(0x637777ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -147,6 +148,7 @@ pub fn night_owl() -> UserThemeFamily { "comment".into(), UserHighlightStyle { color: Some(rgba(0x989fb1ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/palenight.rs b/crates/theme2/src/themes/palenight.rs index a371f1f117ddceb673f1e9f3e02594fd45f72b0e..1266828ac01038278581f721c54c75c10618518b 100644 --- a/crates/theme2/src/themes/palenight.rs +++ b/crates/theme2/src/themes/palenight.rs @@ -69,6 +69,7 @@ pub fn palenight() -> UserThemeFamily { "comment".into(), UserHighlightStyle { color: Some(rgba(0x687097ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -146,6 +147,7 @@ pub fn palenight() -> UserThemeFamily { "comment".into(), UserHighlightStyle { color: Some(rgba(0x687097ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -223,6 +225,7 @@ pub fn palenight() -> UserThemeFamily { "comment".into(), UserHighlightStyle { color: Some(rgba(0x687097ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/rose_pine.rs b/crates/theme2/src/themes/rose_pine.rs index 9a029f4ba7e54b60a762dd8337beebd9807fa544..475c023b017a0a95ca8ddce09af4ea55583143e8 100644 --- a/crates/theme2/src/themes/rose_pine.rs +++ b/crates/theme2/src/themes/rose_pine.rs @@ -70,6 +70,7 @@ pub fn rose_pine() -> UserThemeFamily { "comment".into(), UserHighlightStyle { color: Some(rgba(0x6e6a86ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -77,6 +78,7 @@ pub fn rose_pine() -> UserThemeFamily { "something".into(), UserHighlightStyle { color: Some(rgba(0xebbcbaff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -148,6 +150,7 @@ pub fn rose_pine() -> UserThemeFamily { "comment".into(), UserHighlightStyle { color: Some(rgba(0x6e6a86ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -155,6 +158,7 @@ pub fn rose_pine() -> UserThemeFamily { "something".into(), UserHighlightStyle { color: Some(rgba(0xea9a97ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -226,6 +230,7 @@ pub fn rose_pine() -> UserThemeFamily { "comment".into(), UserHighlightStyle { color: Some(rgba(0x9893a5ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -233,6 +238,7 @@ pub fn rose_pine() -> UserThemeFamily { "something".into(), UserHighlightStyle { color: Some(rgba(0xd7827dff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/solarized.rs b/crates/theme2/src/themes/solarized.rs index 58a4e3d3cbb00d4426211dfd61837476d273473f..ebacffaaa24763a9b15a92cad1df2a742f7a98d7 100644 --- a/crates/theme2/src/themes/solarized.rs +++ b/crates/theme2/src/themes/solarized.rs @@ -65,6 +65,7 @@ pub fn solarized() -> UserThemeFamily { "comment".into(), UserHighlightStyle { color: Some(rgba(0x657b83ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -72,6 +73,7 @@ pub fn solarized() -> UserThemeFamily { "something".into(), UserHighlightStyle { color: Some(rgba(0x93a1a1ff).into()), + font_weight: Some(UserFontWeight(700.0)), ..Default::default() }, ), @@ -135,6 +137,7 @@ pub fn solarized() -> UserThemeFamily { "comment".into(), UserHighlightStyle { color: Some(rgba(0x93a1a1ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/synthwave_84.rs b/crates/theme2/src/themes/synthwave_84.rs index 269828fd5bbb935360cc0795695a1a4db0dad109..18c734c743ef241177ee456329054be1d6175b93 100644 --- a/crates/theme2/src/themes/synthwave_84.rs +++ b/crates/theme2/src/themes/synthwave_84.rs @@ -55,6 +55,7 @@ pub fn synthwave_84() -> UserThemeFamily { "comment".into(), UserHighlightStyle { color: Some(rgba(0x848bbdff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), diff --git a/crates/theme2/src/user_theme.rs b/crates/theme2/src/user_theme.rs index f0287bfb7269ec07ece862f119019e9ee48566c9..a1f7d4fd7979d796260c34114b404d708f276b8c 100644 --- a/crates/theme2/src/user_theme.rs +++ b/crates/theme2/src/user_theme.rs @@ -1,4 +1,4 @@ -use gpui::Hsla; +use gpui::{FontWeight, Hsla}; use refineable::Refineable; use serde::Deserialize; @@ -36,6 +36,39 @@ pub struct UserSyntaxTheme { #[derive(Clone, Default, Deserialize)] pub struct UserHighlightStyle { pub color: Option, + pub font_style: Option, + pub font_weight: Option, +} + +#[derive(Clone, Default, Deserialize)] +pub struct UserFontWeight(pub f32); + +impl UserFontWeight { + /// Thin weight (100), the thinnest value. + pub const THIN: Self = Self(FontWeight::THIN.0); + /// Extra light weight (200). + pub const EXTRA_LIGHT: Self = Self(FontWeight::EXTRA_LIGHT.0); + /// Light weight (300). + pub const LIGHT: Self = Self(FontWeight::LIGHT.0); + /// Normal (400). + pub const NORMAL: Self = Self(FontWeight::NORMAL.0); + /// Medium weight (500, higher than normal). + pub const MEDIUM: Self = Self(FontWeight::MEDIUM.0); + /// Semibold weight (600). + pub const SEMIBOLD: Self = Self(FontWeight::SEMIBOLD.0); + /// Bold weight (700). + pub const BOLD: Self = Self(FontWeight::BOLD.0); + /// Extra-bold weight (800). + pub const EXTRA_BOLD: Self = Self(FontWeight::EXTRA_BOLD.0); + /// Black weight (900), the thickest value. + pub const BLACK: Self = Self(FontWeight::BLACK.0); +} + +#[derive(Debug, Clone, Copy, Deserialize)] +pub enum UserFontStyle { + Normal, + Italic, + Oblique, } impl UserHighlightStyle { diff --git a/crates/theme_importer/src/theme_printer.rs b/crates/theme_importer/src/theme_printer.rs index f99030b4aa3a6a1de66e9a0187b6cf190a3c5783..9664d843dcece1bfd0a81c35863f0d7898a5dec6 100644 --- a/crates/theme_importer/src/theme_printer.rs +++ b/crates/theme_importer/src/theme_printer.rs @@ -364,19 +364,33 @@ pub struct UserHighlightStylePrinter<'a>(&'a UserHighlightStyle); impl<'a> Debug for UserHighlightStylePrinter<'a> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let fields = vec![("color", self.0.color)]; - f.write_str("UserHighlightStyle {")?; - for (field_name, value) in fields { - if let Some(color) = value { - f.write_str(field_name)?; - f.write_str(": ")?; - f.write_str("Some(")?; - HslaPrinter(color).fmt(f)?; - f.write_str(")")?; - f.write_str(",")?; - } + if let Some(color) = self.0.color { + f.write_str("color")?; + f.write_str(": ")?; + f.write_str("Some(")?; + HslaPrinter(color).fmt(f)?; + f.write_str(")")?; + f.write_str(",")?; + } + + if let Some(font_style) = self.0.font_style { + f.write_str("font_style")?; + f.write_str(": ")?; + f.write_str("Some(")?; + write!(f, "UserFontStyle::{:?}", font_style)?; + f.write_str(")")?; + f.write_str(",")?; + } + + if let Some(font_weight) = self.0.font_weight.as_ref() { + f.write_str("font_weight")?; + f.write_str(": ")?; + f.write_str("Some(")?; + write!(f, "UserFontWeight({:?})", font_weight.0)?; + f.write_str(")")?; + f.write_str(",")?; } f.write_str("..Default::default()")?; diff --git a/crates/theme_importer/src/vscode/converter.rs b/crates/theme_importer/src/vscode/converter.rs index d0fe5fb3d997fa497597cc9ce5b8717d420c40e2..6557c1b6ef6ea89ced2e53b617426cb8d1ba3f6a 100644 --- a/crates/theme_importer/src/vscode/converter.rs +++ b/crates/theme_importer/src/vscode/converter.rs @@ -2,8 +2,8 @@ use anyhow::Result; use gpui::{Hsla, Rgba}; use indexmap::IndexMap; use theme::{ - StatusColorsRefinement, ThemeColorsRefinement, UserSyntaxTheme, UserTheme, - UserThemeStylesRefinement, + StatusColorsRefinement, ThemeColorsRefinement, UserFontStyle, UserFontWeight, UserSyntaxTheme, + UserTheme, UserThemeStylesRefinement, }; use crate::util::Traverse; @@ -14,6 +14,21 @@ pub(crate) fn try_parse_color(color: &str) -> Result { Ok(Rgba::try_from(color)?.into()) } +pub(crate) fn try_parse_font_weight(font_style: &str) -> Option { + match font_style { + style if style.contains("bold") => Some(UserFontWeight::BOLD), + _ => None, + } +} + +pub(crate) fn try_parse_font_style(font_style: &str) -> Option { + match font_style { + style if style.contains("italic") => Some(UserFontStyle::Italic), + style if style.contains("oblique") => Some(UserFontStyle::Oblique), + _ => None, + } +} + pub struct VsCodeThemeConverter { theme: VsCodeTheme, theme_metadata: ThemeMetadata, diff --git a/crates/theme_importer/src/vscode/syntax.rs b/crates/theme_importer/src/vscode/syntax.rs index 8f98ebad974a8701cb3881e8357d822900acafda..1d92914df6d3d52e363f9655e1b095bd15c9ac67 100644 --- a/crates/theme_importer/src/vscode/syntax.rs +++ b/crates/theme_importer/src/vscode/syntax.rs @@ -8,7 +8,7 @@ use serde::Deserialize; use theme::UserHighlightStyle; use crate::util::Traverse; -use crate::vscode::try_parse_color; +use crate::vscode::{try_parse_color, try_parse_font_style, try_parse_font_weight}; #[derive(Debug, Deserialize)] #[serde(untagged)] @@ -52,6 +52,16 @@ impl VsCodeTokenColor { .foreground .as_ref() .traverse(|color| try_parse_color(&color))?, + font_style: self + .settings + .font_style + .as_ref() + .and_then(|style| try_parse_font_style(&style)), + font_weight: self + .settings + .font_style + .as_ref() + .and_then(|style| try_parse_font_weight(&style)), }; if highlight_style.is_empty() { From 4c89b2885ea6b9451c069f61dc1b01b89f09496f Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 9 Nov 2023 10:58:33 -0800 Subject: [PATCH 28/76] Use normal JS comments within JSX tags and JSX expression blocks Co-authored-by: Kirill --- crates/language/src/buffer_tests.rs | 54 +++++++++++++++++-- .../src/languages/javascript/overrides.scm | 7 ++- crates/zed/src/languages/tsx/overrides.scm | 7 ++- .../src/languages/javascript/overrides.scm | 7 ++- crates/zed2/src/languages/tsx/overrides.scm | 7 ++- 5 files changed, 73 insertions(+), 9 deletions(-) diff --git a/crates/language/src/buffer_tests.rs b/crates/language/src/buffer_tests.rs index b7e9001c6ab5233fba3c80ca527f2068fc1e02df..93da61e7a897289806fb1d1d0f10ab3241cead3b 100644 --- a/crates/language/src/buffer_tests.rs +++ b/crates/language/src/buffer_tests.rs @@ -1692,14 +1692,25 @@ fn test_language_scope_at_with_javascript(cx: &mut AppContext) { r#" (jsx_element) @element (string) @string + [ + (jsx_opening_element) + (jsx_closing_element) + (jsx_expression) + ] @default "#, ) .unwrap(); - let text = r#"a["b"] = ;"#; + let text = r#" + a["b"] = + + { g() } + ; + "# + .unindent(); let buffer = - Buffer::new(0, cx.model_id() as u64, text).with_language(Arc::new(language), cx); + Buffer::new(0, cx.model_id() as u64, &text).with_language(Arc::new(language), cx); let snapshot = buffer.snapshot(); let config = snapshot.language_scope_at(0).unwrap(); @@ -1710,7 +1721,9 @@ fn test_language_scope_at_with_javascript(cx: &mut AppContext) { &[true, true] ); - let string_config = snapshot.language_scope_at(3).unwrap(); + let string_config = snapshot + .language_scope_at(text.find("b\"").unwrap()) + .unwrap(); assert_eq!(string_config.line_comment_prefix().unwrap().as_ref(), "// "); // Second bracket pair is disabled assert_eq!( @@ -1718,18 +1731,49 @@ fn test_language_scope_at_with_javascript(cx: &mut AppContext) { &[true, false] ); - let element_config = snapshot.language_scope_at(10).unwrap(); + // In between JSX tags: use the `element` override. + let element_config = snapshot + .language_scope_at(text.find("").unwrap()) + .unwrap(); assert_eq!(element_config.line_comment_prefix(), None); assert_eq!( element_config.block_comment_delimiters(), Some((&"{/*".into(), &"*/}".into())) ); - // Both bracket pairs are enabled assert_eq!( element_config.brackets().map(|e| e.1).collect::>(), &[true, true] ); + // Within a JSX tag: use the default config. + let tag_config = snapshot + .language_scope_at(text.find(" d=").unwrap() + 1) + .unwrap(); + assert_eq!(tag_config.line_comment_prefix().unwrap().as_ref(), "// "); + assert_eq!( + tag_config.brackets().map(|e| e.1).collect::>(), + &[true, true] + ); + + // In a JSX expression: use the default config. + let expression_in_element_config = snapshot + .language_scope_at(text.find("{").unwrap() + 1) + .unwrap(); + assert_eq!( + expression_in_element_config + .line_comment_prefix() + .unwrap() + .as_ref(), + "// " + ); + assert_eq!( + expression_in_element_config + .brackets() + .map(|e| e.1) + .collect::>(), + &[true, true] + ); + buffer }); } diff --git a/crates/zed/src/languages/javascript/overrides.scm b/crates/zed/src/languages/javascript/overrides.scm index 8b43fdcfc558e5b86232618206b64227f426251e..eb0a33b067ff096ee5525678396c65395f9d9816 100644 --- a/crates/zed/src/languages/javascript/overrides.scm +++ b/crates/zed/src/languages/javascript/overrides.scm @@ -8,6 +8,11 @@ [ (jsx_element) (jsx_fragment) +] @element + +[ + (jsx_opening_element) + (jsx_closing_element) (jsx_self_closing_element) (jsx_expression) -] @element +] @default diff --git a/crates/zed/src/languages/tsx/overrides.scm b/crates/zed/src/languages/tsx/overrides.scm index 8b43fdcfc558e5b86232618206b64227f426251e..eb0a33b067ff096ee5525678396c65395f9d9816 100644 --- a/crates/zed/src/languages/tsx/overrides.scm +++ b/crates/zed/src/languages/tsx/overrides.scm @@ -8,6 +8,11 @@ [ (jsx_element) (jsx_fragment) +] @element + +[ + (jsx_opening_element) + (jsx_closing_element) (jsx_self_closing_element) (jsx_expression) -] @element +] @default diff --git a/crates/zed2/src/languages/javascript/overrides.scm b/crates/zed2/src/languages/javascript/overrides.scm index 8b43fdcfc558e5b86232618206b64227f426251e..eb0a33b067ff096ee5525678396c65395f9d9816 100644 --- a/crates/zed2/src/languages/javascript/overrides.scm +++ b/crates/zed2/src/languages/javascript/overrides.scm @@ -8,6 +8,11 @@ [ (jsx_element) (jsx_fragment) +] @element + +[ + (jsx_opening_element) + (jsx_closing_element) (jsx_self_closing_element) (jsx_expression) -] @element +] @default diff --git a/crates/zed2/src/languages/tsx/overrides.scm b/crates/zed2/src/languages/tsx/overrides.scm index 8b43fdcfc558e5b86232618206b64227f426251e..eb0a33b067ff096ee5525678396c65395f9d9816 100644 --- a/crates/zed2/src/languages/tsx/overrides.scm +++ b/crates/zed2/src/languages/tsx/overrides.scm @@ -8,6 +8,11 @@ [ (jsx_element) (jsx_fragment) +] @element + +[ + (jsx_opening_element) + (jsx_closing_element) (jsx_self_closing_element) (jsx_expression) -] @element +] @default From e50318e7e11634498bfd55f83b3dfb04b05bb750 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 9 Nov 2023 11:04:49 -0800 Subject: [PATCH 29/76] Duplicate buffer test changes in language2 version --- crates/language2/src/buffer_tests.rs | 54 +++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 5 deletions(-) diff --git a/crates/language2/src/buffer_tests.rs b/crates/language2/src/buffer_tests.rs index c0bd068973ec938ae30716f9f36c1265360d7fe1..ba26e7fc5590e599b69d09ba84b195d68b9f0b86 100644 --- a/crates/language2/src/buffer_tests.rs +++ b/crates/language2/src/buffer_tests.rs @@ -1696,14 +1696,25 @@ fn test_language_scope_at_with_javascript(cx: &mut AppContext) { r#" (jsx_element) @element (string) @string + [ + (jsx_opening_element) + (jsx_closing_element) + (jsx_expression) + ] @default "#, ) .unwrap(); - let text = r#"a["b"] = ;"#; + let text = r#" + a["b"] = + + { g() } + ; + "# + .unindent(); let buffer = - Buffer::new(0, cx.entity_id().as_u64(), text).with_language(Arc::new(language), cx); + Buffer::new(0, cx.entity_id().as_u64(), &text).with_language(Arc::new(language), cx); let snapshot = buffer.snapshot(); let config = snapshot.language_scope_at(0).unwrap(); @@ -1714,7 +1725,9 @@ fn test_language_scope_at_with_javascript(cx: &mut AppContext) { &[true, true] ); - let string_config = snapshot.language_scope_at(3).unwrap(); + let string_config = snapshot + .language_scope_at(text.find("b\"").unwrap()) + .unwrap(); assert_eq!(string_config.line_comment_prefix().unwrap().as_ref(), "// "); // Second bracket pair is disabled assert_eq!( @@ -1722,18 +1735,49 @@ fn test_language_scope_at_with_javascript(cx: &mut AppContext) { &[true, false] ); - let element_config = snapshot.language_scope_at(10).unwrap(); + // In between JSX tags: use the `element` override. + let element_config = snapshot + .language_scope_at(text.find("").unwrap()) + .unwrap(); assert_eq!(element_config.line_comment_prefix(), None); assert_eq!( element_config.block_comment_delimiters(), Some((&"{/*".into(), &"*/}".into())) ); - // Both bracket pairs are enabled assert_eq!( element_config.brackets().map(|e| e.1).collect::>(), &[true, true] ); + // Within a JSX tag: use the default config. + let tag_config = snapshot + .language_scope_at(text.find(" d=").unwrap() + 1) + .unwrap(); + assert_eq!(tag_config.line_comment_prefix().unwrap().as_ref(), "// "); + assert_eq!( + tag_config.brackets().map(|e| e.1).collect::>(), + &[true, true] + ); + + // In a JSX expression: use the default config. + let expression_in_element_config = snapshot + .language_scope_at(text.find("{").unwrap() + 1) + .unwrap(); + assert_eq!( + expression_in_element_config + .line_comment_prefix() + .unwrap() + .as_ref(), + "// " + ); + assert_eq!( + expression_in_element_config + .brackets() + .map(|e| e.1) + .collect::>(), + &[true, true] + ); + buffer }); } From 54157eb99aeaa4e4962d96bc73837d4a9ae3986e Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Thu, 9 Nov 2023 14:41:26 -0500 Subject: [PATCH 30/76] Finish passing Syntax from VSCode themes to Zed Themes Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com> --- Cargo.lock | 1 + assets/themes/src/vscode/noctis/family.json | 118 ++--- crates/theme2/src/registry.rs | 35 +- crates/theme2/src/themes/andromeda.rs | 59 ++- crates/theme2/src/themes/ayu.rs | 131 ++++- crates/theme2/src/themes/dracula.rs | 49 +- crates/theme2/src/themes/gruvbox.rs | 293 ++++++++++- crates/theme2/src/themes/mod.rs | 6 +- crates/theme2/src/themes/night_owl.rs | 97 +++- .../src/themes/{notctis.rs => noctis.rs} | 460 ++++++++++++++++-- crates/theme2/src/themes/nord.rs | 58 ++- crates/theme2/src/themes/palenight.rs | 134 ++++- crates/theme2/src/themes/rose_pine.rs | 134 ++++- crates/theme2/src/themes/solarized.rs | 113 ++++- crates/theme2/src/themes/synthwave_84.rs | 40 +- crates/theme2/src/user_theme.rs | 22 +- crates/theme_importer/Cargo.toml | 1 + crates/theme_importer/src/main.rs | 3 +- crates/theme_importer/src/vscode/converter.rs | 128 ++++- crates/theme_importer/src/vscode/syntax.rs | 379 ++++++--------- 20 files changed, 1794 insertions(+), 467 deletions(-) rename crates/theme2/src/themes/{notctis.rs => noctis.rs} (71%) diff --git a/Cargo.lock b/Cargo.lock index ba76a5db4af8e07d7e0f6fdb4ea7b9bcd3da7bd3..863fb32d426f7a23fadf110ec971518dc7cd7602 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9139,6 +9139,7 @@ dependencies = [ "rust-embed", "serde", "simplelog", + "strum", "theme2", "uuid 1.4.1", ] diff --git a/assets/themes/src/vscode/noctis/family.json b/assets/themes/src/vscode/noctis/family.json index 26aba7e21357fb566a46f5d3f4ed8d59ba1226a7..525cb160f52e48ba839e6d1d51b81b50abad40cb 100644 --- a/assets/themes/src/vscode/noctis/family.json +++ b/assets/themes/src/vscode/noctis/family.json @@ -1,61 +1,61 @@ { - "name": "Notctis", - "author": "Liviu Schera (liviuschera)", - "themes": [ - { - "name": "Noctis Azureus", - "file_name": "azureus.json", - "appearance": "dark" - }, - { - "name": "Noctis Bordo", - "file_name": "bordo.json", - "appearance": "dark" - }, - { - "name": "Noctus Hibernus", - "file_name": "hibernus.json", - "appearance": "light" - }, - { - "name": "Noctis Lilac", - "file_name": "lilac.json", - "appearance": "dark" - }, - { - "name": "Noctis Lux", - "file_name": "lux.json", - "appearance": "light" - }, - { - "name": "Noctis Minimus", - "file_name": "minimus.json", - "appearance": "dark" - }, - { - "name": "Noctis", - "file_name": "noctis.json", - "appearance": "dark" - }, - { - "name": "Noctis Obscuro", - "file_name": "obscuro.json", - "appearance": "dark" - }, - { - "name": "Noctis Sereno", - "file_name": "obscuro.json", - "appearance": "dark" - }, - { - "name": "Noctis Uva", - "file_name": "uva.json", - "appearance": "dark" - }, - { - "name": "Noctis Viola", - "file_name": "viola.json", - "appearance": "dark" - } - ] + "name": "Noctis", + "author": "Liviu Schera (liviuschera)", + "themes": [ + { + "name": "Noctis Azureus", + "file_name": "azureus.json", + "appearance": "dark" + }, + { + "name": "Noctis Bordo", + "file_name": "bordo.json", + "appearance": "dark" + }, + { + "name": "Noctus Hibernus", + "file_name": "hibernus.json", + "appearance": "light" + }, + { + "name": "Noctis Lilac", + "file_name": "lilac.json", + "appearance": "dark" + }, + { + "name": "Noctis Lux", + "file_name": "lux.json", + "appearance": "light" + }, + { + "name": "Noctis Minimus", + "file_name": "minimus.json", + "appearance": "dark" + }, + { + "name": "Noctis", + "file_name": "noctis.json", + "appearance": "dark" + }, + { + "name": "Noctis Obscuro", + "file_name": "obscuro.json", + "appearance": "dark" + }, + { + "name": "Noctis Sereno", + "file_name": "obscuro.json", + "appearance": "dark" + }, + { + "name": "Noctis Uva", + "file_name": "uva.json", + "appearance": "dark" + }, + { + "name": "Noctis Viola", + "file_name": "viola.json", + "appearance": "dark" + } + ] } diff --git a/crates/theme2/src/registry.rs b/crates/theme2/src/registry.rs index 49546973c8aa5bdc9e0b5bd3eb63532636904af7..8f97354ec5de7943a1ecf421f7e7cc0b0dae5e61 100644 --- a/crates/theme2/src/registry.rs +++ b/crates/theme2/src/registry.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use std::sync::Arc; use anyhow::{anyhow, Result}; -use gpui::SharedString; +use gpui::{HighlightStyle, SharedString}; use refineable::Refineable; use crate::{ @@ -39,9 +39,33 @@ impl ThemeRegistry { Appearance::Light => ThemeColors::default_light(), Appearance::Dark => ThemeColors::default_dark(), }; - theme_colors.refine(&user_theme.styles.colors); + let mut status_colors = StatusColors::default(); + status_colors.refine(&user_theme.styles.status); + + let mut syntax_colors = match user_theme.appearance { + Appearance::Light => SyntaxTheme::default_light(), + Appearance::Dark => SyntaxTheme::default_dark(), + }; + if let Some(user_syntax) = user_theme.styles.syntax { + syntax_colors.highlights = user_syntax + .highlights + .iter() + .map(|(syntax_token, highlight)| { + ( + syntax_token.clone(), + HighlightStyle { + color: highlight.color, + font_style: highlight.font_style.map(Into::into), + font_weight: highlight.font_weight.map(Into::into), + ..Default::default() + }, + ) + }) + .collect::>(); + } + Theme { id: uuid::Uuid::new_v4().to_string(), name: user_theme.name.into(), @@ -49,12 +73,9 @@ impl ThemeRegistry { styles: ThemeStyles { system: SystemColors::default(), colors: theme_colors, - status: StatusColors::default(), + status: status_colors, player: PlayerColors::default(), - syntax: match user_theme.appearance { - Appearance::Light => Arc::new(SyntaxTheme::default_light()), - Appearance::Dark => Arc::new(SyntaxTheme::default_dark()), - }, + syntax: Arc::new(syntax_colors), }, } })); diff --git a/crates/theme2/src/themes/andromeda.rs b/crates/theme2/src/themes/andromeda.rs index 5d1afae99ce82407e1e2074274bdd045817e29f4..27e09553a0022c3683c22636e267c6ad5d8c3a6c 100644 --- a/crates/theme2/src/themes/andromeda.rs +++ b/crates/theme2/src/themes/andromeda.rs @@ -3,9 +3,10 @@ use gpui::rgba; +#[allow(unused)] use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, - UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserFontStyle, UserFontWeight, + UserHighlightStyle, UserSyntaxTheme, UserTheme, UserThemeFamily, UserThemeStylesRefinement, }; pub fn andromeda() -> UserThemeFamily { @@ -61,6 +62,13 @@ pub fn andromeda() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "attribute".into(), + UserHighlightStyle { + color: Some(rgba(0xf39c11ff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -69,19 +77,33 @@ pub fn andromeda() -> UserThemeFamily { }, ), ( - "something".into(), + "function".into(), UserHighlightStyle { - color: Some(rgba(0x95e072ff).into()), + color: Some(rgba(0xffe66dff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), + UserHighlightStyle { + color: Some(rgba(0xc64dedff).into()), ..Default::default() }, ), ( - "punctuation".into(), + "string".into(), UserHighlightStyle { color: Some(rgba(0x95e072ff).into()), ..Default::default() }, ), + ( + "type".into(), + UserHighlightStyle { + color: Some(rgba(0xffe66dff).into()), + ..Default::default() + }, + ), ], }), }, @@ -134,6 +156,13 @@ pub fn andromeda() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "attribute".into(), + UserHighlightStyle { + color: Some(rgba(0xf39c11ff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -142,19 +171,33 @@ pub fn andromeda() -> UserThemeFamily { }, ), ( - "something".into(), + "function".into(), UserHighlightStyle { - color: Some(rgba(0x95e072ff).into()), + color: Some(rgba(0xffe66dff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), + UserHighlightStyle { + color: Some(rgba(0xc64dedff).into()), ..Default::default() }, ), ( - "punctuation".into(), + "string".into(), UserHighlightStyle { color: Some(rgba(0x95e072ff).into()), ..Default::default() }, ), + ( + "type".into(), + UserHighlightStyle { + color: Some(rgba(0xffe66dff).into()), + ..Default::default() + }, + ), ], }), }, diff --git a/crates/theme2/src/themes/ayu.rs b/crates/theme2/src/themes/ayu.rs index 14a8e47daf6743499298ca41a526dd95c92c98f5..f1138a2a1b3cdee887888c36f34c8d7ed81a4267 100644 --- a/crates/theme2/src/themes/ayu.rs +++ b/crates/theme2/src/themes/ayu.rs @@ -3,9 +3,10 @@ use gpui::rgba; +#[allow(unused)] use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, - UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserFontStyle, UserFontWeight, + UserHighlightStyle, UserSyntaxTheme, UserTheme, UserThemeFamily, UserThemeStylesRefinement, }; pub fn ayu() -> UserThemeFamily { @@ -65,6 +66,20 @@ pub fn ayu() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "attribute".into(), + UserHighlightStyle { + color: Some(rgba(0xf2ad48ff).into()), + ..Default::default() + }, + ), + ( + "boolean".into(), + UserHighlightStyle { + color: Some(rgba(0xa37accff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -74,16 +89,38 @@ pub fn ayu() -> UserThemeFamily { }, ), ( - "something".into(), + "constant".into(), + UserHighlightStyle { + color: Some(rgba(0x4bbf98ff).into()), + ..Default::default() + }, + ), + ( + "function".into(), + UserHighlightStyle { + color: Some(rgba(0xf2ad48ff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), UserHighlightStyle { color: Some(rgba(0xfa8d3eff).into()), ..Default::default() }, ), ( - "punctuation".into(), + "string".into(), UserHighlightStyle { - color: Some(rgba(0x787b8099).into()), + color: Some(rgba(0x86b300ff).into()), + ..Default::default() + }, + ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0x55b4d3ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -143,6 +180,20 @@ pub fn ayu() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "attribute".into(), + UserHighlightStyle { + color: Some(rgba(0xffd173ff).into()), + ..Default::default() + }, + ), + ( + "boolean".into(), + UserHighlightStyle { + color: Some(rgba(0xdfbfffff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -152,16 +203,38 @@ pub fn ayu() -> UserThemeFamily { }, ), ( - "something".into(), + "constant".into(), + UserHighlightStyle { + color: Some(rgba(0x95e6cbff).into()), + ..Default::default() + }, + ), + ( + "function".into(), + UserHighlightStyle { + color: Some(rgba(0xffd173ff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), UserHighlightStyle { color: Some(rgba(0xffad65ff).into()), ..Default::default() }, ), ( - "punctuation".into(), + "string".into(), UserHighlightStyle { - color: Some(rgba(0xb8cfe680).into()), + color: Some(rgba(0xd4fe7fff).into()), + ..Default::default() + }, + ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0x5ccfe6ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -221,6 +294,20 @@ pub fn ayu() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "attribute".into(), + UserHighlightStyle { + color: Some(rgba(0xffb353ff).into()), + ..Default::default() + }, + ), + ( + "boolean".into(), + UserHighlightStyle { + color: Some(rgba(0xd2a6ffff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -230,16 +317,38 @@ pub fn ayu() -> UserThemeFamily { }, ), ( - "something".into(), + "constant".into(), + UserHighlightStyle { + color: Some(rgba(0x95e6cbff).into()), + ..Default::default() + }, + ), + ( + "function".into(), + UserHighlightStyle { + color: Some(rgba(0xffb353ff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), UserHighlightStyle { color: Some(rgba(0xff8f3fff).into()), ..Default::default() }, ), ( - "punctuation".into(), + "string".into(), UserHighlightStyle { - color: Some(rgba(0xabb5be8c).into()), + color: Some(rgba(0xa9d94bff).into()), + ..Default::default() + }, + ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0x38b9e6ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/dracula.rs b/crates/theme2/src/themes/dracula.rs index 07342b6e6bb7888c06007638d6c7c96fc9f4fba3..f00d1bcaeec148a68e05b634eb84f462e7062e92 100644 --- a/crates/theme2/src/themes/dracula.rs +++ b/crates/theme2/src/themes/dracula.rs @@ -3,9 +3,10 @@ use gpui::rgba; +#[allow(unused)] use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, - UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserFontStyle, UserFontWeight, + UserHighlightStyle, UserSyntaxTheme, UserTheme, UserThemeFamily, UserThemeStylesRefinement, }; pub fn dracula() -> UserThemeFamily { @@ -66,6 +67,14 @@ pub fn dracula() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "attribute".into(), + UserHighlightStyle { + color: Some(rgba(0x50fa7bff).into()), + font_style: Some(UserFontStyle::Italic), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -74,19 +83,49 @@ pub fn dracula() -> UserThemeFamily { }, ), ( - "something".into(), + "emphasis".into(), UserHighlightStyle { - color: Some(rgba(0xf8f8f2ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), ( - "punctuation".into(), + "function".into(), + UserHighlightStyle { + color: Some(rgba(0x50fa7bff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), UserHighlightStyle { color: Some(rgba(0xff79c6ff).into()), ..Default::default() }, ), + ( + "string".into(), + UserHighlightStyle { + color: Some(rgba(0xf1fa8cff).into()), + ..Default::default() + }, + ), + ( + "type".into(), + UserHighlightStyle { + color: Some(rgba(0x8be9fdff).into()), + font_style: Some(UserFontStyle::Italic), + ..Default::default() + }, + ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0xbd93f9ff).into()), + font_style: Some(UserFontStyle::Italic), + ..Default::default() + }, + ), ], }), }, diff --git a/crates/theme2/src/themes/gruvbox.rs b/crates/theme2/src/themes/gruvbox.rs index 453ff7b42ae0d8155fc3688b39c0bb119b3522ad..a9720f8384ac0cd388c0e5890ab55be6cb813028 100644 --- a/crates/theme2/src/themes/gruvbox.rs +++ b/crates/theme2/src/themes/gruvbox.rs @@ -3,9 +3,10 @@ use gpui::rgba; +#[allow(unused)] use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, - UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserFontStyle, UserFontWeight, + UserHighlightStyle, UserSyntaxTheme, UserTheme, UserThemeFamily, UserThemeStylesRefinement, }; pub fn gruvbox() -> UserThemeFamily { @@ -64,6 +65,13 @@ pub fn gruvbox() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "attribute".into(), + UserHighlightStyle { + color: Some(rgba(0xfabd2eff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -73,16 +81,51 @@ pub fn gruvbox() -> UserThemeFamily { }, ), ( - "something".into(), + "emphasis".into(), + UserHighlightStyle { + font_style: Some(UserFontStyle::Italic), + ..Default::default() + }, + ), + ( + "function".into(), + UserHighlightStyle { + color: Some(rgba(0xfabd2eff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xfb4833ff).into()), ..Default::default() }, ), ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), + ..Default::default() + }, + ), + ( + "string".into(), + UserHighlightStyle { + color: Some(rgba(0xb8bb25ff).into()), + ..Default::default() + }, + ), + ( + "string.escape".into(), + UserHighlightStyle { + color: Some(rgba(0xfb4833ff).into()), + ..Default::default() + }, + ), + ( + "type".into(), + UserHighlightStyle { + color: Some(rgba(0xfabd2eff).into()), ..Default::default() }, ), @@ -141,6 +184,13 @@ pub fn gruvbox() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "attribute".into(), + UserHighlightStyle { + color: Some(rgba(0xfabd2eff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -150,16 +200,51 @@ pub fn gruvbox() -> UserThemeFamily { }, ), ( - "something".into(), + "emphasis".into(), + UserHighlightStyle { + font_style: Some(UserFontStyle::Italic), + ..Default::default() + }, + ), + ( + "function".into(), + UserHighlightStyle { + color: Some(rgba(0xfabd2eff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xfb4833ff).into()), ..Default::default() }, ), ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), + ..Default::default() + }, + ), + ( + "string".into(), + UserHighlightStyle { + color: Some(rgba(0xb8bb25ff).into()), + ..Default::default() + }, + ), + ( + "string.escape".into(), + UserHighlightStyle { + color: Some(rgba(0xfb4833ff).into()), + ..Default::default() + }, + ), + ( + "type".into(), + UserHighlightStyle { + color: Some(rgba(0xfabd2eff).into()), ..Default::default() }, ), @@ -218,6 +303,13 @@ pub fn gruvbox() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "attribute".into(), + UserHighlightStyle { + color: Some(rgba(0xfabd2eff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -227,16 +319,51 @@ pub fn gruvbox() -> UserThemeFamily { }, ), ( - "something".into(), + "emphasis".into(), + UserHighlightStyle { + font_style: Some(UserFontStyle::Italic), + ..Default::default() + }, + ), + ( + "function".into(), + UserHighlightStyle { + color: Some(rgba(0xfabd2eff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xfb4833ff).into()), ..Default::default() }, ), ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), + ..Default::default() + }, + ), + ( + "string".into(), + UserHighlightStyle { + color: Some(rgba(0xb8bb25ff).into()), + ..Default::default() + }, + ), + ( + "string.escape".into(), + UserHighlightStyle { + color: Some(rgba(0xfb4833ff).into()), + ..Default::default() + }, + ), + ( + "type".into(), + UserHighlightStyle { + color: Some(rgba(0xfabd2eff).into()), ..Default::default() }, ), @@ -295,6 +422,13 @@ pub fn gruvbox() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "attribute".into(), + UserHighlightStyle { + color: Some(rgba(0xb57613ff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -304,16 +438,51 @@ pub fn gruvbox() -> UserThemeFamily { }, ), ( - "something".into(), + "emphasis".into(), + UserHighlightStyle { + font_style: Some(UserFontStyle::Italic), + ..Default::default() + }, + ), + ( + "function".into(), + UserHighlightStyle { + color: Some(rgba(0xb57613ff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), UserHighlightStyle { - color: Some(rgba(0x066578ff).into()), + color: Some(rgba(0x9d0006ff).into()), ..Default::default() }, ), ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x066578ff).into()), + color: Some(rgba(0x7c6f64ff).into()), + ..Default::default() + }, + ), + ( + "string".into(), + UserHighlightStyle { + color: Some(rgba(0x79740eff).into()), + ..Default::default() + }, + ), + ( + "string.escape".into(), + UserHighlightStyle { + color: Some(rgba(0x9d0006ff).into()), + ..Default::default() + }, + ), + ( + "type".into(), + UserHighlightStyle { + color: Some(rgba(0xb57613ff).into()), ..Default::default() }, ), @@ -372,6 +541,13 @@ pub fn gruvbox() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "attribute".into(), + UserHighlightStyle { + color: Some(rgba(0xb57613ff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -381,16 +557,51 @@ pub fn gruvbox() -> UserThemeFamily { }, ), ( - "something".into(), + "emphasis".into(), + UserHighlightStyle { + font_style: Some(UserFontStyle::Italic), + ..Default::default() + }, + ), + ( + "function".into(), + UserHighlightStyle { + color: Some(rgba(0xb57613ff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), UserHighlightStyle { - color: Some(rgba(0x066578ff).into()), + color: Some(rgba(0x9d0006ff).into()), ..Default::default() }, ), ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x066578ff).into()), + color: Some(rgba(0x7c6f64ff).into()), + ..Default::default() + }, + ), + ( + "string".into(), + UserHighlightStyle { + color: Some(rgba(0x79740eff).into()), + ..Default::default() + }, + ), + ( + "string.escape".into(), + UserHighlightStyle { + color: Some(rgba(0x9d0006ff).into()), + ..Default::default() + }, + ), + ( + "type".into(), + UserHighlightStyle { + color: Some(rgba(0xb57613ff).into()), ..Default::default() }, ), @@ -449,6 +660,13 @@ pub fn gruvbox() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "attribute".into(), + UserHighlightStyle { + color: Some(rgba(0xb57613ff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -458,16 +676,51 @@ pub fn gruvbox() -> UserThemeFamily { }, ), ( - "something".into(), + "emphasis".into(), + UserHighlightStyle { + font_style: Some(UserFontStyle::Italic), + ..Default::default() + }, + ), + ( + "function".into(), + UserHighlightStyle { + color: Some(rgba(0xb57613ff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), UserHighlightStyle { - color: Some(rgba(0x066578ff).into()), + color: Some(rgba(0x9d0006ff).into()), ..Default::default() }, ), ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x066578ff).into()), + color: Some(rgba(0x7c6f64ff).into()), + ..Default::default() + }, + ), + ( + "string".into(), + UserHighlightStyle { + color: Some(rgba(0x79740eff).into()), + ..Default::default() + }, + ), + ( + "string.escape".into(), + UserHighlightStyle { + color: Some(rgba(0x9d0006ff).into()), + ..Default::default() + }, + ), + ( + "type".into(), + UserHighlightStyle { + color: Some(rgba(0xb57613ff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/mod.rs b/crates/theme2/src/themes/mod.rs index c48338b184ac8678f8af3f13a274757435cdbca9..4059d3751ea9178f76e703225f322a0beba33b5c 100644 --- a/crates/theme2/src/themes/mod.rs +++ b/crates/theme2/src/themes/mod.rs @@ -6,8 +6,8 @@ mod ayu; mod dracula; mod gruvbox; mod night_owl; +mod noctis; mod nord; -mod notctis; mod palenight; mod rose_pine; mod solarized; @@ -18,8 +18,8 @@ pub use ayu::*; pub use dracula::*; pub use gruvbox::*; pub use night_owl::*; +pub use noctis::*; pub use nord::*; -pub use notctis::*; pub use palenight::*; pub use rose_pine::*; pub use solarized::*; @@ -37,7 +37,7 @@ pub(crate) fn all_user_themes() -> Vec { dracula(), solarized(), nord(), - notctis(), + noctis(), ayu(), gruvbox(), ] diff --git a/crates/theme2/src/themes/night_owl.rs b/crates/theme2/src/themes/night_owl.rs index acebba8bfe73068efec084babc6098dbe2142898..fe7a478ab22d8273829ab4108cc10c20d278bea1 100644 --- a/crates/theme2/src/themes/night_owl.rs +++ b/crates/theme2/src/themes/night_owl.rs @@ -3,9 +3,10 @@ use gpui::rgba; +#[allow(unused)] use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, - UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserFontStyle, UserFontWeight, + UserHighlightStyle, UserSyntaxTheme, UserTheme, UserThemeFamily, UserThemeStylesRefinement, }; pub fn night_owl() -> UserThemeFamily { @@ -65,6 +66,21 @@ pub fn night_owl() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "attribute".into(), + UserHighlightStyle { + color: Some(rgba(0xc5e478ff).into()), + font_style: Some(UserFontStyle::Italic), + ..Default::default() + }, + ), + ( + "boolean".into(), + UserHighlightStyle { + color: Some(rgba(0x82aaffff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -74,16 +90,39 @@ pub fn night_owl() -> UserThemeFamily { }, ), ( - "something".into(), + "constant".into(), UserHighlightStyle { - color: Some(rgba(0x7fcac3ff).into()), + color: Some(rgba(0x82aaffff).into()), ..Default::default() }, ), ( - "punctuation".into(), + "function".into(), UserHighlightStyle { - color: Some(rgba(0xd3413dff).into()), + color: Some(rgba(0xc792eaff).into()), + font_style: Some(UserFontStyle::Italic), + ..Default::default() + }, + ), + ( + "keyword".into(), + UserHighlightStyle { + color: Some(rgba(0xc792eaff).into()), + font_style: Some(UserFontStyle::Italic), + ..Default::default() + }, + ), + ( + "string".into(), + UserHighlightStyle { + color: Some(rgba(0xecc48dff).into()), + ..Default::default() + }, + ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0x7fdbcaff).into()), ..Default::default() }, ), @@ -144,6 +183,21 @@ pub fn night_owl() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "attribute".into(), + UserHighlightStyle { + color: Some(rgba(0x4876d6ff).into()), + font_style: Some(UserFontStyle::Italic), + ..Default::default() + }, + ), + ( + "boolean".into(), + UserHighlightStyle { + color: Some(rgba(0x4876d6ff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -153,16 +207,39 @@ pub fn night_owl() -> UserThemeFamily { }, ), ( - "something".into(), + "constant".into(), UserHighlightStyle { - color: Some(rgba(0x0b969bff).into()), + color: Some(rgba(0x4876d6ff).into()), ..Default::default() }, ), ( - "punctuation".into(), + "function".into(), UserHighlightStyle { - color: Some(rgba(0xd3413dff).into()), + color: Some(rgba(0x994bc3ff).into()), + font_style: Some(UserFontStyle::Italic), + ..Default::default() + }, + ), + ( + "keyword".into(), + UserHighlightStyle { + color: Some(rgba(0x994bc3ff).into()), + font_style: Some(UserFontStyle::Italic), + ..Default::default() + }, + ), + ( + "string".into(), + UserHighlightStyle { + color: Some(rgba(0x4876d6ff).into()), + ..Default::default() + }, + ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0x0b969bff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/notctis.rs b/crates/theme2/src/themes/noctis.rs similarity index 71% rename from crates/theme2/src/themes/notctis.rs rename to crates/theme2/src/themes/noctis.rs index ec4ca8527ee31b4d030bc3c8e748e1ea5ffae1ee..bcedb121c7cf01efac1bf0fa92a9ede38e7c8724 100644 --- a/crates/theme2/src/themes/notctis.rs +++ b/crates/theme2/src/themes/noctis.rs @@ -3,14 +3,15 @@ use gpui::rgba; +#[allow(unused)] use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, - UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserFontStyle, UserFontWeight, + UserHighlightStyle, UserSyntaxTheme, UserTheme, UserThemeFamily, UserThemeStylesRefinement, }; -pub fn notctis() -> UserThemeFamily { +pub fn noctis() -> UserThemeFamily { UserThemeFamily { - name: "Notctis".into(), + name: "Noctis".into(), author: "Liviu Schera (liviuschera)".into(), themes: vec![ UserTheme { @@ -67,6 +68,13 @@ pub fn notctis() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "boolean".into(), + UserHighlightStyle { + color: Some(rgba(0x705febff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -75,19 +83,47 @@ pub fn notctis() -> UserThemeFamily { }, ), ( - "punctuation".into(), + "constant".into(), + UserHighlightStyle { + color: Some(rgba(0xbecfdaff).into()), + ..Default::default() + }, + ), + ( + "constructor".into(), UserHighlightStyle { - color: Some(rgba(0x49ace9ff).into()), + font_weight: Some(UserFontWeight(700.0)), ..Default::default() }, ), ( - "something".into(), + "function".into(), + UserHighlightStyle { + color: Some(rgba(0x15a2b6ff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), + UserHighlightStyle { + color: Some(rgba(0xdf759aff).into()), + ..Default::default() + }, + ), + ( + "string".into(), UserHighlightStyle { color: Some(rgba(0x49e9a6ff).into()), ..Default::default() }, ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0xe66432ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -146,6 +182,13 @@ pub fn notctis() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "boolean".into(), + UserHighlightStyle { + color: Some(rgba(0x705febff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -154,19 +197,47 @@ pub fn notctis() -> UserThemeFamily { }, ), ( - "punctuation".into(), + "constant".into(), + UserHighlightStyle { + color: Some(rgba(0xcbbec2ff).into()), + ..Default::default() + }, + ), + ( + "constructor".into(), UserHighlightStyle { - color: Some(rgba(0x49ace9ff).into()), + font_weight: Some(UserFontWeight(700.0)), ..Default::default() }, ), ( - "something".into(), + "function".into(), + UserHighlightStyle { + color: Some(rgba(0x15a2b6ff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), + UserHighlightStyle { + color: Some(rgba(0xdf759aff).into()), + ..Default::default() + }, + ), + ( + "string".into(), UserHighlightStyle { color: Some(rgba(0x49e9a6ff).into()), ..Default::default() }, ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0xe66432ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -225,6 +296,13 @@ pub fn notctis() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "boolean".into(), + UserHighlightStyle { + color: Some(rgba(0x5841ffff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -233,19 +311,47 @@ pub fn notctis() -> UserThemeFamily { }, ), ( - "punctuation".into(), + "constant".into(), + UserHighlightStyle { + color: Some(rgba(0x004d57ff).into()), + ..Default::default() + }, + ), + ( + "constructor".into(), + UserHighlightStyle { + font_weight: Some(UserFontWeight(700.0)), + ..Default::default() + }, + ), + ( + "function".into(), + UserHighlightStyle { + color: Some(rgba(0x0094a8ff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), UserHighlightStyle { - color: Some(rgba(0x0094f0ff).into()), + color: Some(rgba(0xff5792ff).into()), ..Default::default() }, ), ( - "something".into(), + "string".into(), UserHighlightStyle { color: Some(rgba(0x00b368ff).into()), ..Default::default() }, ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0xe64100ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -304,6 +410,13 @@ pub fn notctis() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "boolean".into(), + UserHighlightStyle { + color: Some(rgba(0x5841ffff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -312,19 +425,47 @@ pub fn notctis() -> UserThemeFamily { }, ), ( - "punctuation".into(), + "constant".into(), UserHighlightStyle { - color: Some(rgba(0x0094f0ff).into()), + color: Some(rgba(0x0c006bff).into()), ..Default::default() }, ), ( - "something".into(), + "constructor".into(), + UserHighlightStyle { + font_weight: Some(UserFontWeight(700.0)), + ..Default::default() + }, + ), + ( + "function".into(), + UserHighlightStyle { + color: Some(rgba(0x0094a8ff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), + UserHighlightStyle { + color: Some(rgba(0xff5792ff).into()), + ..Default::default() + }, + ), + ( + "string".into(), UserHighlightStyle { color: Some(rgba(0x00b368ff).into()), ..Default::default() }, ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0xe64100ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -383,6 +524,13 @@ pub fn notctis() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "boolean".into(), + UserHighlightStyle { + color: Some(rgba(0x5841ffff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -391,19 +539,47 @@ pub fn notctis() -> UserThemeFamily { }, ), ( - "punctuation".into(), + "constant".into(), UserHighlightStyle { - color: Some(rgba(0x0094f0ff).into()), + color: Some(rgba(0x004d57ff).into()), ..Default::default() }, ), ( - "something".into(), + "constructor".into(), + UserHighlightStyle { + font_weight: Some(UserFontWeight(700.0)), + ..Default::default() + }, + ), + ( + "function".into(), + UserHighlightStyle { + color: Some(rgba(0x0094a8ff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), + UserHighlightStyle { + color: Some(rgba(0xff5792ff).into()), + ..Default::default() + }, + ), + ( + "string".into(), UserHighlightStyle { color: Some(rgba(0x00b368ff).into()), ..Default::default() }, ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0xe64100ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -462,6 +638,13 @@ pub fn notctis() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "boolean".into(), + UserHighlightStyle { + color: Some(rgba(0x7067b1ff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -470,19 +653,47 @@ pub fn notctis() -> UserThemeFamily { }, ), ( - "punctuation".into(), + "constant".into(), UserHighlightStyle { - color: Some(rgba(0x5897bfff).into()), + color: Some(rgba(0xc5cdd3ff).into()), ..Default::default() }, ), ( - "something".into(), + "constructor".into(), + UserHighlightStyle { + font_weight: Some(UserFontWeight(700.0)), + ..Default::default() + }, + ), + ( + "function".into(), + UserHighlightStyle { + color: Some(rgba(0x3e848dff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), + UserHighlightStyle { + color: Some(rgba(0xc88da2ff).into()), + ..Default::default() + }, + ), + ( + "string".into(), UserHighlightStyle { color: Some(rgba(0x72c09fff).into()), ..Default::default() }, ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0xc37455ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -541,6 +752,13 @@ pub fn notctis() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "boolean".into(), + UserHighlightStyle { + color: Some(rgba(0x705febff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -549,19 +767,47 @@ pub fn notctis() -> UserThemeFamily { }, ), ( - "punctuation".into(), + "constant".into(), UserHighlightStyle { - color: Some(rgba(0x49ace9ff).into()), + color: Some(rgba(0xb1c9ccff).into()), ..Default::default() }, ), ( - "something".into(), + "constructor".into(), + UserHighlightStyle { + font_weight: Some(UserFontWeight(700.0)), + ..Default::default() + }, + ), + ( + "function".into(), + UserHighlightStyle { + color: Some(rgba(0x15a2b6ff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), + UserHighlightStyle { + color: Some(rgba(0xdf759aff).into()), + ..Default::default() + }, + ), + ( + "string".into(), UserHighlightStyle { color: Some(rgba(0x49e9a6ff).into()), ..Default::default() }, ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0xe66432ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -620,6 +866,13 @@ pub fn notctis() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "boolean".into(), + UserHighlightStyle { + color: Some(rgba(0x705febff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -628,19 +881,47 @@ pub fn notctis() -> UserThemeFamily { }, ), ( - "punctuation".into(), + "constant".into(), + UserHighlightStyle { + color: Some(rgba(0xb1c9ccff).into()), + ..Default::default() + }, + ), + ( + "constructor".into(), + UserHighlightStyle { + font_weight: Some(UserFontWeight(700.0)), + ..Default::default() + }, + ), + ( + "function".into(), UserHighlightStyle { - color: Some(rgba(0x49ace9ff).into()), + color: Some(rgba(0x15a2b6ff).into()), ..Default::default() }, ), ( - "something".into(), + "keyword".into(), + UserHighlightStyle { + color: Some(rgba(0xdf759aff).into()), + ..Default::default() + }, + ), + ( + "string".into(), UserHighlightStyle { color: Some(rgba(0x49e9a6ff).into()), ..Default::default() }, ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0xe66432ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -699,6 +980,13 @@ pub fn notctis() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "boolean".into(), + UserHighlightStyle { + color: Some(rgba(0x705febff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -707,19 +995,47 @@ pub fn notctis() -> UserThemeFamily { }, ), ( - "punctuation".into(), + "constant".into(), UserHighlightStyle { - color: Some(rgba(0x49ace9ff).into()), + color: Some(rgba(0xb1c9ccff).into()), ..Default::default() }, ), ( - "something".into(), + "constructor".into(), + UserHighlightStyle { + font_weight: Some(UserFontWeight(700.0)), + ..Default::default() + }, + ), + ( + "function".into(), + UserHighlightStyle { + color: Some(rgba(0x15a2b6ff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), + UserHighlightStyle { + color: Some(rgba(0xdf759aff).into()), + ..Default::default() + }, + ), + ( + "string".into(), UserHighlightStyle { color: Some(rgba(0x49e9a6ff).into()), ..Default::default() }, ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0xe66432ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -778,6 +1094,13 @@ pub fn notctis() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "boolean".into(), + UserHighlightStyle { + color: Some(rgba(0x705febff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -786,19 +1109,47 @@ pub fn notctis() -> UserThemeFamily { }, ), ( - "punctuation".into(), + "constant".into(), + UserHighlightStyle { + color: Some(rgba(0xc5c2d6ff).into()), + ..Default::default() + }, + ), + ( + "constructor".into(), + UserHighlightStyle { + font_weight: Some(UserFontWeight(700.0)), + ..Default::default() + }, + ), + ( + "function".into(), + UserHighlightStyle { + color: Some(rgba(0x15a2b6ff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), UserHighlightStyle { - color: Some(rgba(0x49ace9ff).into()), + color: Some(rgba(0xdf759aff).into()), ..Default::default() }, ), ( - "something".into(), + "string".into(), UserHighlightStyle { color: Some(rgba(0x49e9a6ff).into()), ..Default::default() }, ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0xe66432ff).into()), + ..Default::default() + }, + ), ], }), }, @@ -857,6 +1208,13 @@ pub fn notctis() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "boolean".into(), + UserHighlightStyle { + color: Some(rgba(0x705febff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -865,19 +1223,47 @@ pub fn notctis() -> UserThemeFamily { }, ), ( - "punctuation".into(), + "constant".into(), + UserHighlightStyle { + color: Some(rgba(0xccbfd9ff).into()), + ..Default::default() + }, + ), + ( + "constructor".into(), UserHighlightStyle { - color: Some(rgba(0x49ace9ff).into()), + font_weight: Some(UserFontWeight(700.0)), ..Default::default() }, ), ( - "something".into(), + "function".into(), + UserHighlightStyle { + color: Some(rgba(0x15a2b6ff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), + UserHighlightStyle { + color: Some(rgba(0xdf759aff).into()), + ..Default::default() + }, + ), + ( + "string".into(), UserHighlightStyle { color: Some(rgba(0x49e9a6ff).into()), ..Default::default() }, ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0xe66432ff).into()), + ..Default::default() + }, + ), ], }), }, diff --git a/crates/theme2/src/themes/nord.rs b/crates/theme2/src/themes/nord.rs index 4069fb3063f4cb0797a24a1b3a8d8a435e3c2164..423725a45741b4a9f5746d1f6b19b34a3e1ff2ed 100644 --- a/crates/theme2/src/themes/nord.rs +++ b/crates/theme2/src/themes/nord.rs @@ -3,9 +3,10 @@ use gpui::rgba; +#[allow(unused)] use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, - UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserFontStyle, UserFontWeight, + UserHighlightStyle, UserSyntaxTheme, UserTheme, UserThemeFamily, UserThemeStylesRefinement, }; pub fn nord() -> UserThemeFamily { @@ -66,6 +67,20 @@ pub fn nord() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "attribute".into(), + UserHighlightStyle { + color: Some(rgba(0x8fbcbbff).into()), + ..Default::default() + }, + ), + ( + "boolean".into(), + UserHighlightStyle { + color: Some(rgba(0x81a1c1ff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -74,19 +89,54 @@ pub fn nord() -> UserThemeFamily { }, ), ( - "punctuation".into(), + "constant".into(), + UserHighlightStyle { + color: Some(rgba(0xebcb8bff).into()), + ..Default::default() + }, + ), + ( + "emphasis".into(), + UserHighlightStyle { + font_style: Some(UserFontStyle::Italic), + ..Default::default() + }, + ), + ( + "function".into(), + UserHighlightStyle { + color: Some(rgba(0x88bfd0ff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), UserHighlightStyle { color: Some(rgba(0x81a1c1ff).into()), ..Default::default() }, ), ( - "something".into(), + "punctuation".into(), + UserHighlightStyle { + color: Some(rgba(0xeceff4ff).into()), + ..Default::default() + }, + ), + ( + "string".into(), UserHighlightStyle { color: Some(rgba(0xa3be8cff).into()), ..Default::default() }, ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0x81a1c1ff).into()), + ..Default::default() + }, + ), ], }), }, diff --git a/crates/theme2/src/themes/palenight.rs b/crates/theme2/src/themes/palenight.rs index 1266828ac01038278581f721c54c75c10618518b..8f641dce0a19e2a121078d5ee3be770e5078808b 100644 --- a/crates/theme2/src/themes/palenight.rs +++ b/crates/theme2/src/themes/palenight.rs @@ -3,9 +3,10 @@ use gpui::rgba; +#[allow(unused)] use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, - UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserFontStyle, UserFontWeight, + UserHighlightStyle, UserSyntaxTheme, UserTheme, UserThemeFamily, UserThemeStylesRefinement, }; pub fn palenight() -> UserThemeFamily { @@ -65,6 +66,20 @@ pub fn palenight() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "attribute".into(), + UserHighlightStyle { + color: Some(rgba(0xffcb6bff).into()), + ..Default::default() + }, + ), + ( + "boolean".into(), + UserHighlightStyle { + color: Some(rgba(0x82aaffff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -74,16 +89,37 @@ pub fn palenight() -> UserThemeFamily { }, ), ( - "something".into(), + "constant".into(), + UserHighlightStyle { + color: Some(rgba(0x82aaffff).into()), + ..Default::default() + }, + ), + ( + "function".into(), + UserHighlightStyle { + color: Some(rgba(0x82aaffff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), + UserHighlightStyle { + color: Some(rgba(0xc792eaff).into()), + ..Default::default() + }, + ), + ( + "string".into(), UserHighlightStyle { - color: Some(rgba(0x7fcac3ff).into()), + color: Some(rgba(0xc3e88dff).into()), ..Default::default() }, ), ( - "punctuation".into(), + "variable".into(), UserHighlightStyle { - color: Some(rgba(0xd3413dff).into()), + color: Some(rgba(0xff5571ff).into()), ..Default::default() }, ), @@ -143,6 +179,20 @@ pub fn palenight() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "attribute".into(), + UserHighlightStyle { + color: Some(rgba(0xffcb6bff).into()), + ..Default::default() + }, + ), + ( + "boolean".into(), + UserHighlightStyle { + color: Some(rgba(0x82aaffff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -152,16 +202,37 @@ pub fn palenight() -> UserThemeFamily { }, ), ( - "something".into(), + "constant".into(), UserHighlightStyle { - color: Some(rgba(0x7fcac3ff).into()), + color: Some(rgba(0x82aaffff).into()), ..Default::default() }, ), ( - "punctuation".into(), + "function".into(), UserHighlightStyle { - color: Some(rgba(0xd3413dff).into()), + color: Some(rgba(0x82aaffff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), + UserHighlightStyle { + color: Some(rgba(0xc792eaff).into()), + ..Default::default() + }, + ), + ( + "string".into(), + UserHighlightStyle { + color: Some(rgba(0xc3e88dff).into()), + ..Default::default() + }, + ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0xff5571ff).into()), ..Default::default() }, ), @@ -221,6 +292,20 @@ pub fn palenight() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "attribute".into(), + UserHighlightStyle { + color: Some(rgba(0xffcb6bff).into()), + ..Default::default() + }, + ), + ( + "boolean".into(), + UserHighlightStyle { + color: Some(rgba(0x82aaffff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -230,16 +315,37 @@ pub fn palenight() -> UserThemeFamily { }, ), ( - "something".into(), + "constant".into(), + UserHighlightStyle { + color: Some(rgba(0x82aaffff).into()), + ..Default::default() + }, + ), + ( + "function".into(), + UserHighlightStyle { + color: Some(rgba(0x82aaffff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), + UserHighlightStyle { + color: Some(rgba(0xc792eaff).into()), + ..Default::default() + }, + ), + ( + "string".into(), UserHighlightStyle { - color: Some(rgba(0x7fcac3ff).into()), + color: Some(rgba(0xc3e88dff).into()), ..Default::default() }, ), ( - "punctuation".into(), + "variable".into(), UserHighlightStyle { - color: Some(rgba(0xd3413dff).into()), + color: Some(rgba(0xff5571ff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/rose_pine.rs b/crates/theme2/src/themes/rose_pine.rs index 475c023b017a0a95ca8ddce09af4ea55583143e8..275fe575bd4398f8916cc14cea8db68a66fada70 100644 --- a/crates/theme2/src/themes/rose_pine.rs +++ b/crates/theme2/src/themes/rose_pine.rs @@ -3,9 +3,10 @@ use gpui::rgba; +#[allow(unused)] use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, - UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserFontStyle, UserFontWeight, + UserHighlightStyle, UserSyntaxTheme, UserTheme, UserThemeFamily, UserThemeStylesRefinement, }; pub fn rose_pine() -> UserThemeFamily { @@ -67,25 +68,60 @@ pub fn rose_pine() -> UserThemeFamily { syntax: Some(UserSyntaxTheme { highlights: vec![ ( - "comment".into(), + "attribute".into(), UserHighlightStyle { - color: Some(rgba(0x6e6a86ff).into()), + color: Some(rgba(0xc4a7e7ff).into()), font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), ( - "something".into(), + "boolean".into(), UserHighlightStyle { color: Some(rgba(0xebbcbaff).into()), + ..Default::default() + }, + ), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x6e6a86ff).into()), font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), + ( + "keyword".into(), + UserHighlightStyle { + color: Some(rgba(0x30738fff).into()), + ..Default::default() + }, + ), ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x6e6a86ff).into()), + color: Some(rgba(0x908caaff).into()), + ..Default::default() + }, + ), + ( + "string".into(), + UserHighlightStyle { + color: Some(rgba(0xf5c177ff).into()), + ..Default::default() + }, + ), + ( + "type".into(), + UserHighlightStyle { + color: Some(rgba(0x9ccfd8ff).into()), + ..Default::default() + }, + ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0xe0def4ff).into()), ..Default::default() }, ), @@ -147,25 +183,60 @@ pub fn rose_pine() -> UserThemeFamily { syntax: Some(UserSyntaxTheme { highlights: vec![ ( - "comment".into(), + "attribute".into(), UserHighlightStyle { - color: Some(rgba(0x6e6a86ff).into()), + color: Some(rgba(0xc4a7e7ff).into()), font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), ( - "something".into(), + "boolean".into(), UserHighlightStyle { color: Some(rgba(0xea9a97ff).into()), + ..Default::default() + }, + ), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x6e6a86ff).into()), font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), + ( + "keyword".into(), + UserHighlightStyle { + color: Some(rgba(0x3d8fb0ff).into()), + ..Default::default() + }, + ), ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x6e6a86ff).into()), + color: Some(rgba(0x908caaff).into()), + ..Default::default() + }, + ), + ( + "string".into(), + UserHighlightStyle { + color: Some(rgba(0xf5c177ff).into()), + ..Default::default() + }, + ), + ( + "type".into(), + UserHighlightStyle { + color: Some(rgba(0x9ccfd8ff).into()), + ..Default::default() + }, + ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0xe0def4ff).into()), ..Default::default() }, ), @@ -227,25 +298,60 @@ pub fn rose_pine() -> UserThemeFamily { syntax: Some(UserSyntaxTheme { highlights: vec![ ( - "comment".into(), + "attribute".into(), UserHighlightStyle { - color: Some(rgba(0x9893a5ff).into()), + color: Some(rgba(0x9079a9ff).into()), font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), ( - "something".into(), + "boolean".into(), UserHighlightStyle { color: Some(rgba(0xd7827dff).into()), + ..Default::default() + }, + ), + ( + "comment".into(), + UserHighlightStyle { + color: Some(rgba(0x9893a5ff).into()), font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), + ( + "keyword".into(), + UserHighlightStyle { + color: Some(rgba(0x276983ff).into()), + ..Default::default() + }, + ), ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x9893a5ff).into()), + color: Some(rgba(0x797593ff).into()), + ..Default::default() + }, + ), + ( + "string".into(), + UserHighlightStyle { + color: Some(rgba(0xea9d34ff).into()), + ..Default::default() + }, + ), + ( + "type".into(), + UserHighlightStyle { + color: Some(rgba(0x55949fff).into()), + ..Default::default() + }, + ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0x575279ff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/solarized.rs b/crates/theme2/src/themes/solarized.rs index ebacffaaa24763a9b15a92cad1df2a742f7a98d7..ad986fde5c2b628f3f838f025cdecb3cb568e4e2 100644 --- a/crates/theme2/src/themes/solarized.rs +++ b/crates/theme2/src/themes/solarized.rs @@ -3,9 +3,10 @@ use gpui::rgba; +#[allow(unused)] use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, - UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserFontStyle, UserFontWeight, + UserHighlightStyle, UserSyntaxTheme, UserTheme, UserThemeFamily, UserThemeStylesRefinement, }; pub fn solarized() -> UserThemeFamily { @@ -61,6 +62,20 @@ pub fn solarized() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "attribute".into(), + UserHighlightStyle { + color: Some(rgba(0x93a1a1ff).into()), + ..Default::default() + }, + ), + ( + "boolean".into(), + UserHighlightStyle { + color: Some(rgba(0xb58800ff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -70,17 +85,51 @@ pub fn solarized() -> UserThemeFamily { }, ), ( - "something".into(), + "constant".into(), UserHighlightStyle { - color: Some(rgba(0x93a1a1ff).into()), - font_weight: Some(UserFontWeight(700.0)), + color: Some(rgba(0xcb4b15ff).into()), ..Default::default() }, ), ( - "punctuation".into(), + "function".into(), UserHighlightStyle { - color: Some(rgba(0x657b83ff).into()), + color: Some(rgba(0x258ad2ff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), + UserHighlightStyle { + color: Some(rgba(0x859900ff).into()), + ..Default::default() + }, + ), + ( + "property".into(), + UserHighlightStyle { + color: Some(rgba(0x839496ff).into()), + ..Default::default() + }, + ), + ( + "string".into(), + UserHighlightStyle { + color: Some(rgba(0x29a198ff).into()), + ..Default::default() + }, + ), + ( + "type".into(), + UserHighlightStyle { + color: Some(rgba(0xcb4b15ff).into()), + ..Default::default() + }, + ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0x258ad2ff).into()), ..Default::default() }, ), @@ -133,6 +182,20 @@ pub fn solarized() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "attribute".into(), + UserHighlightStyle { + color: Some(rgba(0x93a1a1ff).into()), + ..Default::default() + }, + ), + ( + "boolean".into(), + UserHighlightStyle { + color: Some(rgba(0xb58800ff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -142,16 +205,44 @@ pub fn solarized() -> UserThemeFamily { }, ), ( - "something".into(), + "constant".into(), UserHighlightStyle { - color: Some(rgba(0x657b83ff).into()), + color: Some(rgba(0xcb4b15ff).into()), ..Default::default() }, ), ( - "punctuation".into(), + "function".into(), UserHighlightStyle { - color: Some(rgba(0x93a1a1ff).into()), + color: Some(rgba(0x258ad2ff).into()), + ..Default::default() + }, + ), + ( + "keyword".into(), + UserHighlightStyle { + color: Some(rgba(0x859900ff).into()), + ..Default::default() + }, + ), + ( + "string".into(), + UserHighlightStyle { + color: Some(rgba(0x29a198ff).into()), + ..Default::default() + }, + ), + ( + "type".into(), + UserHighlightStyle { + color: Some(rgba(0x258ad2ff).into()), + ..Default::default() + }, + ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0x258ad2ff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/synthwave_84.rs b/crates/theme2/src/themes/synthwave_84.rs index 18c734c743ef241177ee456329054be1d6175b93..77686a18c65d8f1a4962df159516af3259c3ebe4 100644 --- a/crates/theme2/src/themes/synthwave_84.rs +++ b/crates/theme2/src/themes/synthwave_84.rs @@ -3,9 +3,10 @@ use gpui::rgba; +#[allow(unused)] use crate::{ - Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, - UserTheme, UserThemeFamily, UserThemeStylesRefinement, + Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserFontStyle, UserFontWeight, + UserHighlightStyle, UserSyntaxTheme, UserTheme, UserThemeFamily, UserThemeStylesRefinement, }; pub fn synthwave_84() -> UserThemeFamily { @@ -51,6 +52,20 @@ pub fn synthwave_84() -> UserThemeFamily { }, syntax: Some(UserSyntaxTheme { highlights: vec![ + ( + "attribute".into(), + UserHighlightStyle { + color: Some(rgba(0xfede5cff).into()), + ..Default::default() + }, + ), + ( + "boolean".into(), + UserHighlightStyle { + color: Some(rgba(0xf97d71ff).into()), + ..Default::default() + }, + ), ( "comment".into(), UserHighlightStyle { @@ -60,19 +75,34 @@ pub fn synthwave_84() -> UserThemeFamily { }, ), ( - "something".into(), + "function".into(), UserHighlightStyle { - color: Some(rgba(0xfe444fff).into()), + color: Some(rgba(0x35f9f5ff).into()), ..Default::default() }, ), ( - "punctuation".into(), + "keyword".into(), UserHighlightStyle { color: Some(rgba(0xfede5cff).into()), ..Default::default() }, ), + ( + "type".into(), + UserHighlightStyle { + color: Some(rgba(0xfe444fff).into()), + ..Default::default() + }, + ), + ( + "variable".into(), + UserHighlightStyle { + color: Some(rgba(0xfe444fff).into()), + font_weight: Some(UserFontWeight(700.0)), + ..Default::default() + }, + ), ], }), }, diff --git a/crates/theme2/src/user_theme.rs b/crates/theme2/src/user_theme.rs index a1f7d4fd7979d796260c34114b404d708f276b8c..b1f689416d87a9cc13cfc487ff284dea19cf515b 100644 --- a/crates/theme2/src/user_theme.rs +++ b/crates/theme2/src/user_theme.rs @@ -1,4 +1,4 @@ -use gpui::{FontWeight, Hsla}; +use gpui::{FontStyle, FontWeight, Hsla}; use refineable::Refineable; use serde::Deserialize; @@ -40,7 +40,7 @@ pub struct UserHighlightStyle { pub font_weight: Option, } -#[derive(Clone, Default, Deserialize)] +#[derive(Clone, Copy, Default, Deserialize)] pub struct UserFontWeight(pub f32); impl UserFontWeight { @@ -64,6 +64,12 @@ impl UserFontWeight { pub const BLACK: Self = Self(FontWeight::BLACK.0); } +impl From for FontWeight { + fn from(value: UserFontWeight) -> Self { + Self(value.0) + } +} + #[derive(Debug, Clone, Copy, Deserialize)] pub enum UserFontStyle { Normal, @@ -71,8 +77,18 @@ pub enum UserFontStyle { Oblique, } +impl From for FontStyle { + fn from(value: UserFontStyle) -> Self { + match value { + UserFontStyle::Normal => FontStyle::Normal, + UserFontStyle::Italic => FontStyle::Italic, + UserFontStyle::Oblique => FontStyle::Oblique, + } + } +} + impl UserHighlightStyle { pub fn is_empty(&self) -> bool { - self.color.is_none() + self.color.is_none() && self.font_style.is_none() && self.font_weight.is_none() } } diff --git a/crates/theme_importer/Cargo.toml b/crates/theme_importer/Cargo.toml index 28ae305735393bfb1cb3f8e3acd53a5c42a7246b..306cea8ecb7d0661269de17c09dbad63f2a559fb 100644 --- a/crates/theme_importer/Cargo.toml +++ b/crates/theme_importer/Cargo.toml @@ -15,5 +15,6 @@ log.workspace = true rust-embed.workspace = true serde.workspace = true simplelog = "0.9" +strum = { version = "0.25.0", features = ["derive"] } theme = { package = "theme2", path = "../theme2", features = ["importing-themes"] } uuid.workspace = true diff --git a/crates/theme_importer/src/main.rs b/crates/theme_importer/src/main.rs index 02ff4d834ea8a3e294c93b2e2b2fc6c9ac13940c..579b48fe1db8ea0470ee908676b0f84f841d81a8 100644 --- a/crates/theme_importer/src/main.rs +++ b/crates/theme_importer/src/main.rs @@ -158,9 +158,10 @@ fn main() -> Result<()> { use gpui::rgba; + #[allow(unused)] use crate::{{ Appearance, StatusColorsRefinement, ThemeColorsRefinement, UserHighlightStyle, UserSyntaxTheme, - UserTheme, UserThemeFamily, UserThemeStylesRefinement, + UserTheme, UserThemeFamily, UserThemeStylesRefinement, UserFontWeight, UserFontStyle }}; pub fn {theme_family_slug}() -> UserThemeFamily {{ diff --git a/crates/theme_importer/src/vscode/converter.rs b/crates/theme_importer/src/vscode/converter.rs index 6557c1b6ef6ea89ced2e53b617426cb8d1ba3f6a..39cc003094b82501cfadd8f93f3a64943387314e 100644 --- a/crates/theme_importer/src/vscode/converter.rs +++ b/crates/theme_importer/src/vscode/converter.rs @@ -1,15 +1,18 @@ use anyhow::Result; use gpui::{Hsla, Rgba}; use indexmap::IndexMap; +use strum::IntoEnumIterator; use theme::{ - StatusColorsRefinement, ThemeColorsRefinement, UserFontStyle, UserFontWeight, UserSyntaxTheme, - UserTheme, UserThemeStylesRefinement, + StatusColorsRefinement, ThemeColorsRefinement, UserFontStyle, UserFontWeight, + UserHighlightStyle, UserSyntaxTheme, UserTheme, UserThemeStylesRefinement, }; use crate::util::Traverse; use crate::vscode::VsCodeTheme; use crate::ThemeMetadata; +use super::{VsCodeTokenScope, ZedSyntaxToken}; + pub(crate) fn try_parse_color(color: &str) -> Result { Ok(Rgba::try_from(color)?.into()) } @@ -47,16 +50,7 @@ impl VsCodeThemeConverter { let status_color_refinements = self.convert_status_colors()?; let theme_colors_refinements = self.convert_theme_colors()?; - - let mut highlight_styles = IndexMap::new(); - - for token_color in self.theme.token_colors { - highlight_styles.extend(token_color.highlight_styles()?); - } - - let syntax_theme = UserSyntaxTheme { - highlights: highlight_styles.into_iter().collect(), - }; + let syntax_theme = self.convert_syntax_theme()?; Ok(UserTheme { name: self.theme_metadata.name.into(), @@ -259,4 +253,114 @@ impl VsCodeThemeConverter { ..Default::default() }) } + + fn convert_syntax_theme(&self) -> Result { + let mut highlight_styles = IndexMap::new(); + + for syntax_token in ZedSyntaxToken::iter() { + let vscode_scope = syntax_token.to_vscode(); + + let token_color = self + .theme + .token_colors + .iter() + .find(|token_color| match token_color.scope { + Some(VsCodeTokenScope::One(ref scope)) => scope == vscode_scope, + Some(VsCodeTokenScope::Many(ref scopes)) => { + scopes.contains(&vscode_scope.to_string()) + } + None => false, + }); + + let Some(token_color) = token_color else { + continue; + }; + + let highlight_style = UserHighlightStyle { + color: token_color + .settings + .foreground + .as_ref() + .traverse(|color| try_parse_color(&color))?, + font_style: token_color + .settings + .font_style + .as_ref() + .and_then(|style| try_parse_font_style(&style)), + font_weight: token_color + .settings + .font_style + .as_ref() + .and_then(|style| try_parse_font_weight(&style)), + }; + + if highlight_style.is_empty() { + continue; + } + + highlight_styles.insert(syntax_token.to_string(), highlight_style); + } + + Ok(UserSyntaxTheme { + highlights: highlight_styles.into_iter().collect(), + }) + + // let mut highlight_styles = IndexMap::new(); + + // for token_color in self.theme.token_colors { + // highlight_styles.extend(token_color.highlight_styles()?); + // } + + // let syntax_theme = UserSyntaxTheme { + // highlights: highlight_styles.into_iter().collect(), + // }; + + // pub fn highlight_styles(&self) -> Result> { + // let mut highlight_styles = IndexMap::new(); + + // for syntax_token in ZedSyntaxToken::iter() { + // let scope = syntax_token.to_scope(); + + // // let token_color = + // } + + // let scope = match self.scope { + // Some(VsCodeTokenScope::One(ref scope)) => vec![scope.clone()], + // Some(VsCodeTokenScope::Many(ref scopes)) => scopes.clone(), + // None => return Ok(IndexMap::new()), + // }; + + // for scope in &scope { + // let Some(syntax_token) = Self::to_zed_token(&scope) else { + // continue; + // }; + + // let highlight_style = UserHighlightStyle { + // color: self + // .settings + // .foreground + // .as_ref() + // .traverse(|color| try_parse_color(&color))?, + // font_style: self + // .settings + // .font_style + // .as_ref() + // .and_then(|style| try_parse_font_style(&style)), + // font_weight: self + // .settings + // .font_style + // .as_ref() + // .and_then(|style| try_parse_font_weight(&style)), + // }; + + // if highlight_style.is_empty() { + // continue; + // } + + // highlight_styles.insert(syntax_token, highlight_style); + // } + + // Ok(highlight_styles) + // } + } } diff --git a/crates/theme_importer/src/vscode/syntax.rs b/crates/theme_importer/src/vscode/syntax.rs index 1d92914df6d3d52e363f9655e1b095bd15c9ac67..4c3977af9325568e7c16da61f83a50e678fbd1b1 100644 --- a/crates/theme_importer/src/vscode/syntax.rs +++ b/crates/theme_importer/src/vscode/syntax.rs @@ -1,14 +1,5 @@ -// Create ThemeSyntaxRefinement -// Map tokenColors style to HighlightStyle (fontStyle, foreground, background) -// Take in the scopes from the tokenColors and try to match each to our HighlightStyles - -use anyhow::Result; -use indexmap::IndexMap; use serde::Deserialize; -use theme::UserHighlightStyle; - -use crate::util::Traverse; -use crate::vscode::{try_parse_color, try_parse_font_style, try_parse_font_weight}; +use strum::EnumIter; #[derive(Debug, Deserialize)] #[serde(untagged)] @@ -31,243 +22,145 @@ pub struct VsCodeTokenColorSettings { pub font_style: Option, } -impl VsCodeTokenColor { - pub fn highlight_styles(&self) -> Result> { - let mut highlight_styles = IndexMap::new(); - - let scope = match self.scope { - Some(VsCodeTokenScope::One(ref scope)) => vec![scope.clone()], - Some(VsCodeTokenScope::Many(ref scopes)) => scopes.clone(), - None => return Ok(IndexMap::new()), - }; - - for scope in &scope { - let Some(syntax_token) = Self::to_zed_token(&scope) else { - continue; - }; - - let highlight_style = UserHighlightStyle { - color: self - .settings - .foreground - .as_ref() - .traverse(|color| try_parse_color(&color))?, - font_style: self - .settings - .font_style - .as_ref() - .and_then(|style| try_parse_font_style(&style)), - font_weight: self - .settings - .font_style - .as_ref() - .and_then(|style| try_parse_font_weight(&style)), - }; +#[derive(Debug, PartialEq, Copy, Clone, EnumIter)] +pub enum ZedSyntaxToken { + SyntaxAttribute, + SyntaxBoolean, + SyntaxComment, + SyntaxCommentDoc, + SyntaxConstant, + SyntaxConstructor, + SyntaxEmbedded, + SyntaxEmphasis, + SyntaxEmphasisStrong, + SyntaxEnum, + SyntaxFunction, + SyntaxHint, + SyntaxKeyword, + SyntaxLabel, + SyntaxLinkText, + SyntaxLinkUri, + SyntaxNumber, + SyntaxOperator, + SyntaxPredictive, + SyntaxPreproc, + SyntaxPrimary, + SyntaxProperty, + SyntaxPunctuation, + SyntaxPunctuationBracket, + SyntaxPunctuationDelimiter, + SyntaxPunctuationListMarker, + SyntaxPunctuationSpecial, + SyntaxString, + SyntaxStringEscape, + SyntaxStringRegex, + SyntaxStringSpecial, + SyntaxStringSpecialSymbol, + SyntaxTag, + SyntaxTextLiteral, + SyntaxTitle, + SyntaxType, + SyntaxVariable, + SyntaxVariableSpecial, + SyntaxVariant, +} - if highlight_style.is_empty() { - continue; +impl std::fmt::Display for ZedSyntaxToken { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + use ZedSyntaxToken::*; + + write!( + f, + "{}", + match self { + SyntaxAttribute => "attribute", + SyntaxBoolean => "boolean", + SyntaxComment => "comment", + SyntaxCommentDoc => "comment.doc", + SyntaxConstant => "constant", + SyntaxConstructor => "constructor", + SyntaxEmbedded => "embedded", + SyntaxEmphasis => "emphasis", + SyntaxEmphasisStrong => "emphasis.strong", + SyntaxEnum => "enum", + SyntaxFunction => "function", + SyntaxHint => "hint", + SyntaxKeyword => "keyword", + SyntaxLabel => "label", + SyntaxLinkText => "link_text", + SyntaxLinkUri => "link_uri", + SyntaxNumber => "number", + SyntaxOperator => "operator", + SyntaxPredictive => "predictive", + SyntaxPreproc => "preproc", + SyntaxPrimary => "primary", + SyntaxProperty => "property", + SyntaxPunctuation => "punctuation", + SyntaxPunctuationBracket => "punctuation.bracket", + SyntaxPunctuationDelimiter => "punctuation.delimiter", + SyntaxPunctuationListMarker => "punctuation.list_marker", + SyntaxPunctuationSpecial => "punctuation.special", + SyntaxString => "string", + SyntaxStringEscape => "string.escape", + SyntaxStringRegex => "string.regex", + SyntaxStringSpecial => "string.special", + SyntaxStringSpecialSymbol => "string.special.symbol", + SyntaxTag => "tag", + SyntaxTextLiteral => "text.literal", + SyntaxTitle => "title", + SyntaxType => "type", + SyntaxVariable => "variable", + SyntaxVariableSpecial => "variable.special", + SyntaxVariant => "variant", } - - highlight_styles.insert(syntax_token, highlight_style); - } - - Ok(highlight_styles) + ) } +} - fn to_zed_token(scope: &str) -> Option { - match scope { - "attribute" => Some("attribute".to_string()), - "boolean" => Some("boolean".to_string()), - "comment" => Some("comment".to_string()), - "comment.doc" => Some("comment.doc".to_string()), - "punctuation" - | "punctuation.accessor" - | "punctuation.definition.array.begin.json" - | "punctuation.definition.array.end.json" - | "punctuation.definition.dictionary.begin.json" - | "punctuation.definition.dictionary.end.json" - | "punctuation.definition.markdown" - | "punctuation.definition.tag" - | "punctuation.definition.tag.begin" - | "punctuation.definition.tag.end" - | "punctuation.definition.template-expression" - | "punctuation.definition.variable" - | "punctuation.section" - | "punctuation.section.embedded" - | "punctuation.section.embedded.begin" - | "punctuation.section.embedded.end" - | "punctuation.separator" - | "punctuation.separator.array.json" - | "punctuation.separator.dictionary.key-value.json" - | "punctuation.separator.dictionary.pair.json" => Some("punctuation".to_string()), - - // --- - "constant" | "character" | "language" | "language.python" | "numeric" | "other" - | "other.symbol" => Some("something".to_string()), - - "entity" - | "name" - | "name.class" - | "name.filename.find-in-files" - | "name.function" - | "name.function.python" - | "name.import" - | "name.package" - | "name.tag" - | "name.type" - | "name.type.class.python" - | "other.attribute-name" - | "other.inherited-class" => Some("something".to_string()), - - "markup" | "bold" | "changed" | "deleted" | "heading" | "heading.setext" - | "inline.raw" | "italic" | "list" | "quote" | "raw" | "raw.inline" | "strike" - | "table" | "underline.link" => Some("something".to_string()), - - "source" => Some("something".to_string()), - "storage" => Some("something".to_string()), - "string" => Some("something".to_string()), - "support" => Some("something".to_string()), - "text" => Some("something".to_string()), - "token" => Some("something".to_string()), - "variable" => Some("something".to_string()), - _ => None, +impl ZedSyntaxToken { + pub fn to_vscode(&self) -> &'static str { + use ZedSyntaxToken::*; + + match self { + SyntaxAttribute => "entity.other.attribute-name", + SyntaxBoolean => "constant.language", + SyntaxComment => "comment", + SyntaxCommentDoc => "comment.block.documentation", + SyntaxConstant => "constant.character", + SyntaxConstructor => "entity.name.function.definition.special.constructor", + SyntaxEmbedded => "embedded", + SyntaxEmphasis => "emphasis", + SyntaxEmphasisStrong => "emphasis.strong", + SyntaxEnum => "support.type.enum", + SyntaxFunction => "entity.name.function", + SyntaxHint => "hint", + SyntaxKeyword => "keyword", + SyntaxLabel => "label", + SyntaxLinkText => "link_text", + SyntaxLinkUri => "link_uri", + SyntaxNumber => "number", + SyntaxOperator => "operator", + SyntaxPredictive => "predictive", + SyntaxPreproc => "preproc", + SyntaxPrimary => "primary", + SyntaxProperty => "variable.object.property", //"variable.other.field" + SyntaxPunctuation => "punctuation", + SyntaxPunctuationBracket => "punctuation.bracket", + SyntaxPunctuationDelimiter => "punctuation.delimiter", + SyntaxPunctuationListMarker => "punctuation.list_marker", + SyntaxPunctuationSpecial => "punctuation.special", + SyntaxString => "string", + SyntaxStringEscape => "string.escape", + SyntaxStringRegex => "string.regex", + SyntaxStringSpecial => "string.special", + SyntaxStringSpecialSymbol => "string.special.symbol", + SyntaxTag => "tag", + SyntaxTextLiteral => "text.literal", + SyntaxTitle => "title", + SyntaxType => "entity.name.type", + SyntaxVariable => "variable.language", + SyntaxVariableSpecial => "variable.special", + SyntaxVariant => "variant", } } } - -// "comment" => "" -// "constant.character" => "" -// "constant.language" => "" -// "constant.language.python" => "" -// "constant.numeric" => "" -// "constant.numeric.line-number.find-in-files - match" => "" -// "constant.numeric.line-number.match" => "" -// "constant.other" => "" -// "constant.other.symbol" => "" -// "entity.name" => "" -// "entity.name.class" => "" -// "entity.name.filename.find-in-files" => "" -// "entity.name.function" => "" -// "entity.name.function.python" => "" -// "entity.name.import" => "" -// "entity.name.package" => "" -// "entity.name.tag" => "" -// "entity.name.type" => "" -// "entity.name.type.class.python" => "" -// "entity.other.attribute-name" => "" -// "entity.other.inherited-class" => "" -// "invalid" => "" -// "keyword" => "" -// "keyword.control.from" => "" -// "keyword.control.import" => "" -// "keyword.operator" => "" -// "keyword.other.new" => "" -// "markup.bold markup.italic" => "" -// "markup.bold" => "" -// "markup.changed" => "" -// "markup.deleted" => "" -// "markup.heading entity.name" => "" -// "markup.heading" => "" -// "markup.heading.setext" => "" -// "markup.inline.raw" => "" -// "markup.inserted" => "" -// "markup.inserted" => "" -// "markup.italic markup.bold" => "" -// "markup.italic" => "" -// "markup.list punctuation.definition.list.begin" => "" -// "markup.list" => "" -// "markup.quote" => "" -// "markup.raw" => "" -// "markup.raw.inline" => "" -// "markup.strike" => "" -// "markup.table" => "" -// "markup.underline.link" => "" -// "message.error" => "" -// "meta.decorator punctuation.decorator" => "" -// "meta.decorator variable.other" => "" -// "meta.diff" => "" -// "meta.diff.header" => "" -// "meta.embedded" => "" -// "meta.function-call" => "" -// "meta.function-call.generic" => "" -// "meta.import" => "" -// "meta.parameter" => "" -// "meta.preprocessor" => "" -// "meta.separator" => "" -// "meta.tag.sgml" => "" -// "punctuation.accessor" => "" -// "punctuation.definition.array.begin.json" => "" -// "punctuation.definition.array.end.json" => "" -// "punctuation.definition.dictionary.begin.json" => "" -// "punctuation.definition.dictionary.end.json" => "" -// "punctuation.definition.markdown" => "" -// "punctuation.definition.tag" => "" -// "punctuation.definition.tag.begin" => "" -// "punctuation.definition.tag.end" => "" -// "punctuation.definition.template-expression" => "" -// "punctuation.definition.variable" => "" -// "punctuation.section" => "" -// "punctuation.section.embedded" => "" -// "punctuation.section.embedded.begin" => "" -// "punctuation.section.embedded.end" => "" -// "punctuation.separator" => "" -// "punctuation.separator.array.json" => "" -// "punctuation.separator.dictionary.key-value.json" => "" -// "punctuation.separator.dictionary.pair.json" => "" -// "punctuation.terminator" => "" -// "source.c storage.type" => "" -// "source.css entity.name.tag" => "" -// "source.css support.type" => "" -// "source.go storage.type" => "" -// "source.groovy.embedded" => "" -// "source.haskell storage.type" => "" -// "source.java storage.type" => "" -// "source.java storage.type.primitive" => "" -// "source.less entity.name.tag" => "" -// "source.less support.type" => "" -// "source.python" => "" -// "source.ruby variable.other.readwrite" => "" -// "source.sass entity.name.tag" => "" -// "source.sass support.type" => "" -// "source.scss entity.name.tag" => "" -// "source.scss support.type" => "" -// "source.stylus entity.name.tag" => "" -// "source.stylus support.type" => "" -// "source.ts" => "" -// "storage" => "" -// "storage.modifier" => "" -// "storage.modifier.async" => "" -// "storage.modifier.tsx" => "" -// "storage.type.annotation" => "" -// "storage.type.function" => "" -// "string" => "" -// "string.other.link" => "" -// "string.regexp" => "" -// "support.class" => "" -// "support.class.component" => "" -// "support.constant" => "" -// "support.function" => "" -// "support.function.construct" => "" -// "support.function.go" => "" -// "support.macro" => "" -// "support.other.variable" => "" -// "support.type" => "" -// "support.type.exception" => "" -// "support.type.primitive" => "" -// "support.type.property-name" => "" -// "support.type.python" => "" -// "text.html.markdown markup.inline.raw" => "" -// "text.html.markdown meta.dummy.line-break" => "" -// "token.debug-token" => "" -// "token.error-token" => "" -// "token.info-token" => "" -// "token.warn-token" => "" -// "variable" => "" -// "variable.annotation" => "" -// "variable.function" => "" -// "variable.language" => "" -// "variable.member" => "" -// "variable.object.property" => "" -// "variable.other" => "" -// "variable.parameter" => "" -// "variable.parameter.function-call" => "" From 1c6a960bbfc5265ee300f7de30a67d9c1eea3cc8 Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Thu, 9 Nov 2023 14:53:04 -0500 Subject: [PATCH 31/76] Deal with special case where a VSCode theme doesn't have a `foreground` color Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com> --- crates/theme2/src/themes/solarized.rs | 2 ++ crates/theme_importer/src/vscode/converter.rs | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/theme2/src/themes/solarized.rs b/crates/theme2/src/themes/solarized.rs index ad986fde5c2b628f3f838f025cdecb3cb568e4e2..46ef78213b2b81712b4748068ada67829a4d9b8d 100644 --- a/crates/theme2/src/themes/solarized.rs +++ b/crates/theme2/src/themes/solarized.rs @@ -31,6 +31,7 @@ pub fn solarized() -> UserThemeFamily { element_selected: Some(rgba(0x005a6fff).into()), drop_target_background: Some(rgba(0x00435388).into()), ghost_element_hover: Some(rgba(0x004353aa).into()), + text: Some(rgba(0xbbbbbbff).into()), tab_inactive_background: Some(rgba(0x003f51ff).into()), tab_active_background: Some(rgba(0x002a36ff).into()), editor_background: Some(rgba(0x002a35ff).into()), @@ -153,6 +154,7 @@ pub fn solarized() -> UserThemeFamily { element_hover: Some(rgba(0xdec98744).into()), element_selected: Some(rgba(0xdec987ff).into()), ghost_element_hover: Some(rgba(0xdec98744).into()), + text: Some(rgba(0x333333ff).into()), tab_inactive_background: Some(rgba(0xd3cbb7ff).into()), tab_active_background: Some(rgba(0xfdf6e3ff).into()), editor_background: Some(rgba(0xfdf6e3ff).into()), diff --git a/crates/theme_importer/src/vscode/converter.rs b/crates/theme_importer/src/vscode/converter.rs index 39cc003094b82501cfadd8f93f3a64943387314e..916b2f27a6ef8affcda40fb87b0aeb99721a40ba 100644 --- a/crates/theme_importer/src/vscode/converter.rs +++ b/crates/theme_importer/src/vscode/converter.rs @@ -157,7 +157,17 @@ impl VsCodeThemeConverter { text: vscode_colors .foreground .as_ref() - .traverse(|color| try_parse_color(&color))?, + .traverse(|color| try_parse_color(&color))? + .or_else(|| { + self.theme + .token_colors + .iter() + .find(|token_color| token_color.scope.is_none()) + .and_then(|token_color| token_color.settings.foreground.as_ref()) + .traverse(|color| try_parse_color(&color)) + .ok() + .flatten() + }), tab_active_background: vscode_colors .tab_active_background .as_ref() From 7b489f5e2e91e756b84499f3b31b5f0c4f5ef94a Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 9 Nov 2023 15:16:59 -0500 Subject: [PATCH 32/76] Allow user-theme related methods to be unused --- crates/theme2/src/registry.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/theme2/src/registry.rs b/crates/theme2/src/registry.rs index 8f97354ec5de7943a1ecf421f7e7cc0b0dae5e61..0c61f6f22468901e6c7c78e8664d075c5c82779c 100644 --- a/crates/theme2/src/registry.rs +++ b/crates/theme2/src/registry.rs @@ -27,12 +27,14 @@ impl ThemeRegistry { } } + #[allow(unused)] fn insert_user_theme_familes(&mut self, families: impl IntoIterator) { for family in families.into_iter() { self.insert_user_themes(family.themes); } } + #[allow(unused)] fn insert_user_themes(&mut self, themes: impl IntoIterator) { self.insert_themes(themes.into_iter().map(|user_theme| { let mut theme_colors = match user_theme.appearance { From dba41e99ddcfa66eb40c14a852910d6f0a99e068 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 9 Nov 2023 12:33:30 -0800 Subject: [PATCH 33/76] Avoid suggesting search query if cursor is not on a word --- crates/editor/src/items.rs | 20 +++++++++++--------- crates/editor2/src/items.rs | 20 +++++++++++--------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/crates/editor/src/items.rs b/crates/editor/src/items.rs index 1b922848e061b8b162fc5c1f25babf5c3ce96c0e..30fd14a5e3c7e7cd5b7ca0caab73fba461b48497 100644 --- a/crates/editor/src/items.rs +++ b/crates/editor/src/items.rs @@ -1,7 +1,7 @@ use crate::{ - display_map::ToDisplayPoint, link_go_to_definition::hide_link_definition, - movement::surrounding_word, persistence::DB, scroll::ScrollAnchor, Anchor, Autoscroll, Editor, - Event, ExcerptId, ExcerptRange, MultiBuffer, MultiBufferSnapshot, NavigationData, ToPoint as _, + link_go_to_definition::hide_link_definition, persistence::DB, scroll::ScrollAnchor, Anchor, + Autoscroll, Editor, Event, ExcerptId, ExcerptRange, MultiBuffer, MultiBufferSnapshot, + NavigationData, ToPoint as _, }; use anyhow::{Context, Result}; use collections::HashSet; @@ -13,8 +13,8 @@ use gpui::{ ViewHandle, WeakViewHandle, }; use language::{ - proto::serialize_anchor as serialize_text_anchor, Bias, Buffer, OffsetRangeExt, Point, - SelectionGoal, + proto::serialize_anchor as serialize_text_anchor, Bias, Buffer, CharKind, OffsetRangeExt, + Point, SelectionGoal, }; use project::{search::SearchQuery, FormatTrigger, Item as _, Project, ProjectPath}; use rpc::proto::{self, update_view, PeerId}; @@ -940,10 +940,12 @@ impl SearchableItem for Editor { let display_map = self.snapshot(cx).display_snapshot; let selection = self.selections.newest::(cx); if selection.start == selection.end { - let point = selection.start.to_display_point(&display_map); - let range = surrounding_word(&display_map, point); - let range = range.start.to_offset(&display_map, Bias::Left) - ..range.end.to_offset(&display_map, Bias::Right); + let (range, kind) = display_map + .buffer_snapshot + .surrounding_word(selection.start); + if kind != Some(CharKind::Word) { + return String::new(); + } let text: String = display_map.buffer_snapshot.text_for_range(range).collect(); if text.trim().is_empty() { String::new() diff --git a/crates/editor2/src/items.rs b/crates/editor2/src/items.rs index 1081a329c6145ab6e6cea620aeaff1ec006cf017..e0ddcfa7dcae67f61ea21258d8454b1f5a628578 100644 --- a/crates/editor2/src/items.rs +++ b/crates/editor2/src/items.rs @@ -1,7 +1,7 @@ use crate::{ - display_map::ToDisplayPoint, link_go_to_definition::hide_link_definition, - movement::surrounding_word, persistence::DB, scroll::ScrollAnchor, Anchor, Autoscroll, Editor, - Event, ExcerptId, ExcerptRange, MultiBuffer, MultiBufferSnapshot, NavigationData, ToPoint as _, + link_go_to_definition::hide_link_definition, movement::surrounding_word, persistence::DB, + scroll::ScrollAnchor, Anchor, Autoscroll, Editor, Event, ExcerptId, ExcerptRange, MultiBuffer, + MultiBufferSnapshot, NavigationData, ToPoint as _, }; use anyhow::{anyhow, Context, Result}; use collections::HashSet; @@ -12,8 +12,8 @@ use gpui::{ ViewContext, VisualContext, WeakView, }; use language::{ - proto::serialize_anchor as serialize_text_anchor, Bias, Buffer, OffsetRangeExt, Point, - SelectionGoal, + proto::serialize_anchor as serialize_text_anchor, Bias, Buffer, CharKind, OffsetRangeExt, + Point, SelectionGoal, }; use project::{search::SearchQuery, FormatTrigger, Item as _, Project, ProjectPath}; use rpc::proto::{self, update_view, PeerId}; @@ -921,10 +921,12 @@ impl SearchableItem for Editor { let display_map = self.snapshot(cx).display_snapshot; let selection = self.selections.newest::(cx); if selection.start == selection.end { - let point = selection.start.to_display_point(&display_map); - let range = surrounding_word(&display_map, point); - let range = range.start.to_offset(&display_map, Bias::Left) - ..range.end.to_offset(&display_map, Bias::Right); + let (range, kind) = display_map + .buffer_snapshot + .surrounding_word(selection.start); + if kind != Some(CharKind::Word) { + return String::new(); + } let text: String = display_map.buffer_snapshot.text_for_range(range).collect(); if text.trim().is_empty() { String::new() From 28d3d211089af2d8b4e8af43f538fc431d99c023 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 9 Nov 2023 13:23:31 -0800 Subject: [PATCH 34/76] Generalize Refineable derive macro to derive arbitrary traits on the refinement type --- crates/gpui/src/geometry.rs | 6 ++-- crates/gpui2/src/geometry.rs | 10 +++--- crates/gpui2/src/style.rs | 6 ++-- .../src/derive_refineable.rs | 33 +++++-------------- crates/theme2/src/colors.rs | 4 +-- crates/theme2/src/user_theme.rs | 5 ++- 6 files changed, 24 insertions(+), 40 deletions(-) diff --git a/crates/gpui/src/geometry.rs b/crates/gpui/src/geometry.rs index 40b06827872edec469d82cfc1cc79c377a00633b..fe197af5d2670146de94198abbc0db3dccc02135 100644 --- a/crates/gpui/src/geometry.rs +++ b/crates/gpui/src/geometry.rs @@ -136,7 +136,7 @@ impl ToJson for RectF { } #[derive(Refineable, Debug)] -#[refineable(debug)] +#[refineable(Debug)] pub struct Point { pub x: T, pub y: T, @@ -161,7 +161,7 @@ impl Into> for Point { } #[derive(Refineable, Clone, Debug)] -#[refineable(debug)] +#[refineable(Debug)] pub struct Size { pub width: T, pub height: T, @@ -227,7 +227,7 @@ impl Size { } #[derive(Clone, Default, Refineable, Debug)] -#[refineable(debug)] +#[refineable(Debug)] pub struct Edges { pub top: T, pub right: T, diff --git a/crates/gpui2/src/geometry.rs b/crates/gpui2/src/geometry.rs index c5209239aea6ed84bc43d715d52b6b1e0a895c7c..f290c6a81c1b147c78940465e6fa2ffb63c9964f 100644 --- a/crates/gpui2/src/geometry.rs +++ b/crates/gpui2/src/geometry.rs @@ -9,7 +9,7 @@ use std::{ }; #[derive(Refineable, Default, Add, AddAssign, Sub, SubAssign, Copy, Debug, PartialEq, Eq, Hash)] -#[refineable(debug)] +#[refineable(Debug)] #[repr(C)] pub struct Point { pub x: T, @@ -140,7 +140,7 @@ impl Clone for Point { } #[derive(Refineable, Default, Clone, Copy, PartialEq, Div, Hash, Serialize, Deserialize)] -#[refineable(debug)] +#[refineable(Debug)] #[repr(C)] pub struct Size { pub width: T, @@ -313,7 +313,7 @@ impl Size { } #[derive(Refineable, Clone, Default, Debug, Eq, PartialEq)] -#[refineable(debug)] +#[refineable(Debug)] #[repr(C)] pub struct Bounds { pub origin: Point, @@ -477,7 +477,7 @@ impl Bounds { impl Copy for Bounds {} #[derive(Refineable, Clone, Default, Debug, Eq, PartialEq)] -#[refineable(debug)] +#[refineable(Debug)] #[repr(C)] pub struct Edges { pub top: T, @@ -619,7 +619,7 @@ impl Edges { } #[derive(Refineable, Clone, Default, Debug, Eq, PartialEq)] -#[refineable(debug)] +#[refineable(Debug)] #[repr(C)] pub struct Corners { pub top_left: T, diff --git a/crates/gpui2/src/style.rs b/crates/gpui2/src/style.rs index 6d3b31c1f7a2817cbf45b6b8c4221d045f6992ca..664cc61f8a1bf100678bc13d2cf796019380f9e5 100644 --- a/crates/gpui2/src/style.rs +++ b/crates/gpui2/src/style.rs @@ -14,7 +14,7 @@ pub use taffy::style::{ pub type StyleCascade = Cascade