Emit unique highlights for each syntax token

This commit is contained in:
Marshall Bowers 2023-11-09 12:46:37 -05:00
parent efd1db1b09
commit 60eae3e50a
15 changed files with 1969 additions and 221 deletions

View File

@ -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![
("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()),
("comment".into(), rgba(0x9fa0a6cc).into()),
("something".into(), rgba(0x95e072ff).into()),
],
}),
},

View File

@ -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()),
],
}),

View File

@ -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()),
],
}),
},
}],
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -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<UserThemeFamily> {
vec![rose_pine(), night_owl(), andromeda(), synthwave_84(), palenight(), dracula(), solarized(), nord(), notctis(), ayu(), gruvbox()]
}
pub(crate) fn all_user_themes() -> Vec<UserThemeFamily> {
vec![
rose_pine(),
night_owl(),
andromeda(),
synthwave_84(),
palenight(),
dracula(),
solarized(),
nord(),
notctis(),
ayu(),
gruvbox(),
]
}

File diff suppressed because one or more lines are too long

View File

@ -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()),
],
}),
},
}],
}
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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()),
],
}),
},
},
],
}
}
}

View File

@ -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()),
],
}),
},
}],
}
}
}

View File

@ -28,7 +28,7 @@ struct FamilyMetadata {
pub themes: Vec<ThemeMetadata>,
}
#[derive(Debug, Deserialize)]
#[derive(Debug, Clone, Copy, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ThemeAppearanceJson {
Light,

View File

@ -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<UserTheme> {
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<StatusColorsRefinement> {
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()
};
})
}
let theme_colors_refinements = ThemeColorsRefinement {
fn convert_theme_colors(&self) -> Result<ThemeColorsRefinement> {
let vscode_colors = &self.theme.colors;
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),
},
})
}
}

View File

@ -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<Vec<(String, UserHighlightStyle)>> {
let mut highlight_styles = Vec::new();
pub fn highlight_styles(&self) -> Result<HashMap<String, UserHighlightStyle>> {
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)