mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 07:35:01 +03:00
WIP – Add Syntax themes to importer
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
This commit is contained in:
parent
4b5ca3e420
commit
efd1db1b09
@ -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
|
||||
}
|
||||
|
@ -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};
|
||||
|
@ -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()),
|
||||
],
|
||||
}),
|
||||
},
|
||||
},
|
||||
],
|
||||
|
@ -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()),
|
||||
],
|
||||
}),
|
||||
},
|
||||
},
|
||||
],
|
||||
|
@ -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())] }) } }],
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,44 +1,36 @@
|
||||
// This file was generated by the `theme_importer`.
|
||||
// Be careful when modifying it by hand.
|
||||
|
||||
mod andromeda;
|
||||
mod ayu;
|
||||
mod dracula;
|
||||
mod gruvbox;
|
||||
// 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 dracula;
|
||||
mod solarized;
|
||||
mod nord;
|
||||
mod notctis;
|
||||
mod palenight;
|
||||
mod rose_pine;
|
||||
mod solarized;
|
||||
mod synthwave_84;
|
||||
mod ayu;
|
||||
mod gruvbox;
|
||||
|
||||
pub use andromeda::*;
|
||||
pub use ayu::*;
|
||||
pub use dracula::*;
|
||||
pub use gruvbox::*;
|
||||
pub use rose_pine::*;
|
||||
pub use night_owl::*;
|
||||
pub use andromeda::*;
|
||||
pub use synthwave_84::*;
|
||||
pub use palenight::*;
|
||||
pub use dracula::*;
|
||||
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<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
@ -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())] }) } }],
|
||||
}
|
||||
}
|
||||
|
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
@ -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())] }) } }],
|
||||
}
|
||||
}
|
||||
|
@ -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())] }) } }],
|
||||
}
|
||||
}
|
||||
|
@ -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<Hsla>,
|
||||
}
|
||||
|
||||
impl UserHighlightStyle {
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.color.is_none()
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
mod theme_printer;
|
||||
mod util;
|
||||
mod vscode;
|
||||
mod vscode_syntax;
|
||||
|
||||
use std::fs::{self, File};
|
||||
use std::io::Write;
|
||||
|
@ -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<T>);
|
||||
|
||||
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<T>);
|
||||
|
||||
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(
|
||||
|
@ -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<bool>,
|
||||
pub colors: VsCodeColors,
|
||||
#[serde(rename = "tokenColors")]
|
||||
pub token_colors: Vec<VsCodeTokenColor>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
@ -413,7 +419,7 @@ pub struct VsCodeColors {
|
||||
pub list_filter_widget_no_matches_outline: Option<String>,
|
||||
}
|
||||
|
||||
fn try_parse_color(color: &str) -> Result<Hsla> {
|
||||
pub(crate) fn try_parse_color(color: &str) -> Result<Hsla> {
|
||||
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),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
261
crates/theme_importer/src/vscode_syntax.rs
Normal file
261
crates/theme_importer/src/vscode_syntax.rs
Normal file
@ -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<String>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct VsCodeTokenColor {
|
||||
pub scope: Option<VsCodeTokenScope>,
|
||||
pub settings: VsCodeTokenColorSettings,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct VsCodeTokenColorSettings {
|
||||
pub foreground: Option<String>,
|
||||
pub background: Option<String>,
|
||||
#[serde(rename = "fontStyle")]
|
||||
pub font_style: Option<String>,
|
||||
}
|
||||
|
||||
impl VsCodeTokenColor {
|
||||
pub fn highlight_styles(&self) -> Result<Vec<(String, UserHighlightStyle)>> {
|
||||
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<String> {
|
||||
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" => ""
|
Loading…
Reference in New Issue
Block a user