Rework third-party themes (#3254)

This PR reworks the way we define our third-party themes to make them
work as overlays on top of a base theme.

We introduce the concept of a `UserThemeFamily` that contains
`UserTheme`s. Rather than being an entire theme definition on their own,
a `UserTheme` just contains optional overrides for the values in a
`Theme`.

When resolving a `UserTheme`, we apply it on top of the base theme. Any
values not overridden in the `UserTheme` will fall back to the `Theme`
defaults.

Right now we are just using `UserTheme` to model third-party themes that
we distribute with the Zed binary. However, this same structure can also
be used to import arbitrary user themes (such as from a theme registry,
or even a theme blob from the settings file).

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2023-11-07 17:40:07 +01:00 committed by GitHub
parent 9582a6f317
commit 0d95410634
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 1389 additions and 6000 deletions

1
Cargo.lock generated
View File

@ -8997,6 +8997,7 @@ dependencies = [
"settings2",
"toml 0.5.11",
"util",
"uuid 1.4.1",
]
[[package]]

View File

@ -28,6 +28,7 @@ serde_derive.workspace = true
serde_json.workspace = true
settings = { package = "settings2", path = "../settings2" }
toml.workspace = true
uuid.workspace = true
util = { path = "../util" }
[dev-dependencies]

View File

@ -1,7 +1,14 @@
use crate::{zed_pro_family, Theme, ThemeFamily};
use std::collections::HashMap;
use std::sync::Arc;
use anyhow::{anyhow, Result};
use gpui::SharedString;
use std::{collections::HashMap, sync::Arc};
use refineable::Refineable;
use crate::{
zed_pro_family, Appearance, GitStatusColors, PlayerColors, StatusColors, SyntaxTheme,
SystemColors, Theme, ThemeColors, ThemeFamily, ThemeStyles, UserTheme, UserThemeFamily,
};
pub struct ThemeRegistry {
themes: HashMap<SharedString, Arc<Theme>>,
@ -20,6 +27,37 @@ impl ThemeRegistry {
}
}
fn insert_user_theme_familes(&mut self, families: impl IntoIterator<Item = UserThemeFamily>) {
for family in families.into_iter() {
self.insert_user_themes(family.themes);
}
}
fn insert_user_themes(&mut self, themes: impl IntoIterator<Item = UserTheme>) {
self.insert_themes(themes.into_iter().map(|user_theme| {
let mut theme_colors = match user_theme.appearance {
Appearance::Light => ThemeColors::default_light(),
Appearance::Dark => ThemeColors::default_dark(),
};
theme_colors.refine(&user_theme.styles.colors);
Theme {
id: uuid::Uuid::new_v4().to_string(),
name: user_theme.name.into(),
appearance: user_theme.appearance,
styles: ThemeStyles {
system: SystemColors::default(),
colors: theme_colors,
status: StatusColors::default(),
git: GitStatusColors::default(),
player: PlayerColors::default(),
syntax: SyntaxTheme::default_dark(),
},
}
}));
}
pub fn list_names(&self, _staff: bool) -> impl Iterator<Item = SharedString> + '_ {
self.themes.keys().cloned()
}
@ -43,7 +81,7 @@ impl Default for ThemeRegistry {
};
this.insert_theme_families([zed_pro_family()]);
this.insert_theme_families(crate::all_imported_themes());
this.insert_user_theme_familes(crate::all_imported_themes());
this
}

View File

@ -6,6 +6,7 @@ mod scale;
mod settings;
mod syntax;
mod themes;
mod user_theme;
use std::sync::Arc;
@ -18,10 +19,12 @@ pub use scale::*;
pub use settings::*;
pub use syntax::*;
pub use themes::*;
pub use user_theme::*;
use gpui::{AppContext, Hsla, SharedString};
use serde::Deserialize;
#[derive(Debug, PartialEq, Clone, Copy)]
#[derive(Debug, PartialEq, Clone, Copy, Deserialize)]
pub enum Appearance {
Light,
Dark,

View File

@ -1,351 +1,82 @@
use gpui::rgba;
use crate::{
default_color_scales, Appearance, GitStatusColors, PlayerColor, PlayerColors, StatusColors,
SyntaxTheme, SystemColors, Theme, ThemeColors, ThemeFamily, ThemeStyles,
Appearance, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement,
};
pub fn andromeda() -> ThemeFamily {
ThemeFamily {
id: "ecd46547-a042-424d-99ca-5f56c060f798".into(),
pub fn andromeda() -> UserThemeFamily {
UserThemeFamily {
name: "Andromeda".into(),
author: "Eliver Lara (EliverLara)".into(),
themes: vec![
Theme {
id: "3bfb3b6e-365a-4cd2-9a80-2d2c81434729".into(),
UserTheme {
name: "Andromeda".into(),
appearance: Appearance::Dark,
styles: ThemeStyles {
system: SystemColors {
transparent: rgba(0x00000000).into(),
mac_os_traffic_light_red: rgba(0xec6b5fff).into(),
mac_os_traffic_light_yellow: rgba(0xf3bf4dff).into(),
mac_os_traffic_light_green: rgba(0x61c454ff).into(),
},
colors: ThemeColors {
border: rgba(0x1b1d23ff).into(),
border_variant: rgba(0x1b1d23ff).into(),
border_focused: rgba(0x1b1d23ff).into(),
border_selected: rgba(0x1b1d23ff).into(),
border_transparent: rgba(0x1b1d23ff).into(),
border_disabled: rgba(0x1b1d23ff).into(),
elevated_surface_background: rgba(0x23262eff).into(),
surface_background: rgba(0x23262eff).into(),
background: rgba(0x23262eff).into(),
element_background: rgba(0x00e8c5cc).into(),
element_hover: rgba(0x272a2dff).into(),
element_active: rgba(0x2e3135ff).into(),
element_selected: rgba(0x2e3135ff).into(),
element_disabled: rgba(0xddeaf814).into(),
element_placeholder: rgba(0xb0b4baff).into(),
element_drop_target: rgba(0x1166fb18).into(),
ghost_element_background: rgba(0x00000000).into(),
ghost_element_hover: rgba(0x272a2dff).into(),
ghost_element_active: rgba(0x2e3135ff).into(),
ghost_element_selected: rgba(0x2e3135ff).into(),
ghost_element_disabled: rgba(0xddeaf814).into(),
text: rgba(0xd4cdd8ff).into(),
text_muted: rgba(0xb0b4baff).into(),
text_placeholder: rgba(0x767a83ff).into(),
text_disabled: rgba(0x696e77ff).into(),
text_accent: rgba(0x6fb8ffff).into(),
icon: rgba(0xb0b4baff).into(),
icon_muted: rgba(0x767a83ff).into(),
icon_disabled: rgba(0x696e77ff).into(),
icon_placeholder: rgba(0x767a83ff).into(),
icon_accent: rgba(0x6fb8ffff).into(),
status_bar_background: rgba(0x18191bff).into(),
title_bar_background: rgba(0x18191bff).into(),
toolbar_background: rgba(0x111113ff).into(),
tab_bar_background: rgba(0x18191bff).into(),
tab_inactive_background: rgba(0x23262eff).into(),
tab_active_background: rgba(0x23262eff).into(),
editor_background: rgba(0x111113ff).into(),
editor_gutter_background: rgba(0x111113ff).into(),
editor_subheader_background: rgba(0x18191bff).into(),
editor_active_line_background: rgba(0xddeaf814).into(),
editor_highlighted_line_background: rgba(0xd3edf81d).into(),
editor_line_number: rgba(0xddeaf814).into(),
editor_active_line_number: rgba(0xddeaf814).into(),
editor_invisible: rgba(0xd3edf81d).into(),
editor_wrap_guide: rgba(0xd3edf81d).into(),
editor_active_wrap_guide: rgba(0xd3edf81d).into(),
editor_document_highlight_read_background: rgba(0xd3edf81d).into(),
editor_document_highlight_write_background: rgba(0xd3edf81d).into(),
terminal_background: rgba(0x111113ff).into(),
terminal_ansi_bright_black: rgba(0x000000e6).into(),
terminal_ansi_bright_red: rgba(0xee5d42ff).into(),
terminal_ansi_bright_green: rgba(0x95e072ff).into(),
terminal_ansi_bright_yellow: rgba(0xffe66dff).into(),
terminal_ansi_bright_blue: rgba(0x7bb7ffff).into(),
terminal_ansi_bright_magenta: rgba(0xff00a9ff).into(),
terminal_ansi_bright_cyan: rgba(0x00e8c6ff).into(),
terminal_ansi_bright_white: rgba(0xb0b4baff).into(),
terminal_ansi_black: rgba(0x000000f2).into(),
terminal_ansi_red: rgba(0xee5d42ff).into(),
terminal_ansi_green: rgba(0x95e072ff).into(),
terminal_ansi_yellow: rgba(0xffe66dff).into(),
terminal_ansi_blue: rgba(0x7bb7ffff).into(),
terminal_ansi_magenta: rgba(0xff00a9ff).into(),
terminal_ansi_cyan: rgba(0x00e8c6ff).into(),
terminal_ansi_white: rgba(0xedeef0ff).into(),
},
status: StatusColors {
conflict: rgba(0xff9592ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
error: rgba(0xff9592ff).into(),
hidden: rgba(0xb0b4baff).into(),
ignored: rgba(0xb0b4baff).into(),
info: rgba(0x6fb8ffff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
success: rgba(0x70cf82ff).into(),
warning: rgba(0xf5e147ff).into(),
},
git: GitStatusColors {
conflict: rgba(0xffa057ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
ignored: rgba(0xb0b4baff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
},
player: PlayerColors(vec![
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
]),
syntax: SyntaxTheme {
highlights: vec![
("attribute".into(), rgba(0x4ccce6ff).into()),
("boolean".into(), rgba(0xff977dff).into()),
("comment".into(), rgba(0xb0b4baff).into()),
("comment.doc".into(), rgba(0xe0dffeff).into()),
("constant".into(), rgba(0x8c323aff).into()),
("constructor".into(), rgba(0x8c323aff).into()),
("embedded".into(), rgba(0x8c323aff).into()),
("emphasis".into(), rgba(0x8c323aff).into()),
("emphasis.strong".into(), rgba(0x8c323aff).into()),
("enum".into(), rgba(0x8c323aff).into()),
("function".into(), rgba(0x8c323aff).into()),
("hint".into(), rgba(0x8c323aff).into()),
("keyword".into(), rgba(0xffa057ff).into()),
("label".into(), rgba(0x8c323aff).into()),
("link_text".into(), rgba(0x8c323aff).into()),
("link_uri".into(), rgba(0x8c323aff).into()),
("number".into(), rgba(0x8c323aff).into()),
("operator".into(), rgba(0x8c323aff).into()),
("predictive".into(), rgba(0x8c323aff).into()),
("preproc".into(), rgba(0x8c323aff).into()),
("primary".into(), rgba(0x8c323aff).into()),
("property".into(), rgba(0x8c323aff).into()),
("punctuation".into(), rgba(0xb0b4baff).into()),
("punctuation.bracket".into(), rgba(0xb0b4baff).into()),
("punctuation.delimiter".into(), rgba(0xb0b4baff).into()),
("punctuation.list_marker".into(), rgba(0x6fb8ffff).into()),
("punctuation.special".into(), rgba(0x8c323aff).into()),
("string".into(), rgba(0x1ed8a3ff).into()),
("string.escape".into(), rgba(0x8c323aff).into()),
("string.regex".into(), rgba(0xff977dff).into()),
("string.special".into(), rgba(0x8c323aff).into()),
("string.special.symbol".into(), rgba(0x8c323aff).into()),
("tag".into(), rgba(0x8c323aff).into()),
("text.literal".into(), rgba(0x8c323aff).into()),
("title".into(), rgba(0x8c323aff).into()),
("type".into(), rgba(0x8c323aff).into()),
("variable".into(), rgba(0x8c323aff).into()),
("variable.special".into(), rgba(0x8c323aff).into()),
("variant".into(), rgba(0x8c323aff).into()),
],
styles: UserThemeStylesRefinement {
colors: ThemeColorsRefinement {
border: Some(rgba(0x1b1d23ff).into()),
border_variant: Some(rgba(0x1b1d23ff).into()),
border_focused: Some(rgba(0x1b1d23ff).into()),
border_selected: Some(rgba(0x1b1d23ff).into()),
border_transparent: Some(rgba(0x1b1d23ff).into()),
border_disabled: Some(rgba(0x1b1d23ff).into()),
elevated_surface_background: Some(rgba(0x23262eff).into()),
surface_background: Some(rgba(0x23262eff).into()),
background: Some(rgba(0x23262eff).into()),
element_background: Some(rgba(0x00e8c5cc).into()),
text: Some(rgba(0xd4cdd8ff).into()),
tab_inactive_background: Some(rgba(0x23262eff).into()),
tab_active_background: Some(rgba(0x23262eff).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()),
terminal_ansi_bright_blue: Some(rgba(0x7bb7ffff).into()),
terminal_ansi_bright_magenta: Some(rgba(0xff00a9ff).into()),
terminal_ansi_bright_cyan: Some(rgba(0x00e8c6ff).into()),
terminal_ansi_red: Some(rgba(0xee5d42ff).into()),
terminal_ansi_green: Some(rgba(0x95e072ff).into()),
terminal_ansi_yellow: Some(rgba(0xffe66dff).into()),
terminal_ansi_blue: Some(rgba(0x7bb7ffff).into()),
terminal_ansi_magenta: Some(rgba(0xff00a9ff).into()),
terminal_ansi_cyan: Some(rgba(0x00e8c6ff).into()),
..Default::default()
},
},
},
Theme {
id: "7bc92ac8-152c-46d5-b346-df68e4db2e7c".into(),
UserTheme {
name: "Andromeda Bordered".into(),
appearance: Appearance::Dark,
styles: ThemeStyles {
system: SystemColors {
transparent: rgba(0x00000000).into(),
mac_os_traffic_light_red: rgba(0xec6b5fff).into(),
mac_os_traffic_light_yellow: rgba(0xf3bf4dff).into(),
mac_os_traffic_light_green: rgba(0x61c454ff).into(),
},
colors: ThemeColors {
border: rgba(0x1b1d23ff).into(),
border_variant: rgba(0x1b1d23ff).into(),
border_focused: rgba(0x1b1d23ff).into(),
border_selected: rgba(0x1b1d23ff).into(),
border_transparent: rgba(0x1b1d23ff).into(),
border_disabled: rgba(0x1b1d23ff).into(),
elevated_surface_background: rgba(0x23262eff).into(),
surface_background: rgba(0x23262eff).into(),
background: rgba(0x262933ff).into(),
element_background: rgba(0x00e8c5cc).into(),
element_hover: rgba(0x272a2dff).into(),
element_active: rgba(0x2e3135ff).into(),
element_selected: rgba(0x2e3135ff).into(),
element_disabled: rgba(0xddeaf814).into(),
element_placeholder: rgba(0xb0b4baff).into(),
element_drop_target: rgba(0x1166fb18).into(),
ghost_element_background: rgba(0x00000000).into(),
ghost_element_hover: rgba(0x272a2dff).into(),
ghost_element_active: rgba(0x2e3135ff).into(),
ghost_element_selected: rgba(0x2e3135ff).into(),
ghost_element_disabled: rgba(0xddeaf814).into(),
text: rgba(0xd4cdd8ff).into(),
text_muted: rgba(0xb0b4baff).into(),
text_placeholder: rgba(0x767a83ff).into(),
text_disabled: rgba(0x696e77ff).into(),
text_accent: rgba(0x6fb8ffff).into(),
icon: rgba(0xb0b4baff).into(),
icon_muted: rgba(0x767a83ff).into(),
icon_disabled: rgba(0x696e77ff).into(),
icon_placeholder: rgba(0x767a83ff).into(),
icon_accent: rgba(0x6fb8ffff).into(),
status_bar_background: rgba(0x18191bff).into(),
title_bar_background: rgba(0x18191bff).into(),
toolbar_background: rgba(0x111113ff).into(),
tab_bar_background: rgba(0x18191bff).into(),
tab_inactive_background: rgba(0x23262eff).into(),
tab_active_background: rgba(0x262933ff).into(),
editor_background: rgba(0x111113ff).into(),
editor_gutter_background: rgba(0x111113ff).into(),
editor_subheader_background: rgba(0x18191bff).into(),
editor_active_line_background: rgba(0xddeaf814).into(),
editor_highlighted_line_background: rgba(0xd3edf81d).into(),
editor_line_number: rgba(0xddeaf814).into(),
editor_active_line_number: rgba(0xddeaf814).into(),
editor_invisible: rgba(0xd3edf81d).into(),
editor_wrap_guide: rgba(0xd3edf81d).into(),
editor_active_wrap_guide: rgba(0xd3edf81d).into(),
editor_document_highlight_read_background: rgba(0xd3edf81d).into(),
editor_document_highlight_write_background: rgba(0xd3edf81d).into(),
terminal_background: rgba(0x111113ff).into(),
terminal_ansi_bright_black: rgba(0x000000e6).into(),
terminal_ansi_bright_red: rgba(0xee5d42ff).into(),
terminal_ansi_bright_green: rgba(0x95e072ff).into(),
terminal_ansi_bright_yellow: rgba(0xffe66dff).into(),
terminal_ansi_bright_blue: rgba(0x7bb7ffff).into(),
terminal_ansi_bright_magenta: rgba(0xff00a9ff).into(),
terminal_ansi_bright_cyan: rgba(0x00e8c6ff).into(),
terminal_ansi_bright_white: rgba(0xb0b4baff).into(),
terminal_ansi_black: rgba(0x000000f2).into(),
terminal_ansi_red: rgba(0xee5d42ff).into(),
terminal_ansi_green: rgba(0x95e072ff).into(),
terminal_ansi_yellow: rgba(0xffe66dff).into(),
terminal_ansi_blue: rgba(0x7bb7ffff).into(),
terminal_ansi_magenta: rgba(0xff00a9ff).into(),
terminal_ansi_cyan: rgba(0x00e8c6ff).into(),
terminal_ansi_white: rgba(0xedeef0ff).into(),
},
status: StatusColors {
conflict: rgba(0xff9592ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
error: rgba(0xff9592ff).into(),
hidden: rgba(0xb0b4baff).into(),
ignored: rgba(0xb0b4baff).into(),
info: rgba(0x6fb8ffff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
success: rgba(0x70cf82ff).into(),
warning: rgba(0xf5e147ff).into(),
},
git: GitStatusColors {
conflict: rgba(0xffa057ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
ignored: rgba(0xb0b4baff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
},
player: PlayerColors(vec![
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
]),
syntax: SyntaxTheme {
highlights: vec![
("attribute".into(), rgba(0x4ccce6ff).into()),
("boolean".into(), rgba(0xff977dff).into()),
("comment".into(), rgba(0xb0b4baff).into()),
("comment.doc".into(), rgba(0xe0dffeff).into()),
("constant".into(), rgba(0x8c323aff).into()),
("constructor".into(), rgba(0x8c323aff).into()),
("embedded".into(), rgba(0x8c323aff).into()),
("emphasis".into(), rgba(0x8c323aff).into()),
("emphasis.strong".into(), rgba(0x8c323aff).into()),
("enum".into(), rgba(0x8c323aff).into()),
("function".into(), rgba(0x8c323aff).into()),
("hint".into(), rgba(0x8c323aff).into()),
("keyword".into(), rgba(0xffa057ff).into()),
("label".into(), rgba(0x8c323aff).into()),
("link_text".into(), rgba(0x8c323aff).into()),
("link_uri".into(), rgba(0x8c323aff).into()),
("number".into(), rgba(0x8c323aff).into()),
("operator".into(), rgba(0x8c323aff).into()),
("predictive".into(), rgba(0x8c323aff).into()),
("preproc".into(), rgba(0x8c323aff).into()),
("primary".into(), rgba(0x8c323aff).into()),
("property".into(), rgba(0x8c323aff).into()),
("punctuation".into(), rgba(0xb0b4baff).into()),
("punctuation.bracket".into(), rgba(0xb0b4baff).into()),
("punctuation.delimiter".into(), rgba(0xb0b4baff).into()),
("punctuation.list_marker".into(), rgba(0x6fb8ffff).into()),
("punctuation.special".into(), rgba(0x8c323aff).into()),
("string".into(), rgba(0x1ed8a3ff).into()),
("string.escape".into(), rgba(0x8c323aff).into()),
("string.regex".into(), rgba(0xff977dff).into()),
("string.special".into(), rgba(0x8c323aff).into()),
("string.special.symbol".into(), rgba(0x8c323aff).into()),
("tag".into(), rgba(0x8c323aff).into()),
("text.literal".into(), rgba(0x8c323aff).into()),
("title".into(), rgba(0x8c323aff).into()),
("type".into(), rgba(0x8c323aff).into()),
("variable".into(), rgba(0x8c323aff).into()),
("variable.special".into(), rgba(0x8c323aff).into()),
("variant".into(), rgba(0x8c323aff).into()),
],
styles: UserThemeStylesRefinement {
colors: ThemeColorsRefinement {
border: Some(rgba(0x1b1d23ff).into()),
border_variant: Some(rgba(0x1b1d23ff).into()),
border_focused: Some(rgba(0x1b1d23ff).into()),
border_selected: Some(rgba(0x1b1d23ff).into()),
border_transparent: Some(rgba(0x1b1d23ff).into()),
border_disabled: Some(rgba(0x1b1d23ff).into()),
elevated_surface_background: Some(rgba(0x23262eff).into()),
surface_background: Some(rgba(0x23262eff).into()),
background: Some(rgba(0x262933ff).into()),
element_background: Some(rgba(0x00e8c5cc).into()),
text: Some(rgba(0xd4cdd8ff).into()),
tab_inactive_background: Some(rgba(0x23262eff).into()),
tab_active_background: Some(rgba(0x262933ff).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()),
terminal_ansi_bright_blue: Some(rgba(0x7bb7ffff).into()),
terminal_ansi_bright_magenta: Some(rgba(0xff00a9ff).into()),
terminal_ansi_bright_cyan: Some(rgba(0x00e8c6ff).into()),
terminal_ansi_red: Some(rgba(0xee5d42ff).into()),
terminal_ansi_green: Some(rgba(0x95e072ff).into()),
terminal_ansi_yellow: Some(rgba(0xffe66dff).into()),
terminal_ansi_blue: Some(rgba(0x7bb7ffff).into()),
terminal_ansi_magenta: Some(rgba(0xff00a9ff).into()),
terminal_ansi_cyan: Some(rgba(0x00e8c6ff).into()),
..Default::default()
},
},
},
],
scales: default_color_scales(),
}
}

View File

@ -1,518 +1,131 @@
use gpui::rgba;
use crate::{
default_color_scales, Appearance, GitStatusColors, PlayerColor, PlayerColors, StatusColors,
SyntaxTheme, SystemColors, Theme, ThemeColors, ThemeFamily, ThemeStyles,
Appearance, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement,
};
pub fn ayu() -> ThemeFamily {
ThemeFamily {
id: "4faecf44-837e-4034-9197-7da909668498".into(),
pub fn ayu() -> UserThemeFamily {
UserThemeFamily {
name: "Ayu".into(),
author: "dempfi (Ike Ku)".into(),
themes: vec![
Theme {
id: "733aeb9b-98fd-4492-984e-d71540daf72e".into(),
UserTheme {
name: "Ayu Light".into(),
appearance: Appearance::Light,
styles: ThemeStyles {
system: SystemColors {
transparent: rgba(0x00000000).into(),
mac_os_traffic_light_red: rgba(0xec6b5fff).into(),
mac_os_traffic_light_yellow: rgba(0xf3bf4dff).into(),
mac_os_traffic_light_green: rgba(0x61c454ff).into(),
},
colors: ThemeColors {
border: rgba(0x6b7d8f1f).into(),
border_variant: rgba(0x6b7d8f1f).into(),
border_focused: rgba(0x6b7d8f1f).into(),
border_selected: rgba(0x6b7d8f1f).into(),
border_transparent: rgba(0x6b7d8f1f).into(),
border_disabled: rgba(0x6b7d8f1f).into(),
elevated_surface_background: rgba(0xf8f9faff).into(),
surface_background: rgba(0xf8f9faff).into(),
background: rgba(0xf8f9faff).into(),
element_background: rgba(0xffaa32ff).into(),
element_hover: rgba(0xe8e8ecff).into(),
element_active: rgba(0xe0e1e6ff).into(),
element_selected: rgba(0xe0e1e6ff).into(),
element_disabled: rgba(0x0000320f).into(),
element_placeholder: rgba(0x60646cff).into(),
element_drop_target: rgba(0x008bff0b).into(),
ghost_element_background: rgba(0x00000000).into(),
ghost_element_hover: rgba(0xe8e8ecff).into(),
ghost_element_active: rgba(0xe0e1e6ff).into(),
ghost_element_selected: rgba(0xe0e1e6ff).into(),
ghost_element_disabled: rgba(0x0000320f).into(),
text: rgba(0x8a9199ff).into(),
text_muted: rgba(0x60646cff).into(),
text_placeholder: rgba(0x80838dff).into(),
text_disabled: rgba(0x8b8d98ff).into(),
text_accent: rgba(0x0c73ceff).into(),
icon: rgba(0x60646cff).into(),
icon_muted: rgba(0x80838dff).into(),
icon_disabled: rgba(0x8b8d98ff).into(),
icon_placeholder: rgba(0x80838dff).into(),
icon_accent: rgba(0x0c73ceff).into(),
status_bar_background: rgba(0xf9f9fbff).into(),
title_bar_background: rgba(0xf9f9fbff).into(),
toolbar_background: rgba(0xfcfcfdff).into(),
tab_bar_background: rgba(0xf9f9fbff).into(),
tab_inactive_background: rgba(0xf8f9faff).into(),
tab_active_background: rgba(0xf8f9faff).into(),
editor_background: rgba(0xfcfcfdff).into(),
editor_gutter_background: rgba(0xfcfcfdff).into(),
editor_subheader_background: rgba(0xf9f9fbff).into(),
editor_active_line_background: rgba(0x0000320f).into(),
editor_highlighted_line_background: rgba(0x00002c17).into(),
editor_line_number: rgba(0x0000320f).into(),
editor_active_line_number: rgba(0x0000320f).into(),
editor_invisible: rgba(0x00002c17).into(),
editor_wrap_guide: rgba(0x00002c17).into(),
editor_active_wrap_guide: rgba(0x00002c17).into(),
editor_document_highlight_read_background: rgba(0x00002c17).into(),
editor_document_highlight_write_background: rgba(0x00002c17).into(),
terminal_background: rgba(0xf8f9faff).into(),
terminal_ansi_bright_black: rgba(0x686868ff).into(),
terminal_ansi_bright_red: rgba(0xef7070ff).into(),
terminal_ansi_bright_green: rgba(0x86b300ff).into(),
terminal_ansi_bright_yellow: rgba(0xf2ad48ff).into(),
terminal_ansi_bright_blue: rgba(0x389ee6ff).into(),
terminal_ansi_bright_magenta: rgba(0xa37accff).into(),
terminal_ansi_bright_cyan: rgba(0x4bbf98ff).into(),
terminal_ansi_bright_white: rgba(0xd1d1d1ff).into(),
terminal_ansi_black: rgba(0x000000ff).into(),
terminal_ansi_red: rgba(0xea6c6dff).into(),
terminal_ansi_green: rgba(0x6cbf43ff).into(),
terminal_ansi_yellow: rgba(0xeca944ff).into(),
terminal_ansi_blue: rgba(0x3198e1ff).into(),
terminal_ansi_magenta: rgba(0x9e75c7ff).into(),
terminal_ansi_cyan: rgba(0x46ba94ff).into(),
terminal_ansi_white: rgba(0xc7c7c7ff).into(),
},
status: StatusColors {
conflict: rgba(0xff9592ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
error: rgba(0xff9592ff).into(),
hidden: rgba(0xb0b4baff).into(),
ignored: rgba(0xb0b4baff).into(),
info: rgba(0x6fb8ffff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
success: rgba(0x70cf82ff).into(),
warning: rgba(0xf5e147ff).into(),
},
git: GitStatusColors {
conflict: rgba(0xffa057ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
ignored: rgba(0xb0b4baff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
},
player: PlayerColors(vec![
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
]),
syntax: SyntaxTheme {
highlights: vec![
("attribute".into(), rgba(0x4ccce6ff).into()),
("boolean".into(), rgba(0xff977dff).into()),
("comment".into(), rgba(0xb0b4baff).into()),
("comment.doc".into(), rgba(0xe0dffeff).into()),
("constant".into(), rgba(0x8c323aff).into()),
("constructor".into(), rgba(0x8c323aff).into()),
("embedded".into(), rgba(0x8c323aff).into()),
("emphasis".into(), rgba(0x8c323aff).into()),
("emphasis.strong".into(), rgba(0x8c323aff).into()),
("enum".into(), rgba(0x8c323aff).into()),
("function".into(), rgba(0x8c323aff).into()),
("hint".into(), rgba(0x8c323aff).into()),
("keyword".into(), rgba(0xffa057ff).into()),
("label".into(), rgba(0x8c323aff).into()),
("link_text".into(), rgba(0x8c323aff).into()),
("link_uri".into(), rgba(0x8c323aff).into()),
("number".into(), rgba(0x8c323aff).into()),
("operator".into(), rgba(0x8c323aff).into()),
("predictive".into(), rgba(0x8c323aff).into()),
("preproc".into(), rgba(0x8c323aff).into()),
("primary".into(), rgba(0x8c323aff).into()),
("property".into(), rgba(0x8c323aff).into()),
("punctuation".into(), rgba(0xb0b4baff).into()),
("punctuation.bracket".into(), rgba(0xb0b4baff).into()),
("punctuation.delimiter".into(), rgba(0xb0b4baff).into()),
("punctuation.list_marker".into(), rgba(0x6fb8ffff).into()),
("punctuation.special".into(), rgba(0x8c323aff).into()),
("string".into(), rgba(0x1ed8a3ff).into()),
("string.escape".into(), rgba(0x8c323aff).into()),
("string.regex".into(), rgba(0xff977dff).into()),
("string.special".into(), rgba(0x8c323aff).into()),
("string.special.symbol".into(), rgba(0x8c323aff).into()),
("tag".into(), rgba(0x8c323aff).into()),
("text.literal".into(), rgba(0x8c323aff).into()),
("title".into(), rgba(0x8c323aff).into()),
("type".into(), rgba(0x8c323aff).into()),
("variable".into(), rgba(0x8c323aff).into()),
("variable.special".into(), rgba(0x8c323aff).into()),
("variant".into(), rgba(0x8c323aff).into()),
],
styles: UserThemeStylesRefinement {
colors: ThemeColorsRefinement {
border: Some(rgba(0x6b7d8f1f).into()),
border_variant: Some(rgba(0x6b7d8f1f).into()),
border_focused: Some(rgba(0x6b7d8f1f).into()),
border_selected: Some(rgba(0x6b7d8f1f).into()),
border_transparent: Some(rgba(0x6b7d8f1f).into()),
border_disabled: Some(rgba(0x6b7d8f1f).into()),
elevated_surface_background: Some(rgba(0xf8f9faff).into()),
surface_background: Some(rgba(0xf8f9faff).into()),
background: Some(rgba(0xf8f9faff).into()),
element_background: Some(rgba(0xffaa32ff).into()),
text: Some(rgba(0x8a9199ff).into()),
tab_inactive_background: Some(rgba(0xf8f9faff).into()),
tab_active_background: Some(rgba(0xf8f9faff).into()),
terminal_background: Some(rgba(0xf8f9faff).into()),
terminal_ansi_bright_black: Some(rgba(0x686868ff).into()),
terminal_ansi_bright_red: Some(rgba(0xef7070ff).into()),
terminal_ansi_bright_green: Some(rgba(0x86b300ff).into()),
terminal_ansi_bright_yellow: Some(rgba(0xf2ad48ff).into()),
terminal_ansi_bright_blue: Some(rgba(0x389ee6ff).into()),
terminal_ansi_bright_magenta: Some(rgba(0xa37accff).into()),
terminal_ansi_bright_cyan: Some(rgba(0x4bbf98ff).into()),
terminal_ansi_bright_white: Some(rgba(0xd1d1d1ff).into()),
terminal_ansi_black: Some(rgba(0x000000ff).into()),
terminal_ansi_red: Some(rgba(0xea6c6dff).into()),
terminal_ansi_green: Some(rgba(0x6cbf43ff).into()),
terminal_ansi_yellow: Some(rgba(0xeca944ff).into()),
terminal_ansi_blue: Some(rgba(0x3198e1ff).into()),
terminal_ansi_magenta: Some(rgba(0x9e75c7ff).into()),
terminal_ansi_cyan: Some(rgba(0x46ba94ff).into()),
terminal_ansi_white: Some(rgba(0xc7c7c7ff).into()),
..Default::default()
},
},
},
Theme {
id: "50f68427-2e1d-4bf1-981a-d08c6b38e846".into(),
UserTheme {
name: "Ayu Mirage".into(),
appearance: Appearance::Dark,
styles: ThemeStyles {
system: SystemColors {
transparent: rgba(0x00000000).into(),
mac_os_traffic_light_red: rgba(0xec6b5fff).into(),
mac_os_traffic_light_yellow: rgba(0xf3bf4dff).into(),
mac_os_traffic_light_green: rgba(0x61c454ff).into(),
},
colors: ThemeColors {
border: rgba(0x171a24ff).into(),
border_variant: rgba(0x171a24ff).into(),
border_focused: rgba(0x171a24ff).into(),
border_selected: rgba(0x171a24ff).into(),
border_transparent: rgba(0x171a24ff).into(),
border_disabled: rgba(0x171a24ff).into(),
elevated_surface_background: rgba(0x1f2430ff).into(),
surface_background: rgba(0x1f2430ff).into(),
background: rgba(0x1f2430ff).into(),
element_background: rgba(0xffcb65ff).into(),
element_hover: rgba(0x272a2dff).into(),
element_active: rgba(0x2e3135ff).into(),
element_selected: rgba(0x2e3135ff).into(),
element_disabled: rgba(0xddeaf814).into(),
element_placeholder: rgba(0xb0b4baff).into(),
element_drop_target: rgba(0x1166fb18).into(),
ghost_element_background: rgba(0x00000000).into(),
ghost_element_hover: rgba(0x272a2dff).into(),
ghost_element_active: rgba(0x2e3135ff).into(),
ghost_element_selected: rgba(0x2e3135ff).into(),
ghost_element_disabled: rgba(0xddeaf814).into(),
text: rgba(0x707a8cff).into(),
text_muted: rgba(0xb0b4baff).into(),
text_placeholder: rgba(0x767a83ff).into(),
text_disabled: rgba(0x696e77ff).into(),
text_accent: rgba(0x6fb8ffff).into(),
icon: rgba(0xb0b4baff).into(),
icon_muted: rgba(0x767a83ff).into(),
icon_disabled: rgba(0x696e77ff).into(),
icon_placeholder: rgba(0x767a83ff).into(),
icon_accent: rgba(0x6fb8ffff).into(),
status_bar_background: rgba(0x18191bff).into(),
title_bar_background: rgba(0x18191bff).into(),
toolbar_background: rgba(0x111113ff).into(),
tab_bar_background: rgba(0x18191bff).into(),
tab_inactive_background: rgba(0x1f2430ff).into(),
tab_active_background: rgba(0x1f2430ff).into(),
editor_background: rgba(0x111113ff).into(),
editor_gutter_background: rgba(0x111113ff).into(),
editor_subheader_background: rgba(0x18191bff).into(),
editor_active_line_background: rgba(0xddeaf814).into(),
editor_highlighted_line_background: rgba(0xd3edf81d).into(),
editor_line_number: rgba(0xddeaf814).into(),
editor_active_line_number: rgba(0xddeaf814).into(),
editor_invisible: rgba(0xd3edf81d).into(),
editor_wrap_guide: rgba(0xd3edf81d).into(),
editor_active_wrap_guide: rgba(0xd3edf81d).into(),
editor_document_highlight_read_background: rgba(0xd3edf81d).into(),
editor_document_highlight_write_background: rgba(0xd3edf81d).into(),
terminal_background: rgba(0x1f2430ff).into(),
terminal_ansi_bright_black: rgba(0x686868ff).into(),
terminal_ansi_bright_red: rgba(0xf18678ff).into(),
terminal_ansi_bright_green: rgba(0xd4fe7fff).into(),
terminal_ansi_bright_yellow: rgba(0xffd173ff).into(),
terminal_ansi_bright_blue: rgba(0x73cfffff).into(),
terminal_ansi_bright_magenta: rgba(0xdfbfffff).into(),
terminal_ansi_bright_cyan: rgba(0x95e6cbff).into(),
terminal_ansi_bright_white: rgba(0xffffffff).into(),
terminal_ansi_black: rgba(0x171a24ff).into(),
terminal_ansi_red: rgba(0xed8173ff).into(),
terminal_ansi_green: rgba(0x86d96bff).into(),
terminal_ansi_yellow: rgba(0xfacc6eff).into(),
terminal_ansi_blue: rgba(0x6ccafaff).into(),
terminal_ansi_magenta: rgba(0xdabafaff).into(),
terminal_ansi_cyan: rgba(0x90e1c6ff).into(),
terminal_ansi_white: rgba(0xc7c7c7ff).into(),
},
status: StatusColors {
conflict: rgba(0xff9592ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
error: rgba(0xff9592ff).into(),
hidden: rgba(0xb0b4baff).into(),
ignored: rgba(0xb0b4baff).into(),
info: rgba(0x6fb8ffff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
success: rgba(0x70cf82ff).into(),
warning: rgba(0xf5e147ff).into(),
},
git: GitStatusColors {
conflict: rgba(0xffa057ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
ignored: rgba(0xb0b4baff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
},
player: PlayerColors(vec![
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
]),
syntax: SyntaxTheme {
highlights: vec![
("attribute".into(), rgba(0x4ccce6ff).into()),
("boolean".into(), rgba(0xff977dff).into()),
("comment".into(), rgba(0xb0b4baff).into()),
("comment.doc".into(), rgba(0xe0dffeff).into()),
("constant".into(), rgba(0x8c323aff).into()),
("constructor".into(), rgba(0x8c323aff).into()),
("embedded".into(), rgba(0x8c323aff).into()),
("emphasis".into(), rgba(0x8c323aff).into()),
("emphasis.strong".into(), rgba(0x8c323aff).into()),
("enum".into(), rgba(0x8c323aff).into()),
("function".into(), rgba(0x8c323aff).into()),
("hint".into(), rgba(0x8c323aff).into()),
("keyword".into(), rgba(0xffa057ff).into()),
("label".into(), rgba(0x8c323aff).into()),
("link_text".into(), rgba(0x8c323aff).into()),
("link_uri".into(), rgba(0x8c323aff).into()),
("number".into(), rgba(0x8c323aff).into()),
("operator".into(), rgba(0x8c323aff).into()),
("predictive".into(), rgba(0x8c323aff).into()),
("preproc".into(), rgba(0x8c323aff).into()),
("primary".into(), rgba(0x8c323aff).into()),
("property".into(), rgba(0x8c323aff).into()),
("punctuation".into(), rgba(0xb0b4baff).into()),
("punctuation.bracket".into(), rgba(0xb0b4baff).into()),
("punctuation.delimiter".into(), rgba(0xb0b4baff).into()),
("punctuation.list_marker".into(), rgba(0x6fb8ffff).into()),
("punctuation.special".into(), rgba(0x8c323aff).into()),
("string".into(), rgba(0x1ed8a3ff).into()),
("string.escape".into(), rgba(0x8c323aff).into()),
("string.regex".into(), rgba(0xff977dff).into()),
("string.special".into(), rgba(0x8c323aff).into()),
("string.special.symbol".into(), rgba(0x8c323aff).into()),
("tag".into(), rgba(0x8c323aff).into()),
("text.literal".into(), rgba(0x8c323aff).into()),
("title".into(), rgba(0x8c323aff).into()),
("type".into(), rgba(0x8c323aff).into()),
("variable".into(), rgba(0x8c323aff).into()),
("variable.special".into(), rgba(0x8c323aff).into()),
("variant".into(), rgba(0x8c323aff).into()),
],
styles: UserThemeStylesRefinement {
colors: ThemeColorsRefinement {
border: Some(rgba(0x171a24ff).into()),
border_variant: Some(rgba(0x171a24ff).into()),
border_focused: Some(rgba(0x171a24ff).into()),
border_selected: Some(rgba(0x171a24ff).into()),
border_transparent: Some(rgba(0x171a24ff).into()),
border_disabled: Some(rgba(0x171a24ff).into()),
elevated_surface_background: Some(rgba(0x1f2430ff).into()),
surface_background: Some(rgba(0x1f2430ff).into()),
background: Some(rgba(0x1f2430ff).into()),
element_background: Some(rgba(0xffcb65ff).into()),
text: Some(rgba(0x707a8cff).into()),
tab_inactive_background: Some(rgba(0x1f2430ff).into()),
tab_active_background: Some(rgba(0x1f2430ff).into()),
terminal_background: Some(rgba(0x1f2430ff).into()),
terminal_ansi_bright_black: Some(rgba(0x686868ff).into()),
terminal_ansi_bright_red: Some(rgba(0xf18678ff).into()),
terminal_ansi_bright_green: Some(rgba(0xd4fe7fff).into()),
terminal_ansi_bright_yellow: Some(rgba(0xffd173ff).into()),
terminal_ansi_bright_blue: Some(rgba(0x73cfffff).into()),
terminal_ansi_bright_magenta: Some(rgba(0xdfbfffff).into()),
terminal_ansi_bright_cyan: Some(rgba(0x95e6cbff).into()),
terminal_ansi_bright_white: Some(rgba(0xffffffff).into()),
terminal_ansi_black: Some(rgba(0x171a24ff).into()),
terminal_ansi_red: Some(rgba(0xed8173ff).into()),
terminal_ansi_green: Some(rgba(0x86d96bff).into()),
terminal_ansi_yellow: Some(rgba(0xfacc6eff).into()),
terminal_ansi_blue: Some(rgba(0x6ccafaff).into()),
terminal_ansi_magenta: Some(rgba(0xdabafaff).into()),
terminal_ansi_cyan: Some(rgba(0x90e1c6ff).into()),
terminal_ansi_white: Some(rgba(0xc7c7c7ff).into()),
..Default::default()
},
},
},
Theme {
id: "22d8dede-57da-46e1-946a-16876679b4d2".into(),
UserTheme {
name: "Ayu Dark".into(),
appearance: Appearance::Dark,
styles: ThemeStyles {
system: SystemColors {
transparent: rgba(0x00000000).into(),
mac_os_traffic_light_red: rgba(0xec6b5fff).into(),
mac_os_traffic_light_yellow: rgba(0xf3bf4dff).into(),
mac_os_traffic_light_green: rgba(0x61c454ff).into(),
},
colors: ThemeColors {
border: rgba(0x1e232bff).into(),
border_variant: rgba(0x1e232bff).into(),
border_focused: rgba(0x1e232bff).into(),
border_selected: rgba(0x1e232bff).into(),
border_transparent: rgba(0x1e232bff).into(),
border_disabled: rgba(0x1e232bff).into(),
elevated_surface_background: rgba(0x0b0e14ff).into(),
surface_background: rgba(0x0b0e14ff).into(),
background: rgba(0x0b0e14ff).into(),
element_background: rgba(0xe6b450ff).into(),
element_hover: rgba(0x272a2dff).into(),
element_active: rgba(0x2e3135ff).into(),
element_selected: rgba(0x2e3135ff).into(),
element_disabled: rgba(0xddeaf814).into(),
element_placeholder: rgba(0xb0b4baff).into(),
element_drop_target: rgba(0x1166fb18).into(),
ghost_element_background: rgba(0x00000000).into(),
ghost_element_hover: rgba(0x272a2dff).into(),
ghost_element_active: rgba(0x2e3135ff).into(),
ghost_element_selected: rgba(0x2e3135ff).into(),
ghost_element_disabled: rgba(0xddeaf814).into(),
text: rgba(0x565b66ff).into(),
text_muted: rgba(0xb0b4baff).into(),
text_placeholder: rgba(0x767a83ff).into(),
text_disabled: rgba(0x696e77ff).into(),
text_accent: rgba(0x6fb8ffff).into(),
icon: rgba(0xb0b4baff).into(),
icon_muted: rgba(0x767a83ff).into(),
icon_disabled: rgba(0x696e77ff).into(),
icon_placeholder: rgba(0x767a83ff).into(),
icon_accent: rgba(0x6fb8ffff).into(),
status_bar_background: rgba(0x18191bff).into(),
title_bar_background: rgba(0x18191bff).into(),
toolbar_background: rgba(0x111113ff).into(),
tab_bar_background: rgba(0x18191bff).into(),
tab_inactive_background: rgba(0x0b0e14ff).into(),
tab_active_background: rgba(0x0b0e14ff).into(),
editor_background: rgba(0x111113ff).into(),
editor_gutter_background: rgba(0x111113ff).into(),
editor_subheader_background: rgba(0x18191bff).into(),
editor_active_line_background: rgba(0xddeaf814).into(),
editor_highlighted_line_background: rgba(0xd3edf81d).into(),
editor_line_number: rgba(0xddeaf814).into(),
editor_active_line_number: rgba(0xddeaf814).into(),
editor_invisible: rgba(0xd3edf81d).into(),
editor_wrap_guide: rgba(0xd3edf81d).into(),
editor_active_wrap_guide: rgba(0xd3edf81d).into(),
editor_document_highlight_read_background: rgba(0xd3edf81d).into(),
editor_document_highlight_write_background: rgba(0xd3edf81d).into(),
terminal_background: rgba(0x0b0e14ff).into(),
terminal_ansi_bright_black: rgba(0x686868ff).into(),
terminal_ansi_bright_red: rgba(0xef7077ff).into(),
terminal_ansi_bright_green: rgba(0xa9d94bff).into(),
terminal_ansi_bright_yellow: rgba(0xffb353ff).into(),
terminal_ansi_bright_blue: rgba(0x59c2ffff).into(),
terminal_ansi_bright_magenta: rgba(0xd2a6ffff).into(),
terminal_ansi_bright_cyan: rgba(0x95e6cbff).into(),
terminal_ansi_bright_white: rgba(0xffffffff).into(),
terminal_ansi_black: rgba(0x1e232bff).into(),
terminal_ansi_red: rgba(0xea6c72ff).into(),
terminal_ansi_green: rgba(0x7ed962ff).into(),
terminal_ansi_yellow: rgba(0xf9af4fff).into(),
terminal_ansi_blue: rgba(0x52bdfaff).into(),
terminal_ansi_magenta: rgba(0xcca1faff).into(),
terminal_ansi_cyan: rgba(0x90e1c6ff).into(),
terminal_ansi_white: rgba(0xc7c7c7ff).into(),
},
status: StatusColors {
conflict: rgba(0xff9592ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
error: rgba(0xff9592ff).into(),
hidden: rgba(0xb0b4baff).into(),
ignored: rgba(0xb0b4baff).into(),
info: rgba(0x6fb8ffff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
success: rgba(0x70cf82ff).into(),
warning: rgba(0xf5e147ff).into(),
},
git: GitStatusColors {
conflict: rgba(0xffa057ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
ignored: rgba(0xb0b4baff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
},
player: PlayerColors(vec![
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
]),
syntax: SyntaxTheme {
highlights: vec![
("attribute".into(), rgba(0x4ccce6ff).into()),
("boolean".into(), rgba(0xff977dff).into()),
("comment".into(), rgba(0xb0b4baff).into()),
("comment.doc".into(), rgba(0xe0dffeff).into()),
("constant".into(), rgba(0x8c323aff).into()),
("constructor".into(), rgba(0x8c323aff).into()),
("embedded".into(), rgba(0x8c323aff).into()),
("emphasis".into(), rgba(0x8c323aff).into()),
("emphasis.strong".into(), rgba(0x8c323aff).into()),
("enum".into(), rgba(0x8c323aff).into()),
("function".into(), rgba(0x8c323aff).into()),
("hint".into(), rgba(0x8c323aff).into()),
("keyword".into(), rgba(0xffa057ff).into()),
("label".into(), rgba(0x8c323aff).into()),
("link_text".into(), rgba(0x8c323aff).into()),
("link_uri".into(), rgba(0x8c323aff).into()),
("number".into(), rgba(0x8c323aff).into()),
("operator".into(), rgba(0x8c323aff).into()),
("predictive".into(), rgba(0x8c323aff).into()),
("preproc".into(), rgba(0x8c323aff).into()),
("primary".into(), rgba(0x8c323aff).into()),
("property".into(), rgba(0x8c323aff).into()),
("punctuation".into(), rgba(0xb0b4baff).into()),
("punctuation.bracket".into(), rgba(0xb0b4baff).into()),
("punctuation.delimiter".into(), rgba(0xb0b4baff).into()),
("punctuation.list_marker".into(), rgba(0x6fb8ffff).into()),
("punctuation.special".into(), rgba(0x8c323aff).into()),
("string".into(), rgba(0x1ed8a3ff).into()),
("string.escape".into(), rgba(0x8c323aff).into()),
("string.regex".into(), rgba(0xff977dff).into()),
("string.special".into(), rgba(0x8c323aff).into()),
("string.special.symbol".into(), rgba(0x8c323aff).into()),
("tag".into(), rgba(0x8c323aff).into()),
("text.literal".into(), rgba(0x8c323aff).into()),
("title".into(), rgba(0x8c323aff).into()),
("type".into(), rgba(0x8c323aff).into()),
("variable".into(), rgba(0x8c323aff).into()),
("variable.special".into(), rgba(0x8c323aff).into()),
("variant".into(), rgba(0x8c323aff).into()),
],
styles: UserThemeStylesRefinement {
colors: ThemeColorsRefinement {
border: Some(rgba(0x1e232bff).into()),
border_variant: Some(rgba(0x1e232bff).into()),
border_focused: Some(rgba(0x1e232bff).into()),
border_selected: Some(rgba(0x1e232bff).into()),
border_transparent: Some(rgba(0x1e232bff).into()),
border_disabled: Some(rgba(0x1e232bff).into()),
elevated_surface_background: Some(rgba(0x0b0e14ff).into()),
surface_background: Some(rgba(0x0b0e14ff).into()),
background: Some(rgba(0x0b0e14ff).into()),
element_background: Some(rgba(0xe6b450ff).into()),
text: Some(rgba(0x565b66ff).into()),
tab_inactive_background: Some(rgba(0x0b0e14ff).into()),
tab_active_background: Some(rgba(0x0b0e14ff).into()),
terminal_background: Some(rgba(0x0b0e14ff).into()),
terminal_ansi_bright_black: Some(rgba(0x686868ff).into()),
terminal_ansi_bright_red: Some(rgba(0xef7077ff).into()),
terminal_ansi_bright_green: Some(rgba(0xa9d94bff).into()),
terminal_ansi_bright_yellow: Some(rgba(0xffb353ff).into()),
terminal_ansi_bright_blue: Some(rgba(0x59c2ffff).into()),
terminal_ansi_bright_magenta: Some(rgba(0xd2a6ffff).into()),
terminal_ansi_bright_cyan: Some(rgba(0x95e6cbff).into()),
terminal_ansi_bright_white: Some(rgba(0xffffffff).into()),
terminal_ansi_black: Some(rgba(0x1e232bff).into()),
terminal_ansi_red: Some(rgba(0xea6c72ff).into()),
terminal_ansi_green: Some(rgba(0x7ed962ff).into()),
terminal_ansi_yellow: Some(rgba(0xf9af4fff).into()),
terminal_ansi_blue: Some(rgba(0x52bdfaff).into()),
terminal_ansi_magenta: Some(rgba(0xcca1faff).into()),
terminal_ansi_cyan: Some(rgba(0x90e1c6ff).into()),
terminal_ansi_white: Some(rgba(0xc7c7c7ff).into()),
..Default::default()
},
},
},
],
scales: default_color_scales(),
}
}

View File

@ -1,182 +1,51 @@
use gpui::rgba;
use crate::{
default_color_scales, Appearance, GitStatusColors, PlayerColor, PlayerColors, StatusColors,
SyntaxTheme, SystemColors, Theme, ThemeColors, ThemeFamily, ThemeStyles,
Appearance, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement,
};
pub fn dracula() -> ThemeFamily {
ThemeFamily {
id: "0abb0e55-f034-45d9-a84d-e880dfd65711".into(),
pub fn dracula() -> UserThemeFamily {
UserThemeFamily {
name: "Dracula".into(),
author: "Zeno Rocha".into(),
themes: vec![Theme {
id: "d20497ef-85be-4ea2-9070-a182d03aac73".into(),
themes: vec![UserTheme {
name: "Dracula".into(),
appearance: Appearance::Dark,
styles: ThemeStyles {
system: SystemColors {
transparent: rgba(0x00000000).into(),
mac_os_traffic_light_red: rgba(0xec6b5fff).into(),
mac_os_traffic_light_yellow: rgba(0xf3bf4dff).into(),
mac_os_traffic_light_green: rgba(0x61c454ff).into(),
},
colors: ThemeColors {
border: rgba(0xbd93f9ff).into(),
border_variant: rgba(0xbd93f9ff).into(),
border_focused: rgba(0xbd93f9ff).into(),
border_selected: rgba(0xbd93f9ff).into(),
border_transparent: rgba(0xbd93f9ff).into(),
border_disabled: rgba(0xbd93f9ff).into(),
elevated_surface_background: rgba(0x282a35ff).into(),
surface_background: rgba(0x282a35ff).into(),
background: rgba(0x282a35ff).into(),
element_background: rgba(0x44475aff).into(),
element_hover: rgba(0x272a2dff).into(),
element_active: rgba(0x2e3135ff).into(),
element_selected: rgba(0x2e3135ff).into(),
element_disabled: rgba(0xddeaf814).into(),
element_placeholder: rgba(0xb0b4baff).into(),
element_drop_target: rgba(0x1166fb18).into(),
ghost_element_background: rgba(0x00000000).into(),
ghost_element_hover: rgba(0x272a2dff).into(),
ghost_element_active: rgba(0x2e3135ff).into(),
ghost_element_selected: rgba(0x2e3135ff).into(),
ghost_element_disabled: rgba(0xddeaf814).into(),
text: rgba(0xf8f8f2ff).into(),
text_muted: rgba(0xb0b4baff).into(),
text_placeholder: rgba(0x767a83ff).into(),
text_disabled: rgba(0x696e77ff).into(),
text_accent: rgba(0x6fb8ffff).into(),
icon: rgba(0xb0b4baff).into(),
icon_muted: rgba(0x767a83ff).into(),
icon_disabled: rgba(0x696e77ff).into(),
icon_placeholder: rgba(0x767a83ff).into(),
icon_accent: rgba(0x6fb8ffff).into(),
status_bar_background: rgba(0x18191bff).into(),
title_bar_background: rgba(0x18191bff).into(),
toolbar_background: rgba(0x111113ff).into(),
tab_bar_background: rgba(0x18191bff).into(),
tab_inactive_background: rgba(0x21222cff).into(),
tab_active_background: rgba(0x282a35ff).into(),
editor_background: rgba(0x111113ff).into(),
editor_gutter_background: rgba(0x111113ff).into(),
editor_subheader_background: rgba(0x18191bff).into(),
editor_active_line_background: rgba(0xddeaf814).into(),
editor_highlighted_line_background: rgba(0xd3edf81d).into(),
editor_line_number: rgba(0xddeaf814).into(),
editor_active_line_number: rgba(0xddeaf814).into(),
editor_invisible: rgba(0xd3edf81d).into(),
editor_wrap_guide: rgba(0xd3edf81d).into(),
editor_active_wrap_guide: rgba(0xd3edf81d).into(),
editor_document_highlight_read_background: rgba(0xd3edf81d).into(),
editor_document_highlight_write_background: rgba(0xd3edf81d).into(),
terminal_background: rgba(0x282a35ff).into(),
terminal_ansi_bright_black: rgba(0x6272a4ff).into(),
terminal_ansi_bright_red: rgba(0xff6d6dff).into(),
terminal_ansi_bright_green: rgba(0x69ff94ff).into(),
terminal_ansi_bright_yellow: rgba(0xffffa5ff).into(),
terminal_ansi_bright_blue: rgba(0xd6abfeff).into(),
terminal_ansi_bright_magenta: rgba(0xff92dfff).into(),
terminal_ansi_bright_cyan: rgba(0xa3fefeff).into(),
terminal_ansi_bright_white: rgba(0xffffffff).into(),
terminal_ansi_black: rgba(0x21222cff).into(),
terminal_ansi_red: rgba(0xff5555ff).into(),
terminal_ansi_green: rgba(0x50fa7bff).into(),
terminal_ansi_yellow: rgba(0xf1fa8cff).into(),
terminal_ansi_blue: rgba(0xbd93f9ff).into(),
terminal_ansi_magenta: rgba(0xff79c6ff).into(),
terminal_ansi_cyan: rgba(0x8be9fdff).into(),
terminal_ansi_white: rgba(0xf8f8f2ff).into(),
},
status: StatusColors {
conflict: rgba(0xff9592ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
error: rgba(0xff9592ff).into(),
hidden: rgba(0xb0b4baff).into(),
ignored: rgba(0xb0b4baff).into(),
info: rgba(0x6fb8ffff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
success: rgba(0x70cf82ff).into(),
warning: rgba(0xf5e147ff).into(),
},
git: GitStatusColors {
conflict: rgba(0xffa057ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
ignored: rgba(0xb0b4baff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
},
player: PlayerColors(vec![
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
]),
syntax: SyntaxTheme {
highlights: vec![
("attribute".into(), rgba(0x4ccce6ff).into()),
("boolean".into(), rgba(0xff977dff).into()),
("comment".into(), rgba(0xb0b4baff).into()),
("comment.doc".into(), rgba(0xe0dffeff).into()),
("constant".into(), rgba(0x8c323aff).into()),
("constructor".into(), rgba(0x8c323aff).into()),
("embedded".into(), rgba(0x8c323aff).into()),
("emphasis".into(), rgba(0x8c323aff).into()),
("emphasis.strong".into(), rgba(0x8c323aff).into()),
("enum".into(), rgba(0x8c323aff).into()),
("function".into(), rgba(0x8c323aff).into()),
("hint".into(), rgba(0x8c323aff).into()),
("keyword".into(), rgba(0xffa057ff).into()),
("label".into(), rgba(0x8c323aff).into()),
("link_text".into(), rgba(0x8c323aff).into()),
("link_uri".into(), rgba(0x8c323aff).into()),
("number".into(), rgba(0x8c323aff).into()),
("operator".into(), rgba(0x8c323aff).into()),
("predictive".into(), rgba(0x8c323aff).into()),
("preproc".into(), rgba(0x8c323aff).into()),
("primary".into(), rgba(0x8c323aff).into()),
("property".into(), rgba(0x8c323aff).into()),
("punctuation".into(), rgba(0xb0b4baff).into()),
("punctuation.bracket".into(), rgba(0xb0b4baff).into()),
("punctuation.delimiter".into(), rgba(0xb0b4baff).into()),
("punctuation.list_marker".into(), rgba(0x6fb8ffff).into()),
("punctuation.special".into(), rgba(0x8c323aff).into()),
("string".into(), rgba(0x1ed8a3ff).into()),
("string.escape".into(), rgba(0x8c323aff).into()),
("string.regex".into(), rgba(0xff977dff).into()),
("string.special".into(), rgba(0x8c323aff).into()),
("string.special.symbol".into(), rgba(0x8c323aff).into()),
("tag".into(), rgba(0x8c323aff).into()),
("text.literal".into(), rgba(0x8c323aff).into()),
("title".into(), rgba(0x8c323aff).into()),
("type".into(), rgba(0x8c323aff).into()),
("variable".into(), rgba(0x8c323aff).into()),
("variable.special".into(), rgba(0x8c323aff).into()),
("variant".into(), rgba(0x8c323aff).into()),
],
styles: UserThemeStylesRefinement {
colors: ThemeColorsRefinement {
border: Some(rgba(0xbd93f9ff).into()),
border_variant: Some(rgba(0xbd93f9ff).into()),
border_focused: Some(rgba(0xbd93f9ff).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()),
text: Some(rgba(0xf8f8f2ff).into()),
tab_inactive_background: Some(rgba(0x21222cff).into()),
tab_active_background: Some(rgba(0x282a35ff).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()
},
},
}],
scales: default_color_scales(),
}
}

File diff suppressed because it is too large Load Diff

View File

@ -22,9 +22,9 @@ pub use rose_pine::*;
pub use solarized::*;
pub use synthwave_84::*;
use crate::ThemeFamily;
use crate::UserThemeFamily;
pub(crate) fn all_imported_themes() -> Vec<ThemeFamily> {
pub(crate) fn all_imported_themes() -> Vec<UserThemeFamily> {
vec![
rose_pine(),
night_owl(),

View File

@ -1,351 +1,91 @@
use gpui::rgba;
use crate::{
default_color_scales, Appearance, GitStatusColors, PlayerColor, PlayerColors, StatusColors,
SyntaxTheme, SystemColors, Theme, ThemeColors, ThemeFamily, ThemeStyles,
Appearance, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement,
};
pub fn night_owl() -> ThemeFamily {
ThemeFamily {
id: "19498197-1091-409d-b37a-a282998e5c31".into(),
pub fn night_owl() -> UserThemeFamily {
UserThemeFamily {
name: "Night Owl".into(),
author: "Sarah Drasner (sdras)".into(),
themes: vec![
Theme {
id: "e5de91ed-fc95-46fb-a60b-ebd0602d04c7".into(),
UserTheme {
name: "Night Owl".into(),
appearance: Appearance::Dark,
styles: ThemeStyles {
system: SystemColors {
transparent: rgba(0x00000000).into(),
mac_os_traffic_light_red: rgba(0xec6b5fff).into(),
mac_os_traffic_light_yellow: rgba(0xf3bf4dff).into(),
mac_os_traffic_light_green: rgba(0x61c454ff).into(),
},
colors: ThemeColors {
border: rgba(0x5f7e97ff).into(),
border_variant: rgba(0x5f7e97ff).into(),
border_focused: rgba(0x5f7e97ff).into(),
border_selected: rgba(0x5f7e97ff).into(),
border_transparent: rgba(0x5f7e97ff).into(),
border_disabled: rgba(0x5f7e97ff).into(),
elevated_surface_background: rgba(0x011526ff).into(),
surface_background: rgba(0x011526ff).into(),
background: rgba(0x011526ff).into(),
element_background: rgba(0x7d56c1cc).into(),
element_hover: rgba(0x272a2dff).into(),
element_active: rgba(0x2e3135ff).into(),
element_selected: rgba(0x2e3135ff).into(),
element_disabled: rgba(0xddeaf814).into(),
element_placeholder: rgba(0xb0b4baff).into(),
element_drop_target: rgba(0x1166fb18).into(),
ghost_element_background: rgba(0x00000000).into(),
ghost_element_hover: rgba(0x272a2dff).into(),
ghost_element_active: rgba(0x2e3135ff).into(),
ghost_element_selected: rgba(0x2e3135ff).into(),
ghost_element_disabled: rgba(0xddeaf814).into(),
text: rgba(0xd6deebff).into(),
text_muted: rgba(0xb0b4baff).into(),
text_placeholder: rgba(0x767a83ff).into(),
text_disabled: rgba(0x696e77ff).into(),
text_accent: rgba(0x6fb8ffff).into(),
icon: rgba(0xb0b4baff).into(),
icon_muted: rgba(0x767a83ff).into(),
icon_disabled: rgba(0x696e77ff).into(),
icon_placeholder: rgba(0x767a83ff).into(),
icon_accent: rgba(0x6fb8ffff).into(),
status_bar_background: rgba(0x18191bff).into(),
title_bar_background: rgba(0x18191bff).into(),
toolbar_background: rgba(0x111113ff).into(),
tab_bar_background: rgba(0x18191bff).into(),
tab_inactive_background: rgba(0x01101cff).into(),
tab_active_background: rgba(0x0a2842ff).into(),
editor_background: rgba(0x111113ff).into(),
editor_gutter_background: rgba(0x111113ff).into(),
editor_subheader_background: rgba(0x18191bff).into(),
editor_active_line_background: rgba(0xddeaf814).into(),
editor_highlighted_line_background: rgba(0xd3edf81d).into(),
editor_line_number: rgba(0xddeaf814).into(),
editor_active_line_number: rgba(0xddeaf814).into(),
editor_invisible: rgba(0xd3edf81d).into(),
editor_wrap_guide: rgba(0xd3edf81d).into(),
editor_active_wrap_guide: rgba(0xd3edf81d).into(),
editor_document_highlight_read_background: rgba(0xd3edf81d).into(),
editor_document_highlight_write_background: rgba(0xd3edf81d).into(),
terminal_background: rgba(0x111113ff).into(),
terminal_ansi_bright_black: rgba(0x575656ff).into(),
terminal_ansi_bright_red: rgba(0xef524fff).into(),
terminal_ansi_bright_green: rgba(0x21da6eff).into(),
terminal_ansi_bright_yellow: rgba(0xffeb95ff).into(),
terminal_ansi_bright_blue: rgba(0x82aaffff).into(),
terminal_ansi_bright_magenta: rgba(0xc792eaff).into(),
terminal_ansi_bright_cyan: rgba(0x7fdbcaff).into(),
terminal_ansi_bright_white: rgba(0xffffffff).into(),
terminal_ansi_black: rgba(0x011526ff).into(),
terminal_ansi_red: rgba(0xef524fff).into(),
terminal_ansi_green: rgba(0x21da6eff).into(),
terminal_ansi_yellow: rgba(0xc5e478ff).into(),
terminal_ansi_blue: rgba(0x82aaffff).into(),
terminal_ansi_magenta: rgba(0xc792eaff).into(),
terminal_ansi_cyan: rgba(0x20c7a7ff).into(),
terminal_ansi_white: rgba(0xffffffff).into(),
},
status: StatusColors {
conflict: rgba(0xff9592ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
error: rgba(0xff9592ff).into(),
hidden: rgba(0xb0b4baff).into(),
ignored: rgba(0xb0b4baff).into(),
info: rgba(0x6fb8ffff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
success: rgba(0x70cf82ff).into(),
warning: rgba(0xf5e147ff).into(),
},
git: GitStatusColors {
conflict: rgba(0xffa057ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
ignored: rgba(0xb0b4baff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
},
player: PlayerColors(vec![
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
]),
syntax: SyntaxTheme {
highlights: vec![
("attribute".into(), rgba(0x4ccce6ff).into()),
("boolean".into(), rgba(0xff977dff).into()),
("comment".into(), rgba(0xb0b4baff).into()),
("comment.doc".into(), rgba(0xe0dffeff).into()),
("constant".into(), rgba(0x8c323aff).into()),
("constructor".into(), rgba(0x8c323aff).into()),
("embedded".into(), rgba(0x8c323aff).into()),
("emphasis".into(), rgba(0x8c323aff).into()),
("emphasis.strong".into(), rgba(0x8c323aff).into()),
("enum".into(), rgba(0x8c323aff).into()),
("function".into(), rgba(0x8c323aff).into()),
("hint".into(), rgba(0x8c323aff).into()),
("keyword".into(), rgba(0xffa057ff).into()),
("label".into(), rgba(0x8c323aff).into()),
("link_text".into(), rgba(0x8c323aff).into()),
("link_uri".into(), rgba(0x8c323aff).into()),
("number".into(), rgba(0x8c323aff).into()),
("operator".into(), rgba(0x8c323aff).into()),
("predictive".into(), rgba(0x8c323aff).into()),
("preproc".into(), rgba(0x8c323aff).into()),
("primary".into(), rgba(0x8c323aff).into()),
("property".into(), rgba(0x8c323aff).into()),
("punctuation".into(), rgba(0xb0b4baff).into()),
("punctuation.bracket".into(), rgba(0xb0b4baff).into()),
("punctuation.delimiter".into(), rgba(0xb0b4baff).into()),
("punctuation.list_marker".into(), rgba(0x6fb8ffff).into()),
("punctuation.special".into(), rgba(0x8c323aff).into()),
("string".into(), rgba(0x1ed8a3ff).into()),
("string.escape".into(), rgba(0x8c323aff).into()),
("string.regex".into(), rgba(0xff977dff).into()),
("string.special".into(), rgba(0x8c323aff).into()),
("string.special.symbol".into(), rgba(0x8c323aff).into()),
("tag".into(), rgba(0x8c323aff).into()),
("text.literal".into(), rgba(0x8c323aff).into()),
("title".into(), rgba(0x8c323aff).into()),
("type".into(), rgba(0x8c323aff).into()),
("variable".into(), rgba(0x8c323aff).into()),
("variable.special".into(), rgba(0x8c323aff).into()),
("variant".into(), rgba(0x8c323aff).into()),
],
styles: UserThemeStylesRefinement {
colors: ThemeColorsRefinement {
border: Some(rgba(0x5f7e97ff).into()),
border_variant: Some(rgba(0x5f7e97ff).into()),
border_focused: Some(rgba(0x5f7e97ff).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()),
text: Some(rgba(0xd6deebff).into()),
tab_inactive_background: Some(rgba(0x01101cff).into()),
tab_active_background: Some(rgba(0x0a2842ff).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()
},
},
},
Theme {
id: "998fc053-40c1-4a32-a31f-a17c9c07949a".into(),
UserTheme {
name: "Night Owl Light".into(),
appearance: Appearance::Light,
styles: ThemeStyles {
system: SystemColors {
transparent: rgba(0x00000000).into(),
mac_os_traffic_light_red: rgba(0xec6b5fff).into(),
mac_os_traffic_light_yellow: rgba(0xf3bf4dff).into(),
mac_os_traffic_light_green: rgba(0x61c454ff).into(),
},
colors: ThemeColors {
border: rgba(0xd9d9d9ff).into(),
border_variant: rgba(0xd9d9d9ff).into(),
border_focused: rgba(0xd9d9d9ff).into(),
border_selected: rgba(0xd9d9d9ff).into(),
border_transparent: rgba(0xd9d9d9ff).into(),
border_disabled: rgba(0xd9d9d9ff).into(),
elevated_surface_background: rgba(0xf0f0f0ff).into(),
surface_background: rgba(0xf0f0f0ff).into(),
background: rgba(0xfbfbfbff).into(),
element_background: rgba(0x29a298ff).into(),
element_hover: rgba(0xe8e8ecff).into(),
element_active: rgba(0xe0e1e6ff).into(),
element_selected: rgba(0xe0e1e6ff).into(),
element_disabled: rgba(0x0000320f).into(),
element_placeholder: rgba(0x60646cff).into(),
element_drop_target: rgba(0x008bff0b).into(),
ghost_element_background: rgba(0x00000000).into(),
ghost_element_hover: rgba(0xe8e8ecff).into(),
ghost_element_active: rgba(0xe0e1e6ff).into(),
ghost_element_selected: rgba(0xe0e1e6ff).into(),
ghost_element_disabled: rgba(0x0000320f).into(),
text: rgba(0x403f53ff).into(),
text_muted: rgba(0x60646cff).into(),
text_placeholder: rgba(0x80838dff).into(),
text_disabled: rgba(0x8b8d98ff).into(),
text_accent: rgba(0x0c73ceff).into(),
icon: rgba(0x60646cff).into(),
icon_muted: rgba(0x80838dff).into(),
icon_disabled: rgba(0x8b8d98ff).into(),
icon_placeholder: rgba(0x80838dff).into(),
icon_accent: rgba(0x0c73ceff).into(),
status_bar_background: rgba(0xf9f9fbff).into(),
title_bar_background: rgba(0xf9f9fbff).into(),
toolbar_background: rgba(0xfcfcfdff).into(),
tab_bar_background: rgba(0xf9f9fbff).into(),
tab_inactive_background: rgba(0xf0f0f0ff).into(),
tab_active_background: rgba(0xf6f6f6ff).into(),
editor_background: rgba(0xfcfcfdff).into(),
editor_gutter_background: rgba(0xfcfcfdff).into(),
editor_subheader_background: rgba(0xf9f9fbff).into(),
editor_active_line_background: rgba(0x0000320f).into(),
editor_highlighted_line_background: rgba(0x00002c17).into(),
editor_line_number: rgba(0x0000320f).into(),
editor_active_line_number: rgba(0x0000320f).into(),
editor_invisible: rgba(0x00002c17).into(),
editor_wrap_guide: rgba(0x00002c17).into(),
editor_active_wrap_guide: rgba(0x00002c17).into(),
editor_document_highlight_read_background: rgba(0x00002c17).into(),
editor_document_highlight_write_background: rgba(0x00002c17).into(),
terminal_background: rgba(0xf6f6f6ff).into(),
terminal_ansi_bright_black: rgba(0x403f53ff).into(),
terminal_ansi_bright_red: rgba(0xde3c3aff).into(),
terminal_ansi_bright_green: rgba(0x07916aff).into(),
terminal_ansi_bright_yellow: rgba(0xdaa900ff).into(),
terminal_ansi_bright_blue: rgba(0x278dd7ff).into(),
terminal_ansi_bright_magenta: rgba(0xd64289ff).into(),
terminal_ansi_bright_cyan: rgba(0x29a298ff).into(),
terminal_ansi_bright_white: rgba(0xf0f0f0ff).into(),
terminal_ansi_black: rgba(0x403f53ff).into(),
terminal_ansi_red: rgba(0xde3c3aff).into(),
terminal_ansi_green: rgba(0x07916aff).into(),
terminal_ansi_yellow: rgba(0xe0ae01ff).into(),
terminal_ansi_blue: rgba(0x278dd7ff).into(),
terminal_ansi_magenta: rgba(0xd64289ff).into(),
terminal_ansi_cyan: rgba(0x29a298ff).into(),
terminal_ansi_white: rgba(0xf0f0f0ff).into(),
},
status: StatusColors {
conflict: rgba(0xff9592ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
error: rgba(0xff9592ff).into(),
hidden: rgba(0xb0b4baff).into(),
ignored: rgba(0xb0b4baff).into(),
info: rgba(0x6fb8ffff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
success: rgba(0x70cf82ff).into(),
warning: rgba(0xf5e147ff).into(),
},
git: GitStatusColors {
conflict: rgba(0xffa057ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
ignored: rgba(0xb0b4baff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
},
player: PlayerColors(vec![
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
]),
syntax: SyntaxTheme {
highlights: vec![
("attribute".into(), rgba(0x4ccce6ff).into()),
("boolean".into(), rgba(0xff977dff).into()),
("comment".into(), rgba(0xb0b4baff).into()),
("comment.doc".into(), rgba(0xe0dffeff).into()),
("constant".into(), rgba(0x8c323aff).into()),
("constructor".into(), rgba(0x8c323aff).into()),
("embedded".into(), rgba(0x8c323aff).into()),
("emphasis".into(), rgba(0x8c323aff).into()),
("emphasis.strong".into(), rgba(0x8c323aff).into()),
("enum".into(), rgba(0x8c323aff).into()),
("function".into(), rgba(0x8c323aff).into()),
("hint".into(), rgba(0x8c323aff).into()),
("keyword".into(), rgba(0xffa057ff).into()),
("label".into(), rgba(0x8c323aff).into()),
("link_text".into(), rgba(0x8c323aff).into()),
("link_uri".into(), rgba(0x8c323aff).into()),
("number".into(), rgba(0x8c323aff).into()),
("operator".into(), rgba(0x8c323aff).into()),
("predictive".into(), rgba(0x8c323aff).into()),
("preproc".into(), rgba(0x8c323aff).into()),
("primary".into(), rgba(0x8c323aff).into()),
("property".into(), rgba(0x8c323aff).into()),
("punctuation".into(), rgba(0xb0b4baff).into()),
("punctuation.bracket".into(), rgba(0xb0b4baff).into()),
("punctuation.delimiter".into(), rgba(0xb0b4baff).into()),
("punctuation.list_marker".into(), rgba(0x6fb8ffff).into()),
("punctuation.special".into(), rgba(0x8c323aff).into()),
("string".into(), rgba(0x1ed8a3ff).into()),
("string.escape".into(), rgba(0x8c323aff).into()),
("string.regex".into(), rgba(0xff977dff).into()),
("string.special".into(), rgba(0x8c323aff).into()),
("string.special.symbol".into(), rgba(0x8c323aff).into()),
("tag".into(), rgba(0x8c323aff).into()),
("text.literal".into(), rgba(0x8c323aff).into()),
("title".into(), rgba(0x8c323aff).into()),
("type".into(), rgba(0x8c323aff).into()),
("variable".into(), rgba(0x8c323aff).into()),
("variable.special".into(), rgba(0x8c323aff).into()),
("variant".into(), rgba(0x8c323aff).into()),
],
styles: UserThemeStylesRefinement {
colors: ThemeColorsRefinement {
border: Some(rgba(0xd9d9d9ff).into()),
border_variant: Some(rgba(0xd9d9d9ff).into()),
border_focused: Some(rgba(0xd9d9d9ff).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()),
text: Some(rgba(0x403f53ff).into()),
tab_inactive_background: Some(rgba(0xf0f0f0ff).into()),
tab_active_background: Some(rgba(0xf6f6f6ff).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()
},
},
},
],
scales: default_color_scales(),
}
}

View File

@ -1,182 +1,51 @@
use gpui::rgba;
use crate::{
default_color_scales, Appearance, GitStatusColors, PlayerColor, PlayerColors, StatusColors,
SyntaxTheme, SystemColors, Theme, ThemeColors, ThemeFamily, ThemeStyles,
Appearance, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement,
};
pub fn nord() -> ThemeFamily {
ThemeFamily {
id: "3295b94b-731f-41a8-8d5e-ad02638f8e0d".into(),
pub fn nord() -> UserThemeFamily {
UserThemeFamily {
name: "Nord".into(),
author: "Sven Greb (svengreb)".into(),
themes: vec![Theme {
id: "dfdfd9f6-bc57-46dd-b919-42b18df35bdd".into(),
themes: vec![UserTheme {
name: "Nord".into(),
appearance: Appearance::Dark,
styles: ThemeStyles {
system: SystemColors {
transparent: rgba(0x00000000).into(),
mac_os_traffic_light_red: rgba(0xec6b5fff).into(),
mac_os_traffic_light_yellow: rgba(0xf3bf4dff).into(),
mac_os_traffic_light_green: rgba(0x61c454ff).into(),
},
colors: ThemeColors {
border: rgba(0x3b4252ff).into(),
border_variant: rgba(0x3b4252ff).into(),
border_focused: rgba(0x3b4252ff).into(),
border_selected: rgba(0x3b4252ff).into(),
border_transparent: rgba(0x3b4252ff).into(),
border_disabled: rgba(0x3b4252ff).into(),
elevated_surface_background: rgba(0x2e3440ff).into(),
surface_background: rgba(0x2e3440ff).into(),
background: rgba(0x2e3440ff).into(),
element_background: rgba(0x88bfd0ee).into(),
element_hover: rgba(0x272a2dff).into(),
element_active: rgba(0x2e3135ff).into(),
element_selected: rgba(0x2e3135ff).into(),
element_disabled: rgba(0xddeaf814).into(),
element_placeholder: rgba(0xb0b4baff).into(),
element_drop_target: rgba(0x1166fb18).into(),
ghost_element_background: rgba(0x00000000).into(),
ghost_element_hover: rgba(0x272a2dff).into(),
ghost_element_active: rgba(0x2e3135ff).into(),
ghost_element_selected: rgba(0x2e3135ff).into(),
ghost_element_disabled: rgba(0xddeaf814).into(),
text: rgba(0xd8dee9ff).into(),
text_muted: rgba(0xb0b4baff).into(),
text_placeholder: rgba(0x767a83ff).into(),
text_disabled: rgba(0x696e77ff).into(),
text_accent: rgba(0x6fb8ffff).into(),
icon: rgba(0xb0b4baff).into(),
icon_muted: rgba(0x767a83ff).into(),
icon_disabled: rgba(0x696e77ff).into(),
icon_placeholder: rgba(0x767a83ff).into(),
icon_accent: rgba(0x6fb8ffff).into(),
status_bar_background: rgba(0x18191bff).into(),
title_bar_background: rgba(0x18191bff).into(),
toolbar_background: rgba(0x111113ff).into(),
tab_bar_background: rgba(0x18191bff).into(),
tab_inactive_background: rgba(0x2e3440ff).into(),
tab_active_background: rgba(0x3b4252ff).into(),
editor_background: rgba(0x111113ff).into(),
editor_gutter_background: rgba(0x111113ff).into(),
editor_subheader_background: rgba(0x18191bff).into(),
editor_active_line_background: rgba(0xddeaf814).into(),
editor_highlighted_line_background: rgba(0xd3edf81d).into(),
editor_line_number: rgba(0xddeaf814).into(),
editor_active_line_number: rgba(0xddeaf814).into(),
editor_invisible: rgba(0xd3edf81d).into(),
editor_wrap_guide: rgba(0xd3edf81d).into(),
editor_active_wrap_guide: rgba(0xd3edf81d).into(),
editor_document_highlight_read_background: rgba(0xd3edf81d).into(),
editor_document_highlight_write_background: rgba(0xd3edf81d).into(),
terminal_background: rgba(0x2e3440ff).into(),
terminal_ansi_bright_black: rgba(0x4c566aff).into(),
terminal_ansi_bright_red: rgba(0xbf616aff).into(),
terminal_ansi_bright_green: rgba(0xa3be8cff).into(),
terminal_ansi_bright_yellow: rgba(0xebcb8bff).into(),
terminal_ansi_bright_blue: rgba(0x81a1c1ff).into(),
terminal_ansi_bright_magenta: rgba(0xb48eacff).into(),
terminal_ansi_bright_cyan: rgba(0x8fbcbbff).into(),
terminal_ansi_bright_white: rgba(0xeceff4ff).into(),
terminal_ansi_black: rgba(0x3b4252ff).into(),
terminal_ansi_red: rgba(0xbf616aff).into(),
terminal_ansi_green: rgba(0xa3be8cff).into(),
terminal_ansi_yellow: rgba(0xebcb8bff).into(),
terminal_ansi_blue: rgba(0x81a1c1ff).into(),
terminal_ansi_magenta: rgba(0xb48eacff).into(),
terminal_ansi_cyan: rgba(0x88bfd0ff).into(),
terminal_ansi_white: rgba(0xe5e9f0ff).into(),
},
status: StatusColors {
conflict: rgba(0xff9592ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
error: rgba(0xff9592ff).into(),
hidden: rgba(0xb0b4baff).into(),
ignored: rgba(0xb0b4baff).into(),
info: rgba(0x6fb8ffff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
success: rgba(0x70cf82ff).into(),
warning: rgba(0xf5e147ff).into(),
},
git: GitStatusColors {
conflict: rgba(0xffa057ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
ignored: rgba(0xb0b4baff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
},
player: PlayerColors(vec![
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
]),
syntax: SyntaxTheme {
highlights: vec![
("attribute".into(), rgba(0x4ccce6ff).into()),
("boolean".into(), rgba(0xff977dff).into()),
("comment".into(), rgba(0xb0b4baff).into()),
("comment.doc".into(), rgba(0xe0dffeff).into()),
("constant".into(), rgba(0x8c323aff).into()),
("constructor".into(), rgba(0x8c323aff).into()),
("embedded".into(), rgba(0x8c323aff).into()),
("emphasis".into(), rgba(0x8c323aff).into()),
("emphasis.strong".into(), rgba(0x8c323aff).into()),
("enum".into(), rgba(0x8c323aff).into()),
("function".into(), rgba(0x8c323aff).into()),
("hint".into(), rgba(0x8c323aff).into()),
("keyword".into(), rgba(0xffa057ff).into()),
("label".into(), rgba(0x8c323aff).into()),
("link_text".into(), rgba(0x8c323aff).into()),
("link_uri".into(), rgba(0x8c323aff).into()),
("number".into(), rgba(0x8c323aff).into()),
("operator".into(), rgba(0x8c323aff).into()),
("predictive".into(), rgba(0x8c323aff).into()),
("preproc".into(), rgba(0x8c323aff).into()),
("primary".into(), rgba(0x8c323aff).into()),
("property".into(), rgba(0x8c323aff).into()),
("punctuation".into(), rgba(0xb0b4baff).into()),
("punctuation.bracket".into(), rgba(0xb0b4baff).into()),
("punctuation.delimiter".into(), rgba(0xb0b4baff).into()),
("punctuation.list_marker".into(), rgba(0x6fb8ffff).into()),
("punctuation.special".into(), rgba(0x8c323aff).into()),
("string".into(), rgba(0x1ed8a3ff).into()),
("string.escape".into(), rgba(0x8c323aff).into()),
("string.regex".into(), rgba(0xff977dff).into()),
("string.special".into(), rgba(0x8c323aff).into()),
("string.special.symbol".into(), rgba(0x8c323aff).into()),
("tag".into(), rgba(0x8c323aff).into()),
("text.literal".into(), rgba(0x8c323aff).into()),
("title".into(), rgba(0x8c323aff).into()),
("type".into(), rgba(0x8c323aff).into()),
("variable".into(), rgba(0x8c323aff).into()),
("variable.special".into(), rgba(0x8c323aff).into()),
("variant".into(), rgba(0x8c323aff).into()),
],
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()),
text: Some(rgba(0xd8dee9ff).into()),
tab_inactive_background: Some(rgba(0x2e3440ff).into()),
tab_active_background: Some(rgba(0x3b4252ff).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()
},
},
}],
scales: default_color_scales(),
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,518 +1,128 @@
use gpui::rgba;
use crate::{
default_color_scales, Appearance, GitStatusColors, PlayerColor, PlayerColors, StatusColors,
SyntaxTheme, SystemColors, Theme, ThemeColors, ThemeFamily, ThemeStyles,
Appearance, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement,
};
pub fn palenight() -> ThemeFamily {
ThemeFamily {
id: "16313d66-dab6-468a-82f6-e69759fdd8cf".into(),
pub fn palenight() -> UserThemeFamily {
UserThemeFamily {
name: "Palenight".into(),
author: "Olaolu Olawuyi (whizkydee)".into(),
themes: vec![
Theme {
id: "39fdf216-2c76-4b3d-b368-7c31f479d524".into(),
UserTheme {
name: "Palenight".into(),
appearance: Appearance::Dark,
styles: ThemeStyles {
system: SystemColors {
transparent: rgba(0x00000000).into(),
mac_os_traffic_light_red: rgba(0xec6b5fff).into(),
mac_os_traffic_light_yellow: rgba(0xf3bf4dff).into(),
mac_os_traffic_light_green: rgba(0x61c454ff).into(),
},
colors: ThemeColors {
border: rgba(0x282b3bff).into(),
border_variant: rgba(0x282b3bff).into(),
border_focused: rgba(0x282b3bff).into(),
border_selected: rgba(0x282b3bff).into(),
border_transparent: rgba(0x282b3bff).into(),
border_disabled: rgba(0x282b3bff).into(),
elevated_surface_background: rgba(0x292c3eff).into(),
surface_background: rgba(0x292c3eff).into(),
background: rgba(0x292c3eff).into(),
element_background: rgba(0x7d56c1cc).into(),
element_hover: rgba(0x272a2dff).into(),
element_active: rgba(0x2e3135ff).into(),
element_selected: rgba(0x2e3135ff).into(),
element_disabled: rgba(0xddeaf814).into(),
element_placeholder: rgba(0xb0b4baff).into(),
element_drop_target: rgba(0x1166fb18).into(),
ghost_element_background: rgba(0x00000000).into(),
ghost_element_hover: rgba(0x272a2dff).into(),
ghost_element_active: rgba(0x2e3135ff).into(),
ghost_element_selected: rgba(0x2e3135ff).into(),
ghost_element_disabled: rgba(0xddeaf814).into(),
text: rgba(0xffffffff).into(),
text_muted: rgba(0xb0b4baff).into(),
text_placeholder: rgba(0x767a83ff).into(),
text_disabled: rgba(0x696e77ff).into(),
text_accent: rgba(0x6fb8ffff).into(),
icon: rgba(0xb0b4baff).into(),
icon_muted: rgba(0x767a83ff).into(),
icon_disabled: rgba(0x696e77ff).into(),
icon_placeholder: rgba(0x767a83ff).into(),
icon_accent: rgba(0x6fb8ffff).into(),
status_bar_background: rgba(0x18191bff).into(),
title_bar_background: rgba(0x18191bff).into(),
toolbar_background: rgba(0x111113ff).into(),
tab_bar_background: rgba(0x18191bff).into(),
tab_inactive_background: rgba(0x31364aff).into(),
tab_active_background: rgba(0x292c3eff).into(),
editor_background: rgba(0x111113ff).into(),
editor_gutter_background: rgba(0x111113ff).into(),
editor_subheader_background: rgba(0x18191bff).into(),
editor_active_line_background: rgba(0xddeaf814).into(),
editor_highlighted_line_background: rgba(0xd3edf81d).into(),
editor_line_number: rgba(0xddeaf814).into(),
editor_active_line_number: rgba(0xddeaf814).into(),
editor_invisible: rgba(0xd3edf81d).into(),
editor_wrap_guide: rgba(0xd3edf81d).into(),
editor_active_wrap_guide: rgba(0xd3edf81d).into(),
editor_document_highlight_read_background: rgba(0xd3edf81d).into(),
editor_document_highlight_write_background: rgba(0xd3edf81d).into(),
terminal_background: rgba(0x111113ff).into(),
terminal_ansi_bright_black: rgba(0x676e95ff).into(),
terminal_ansi_bright_red: rgba(0xff5571ff).into(),
terminal_ansi_bright_green: rgba(0xc3e88dff).into(),
terminal_ansi_bright_yellow: rgba(0xffcb6bff).into(),
terminal_ansi_bright_blue: rgba(0x82aaffff).into(),
terminal_ansi_bright_magenta: rgba(0xc792eaff).into(),
terminal_ansi_bright_cyan: rgba(0x89ddffff).into(),
terminal_ansi_bright_white: rgba(0xffffffff).into(),
terminal_ansi_black: rgba(0x676e95ff).into(),
terminal_ansi_red: rgba(0xff5571ff).into(),
terminal_ansi_green: rgba(0xa9c77dff).into(),
terminal_ansi_yellow: rgba(0xffcb6bff).into(),
terminal_ansi_blue: rgba(0x82aaffff).into(),
terminal_ansi_magenta: rgba(0xc792eaff).into(),
terminal_ansi_cyan: rgba(0x89ddffff).into(),
terminal_ansi_white: rgba(0xffffffff).into(),
},
status: StatusColors {
conflict: rgba(0xff9592ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
error: rgba(0xff9592ff).into(),
hidden: rgba(0xb0b4baff).into(),
ignored: rgba(0xb0b4baff).into(),
info: rgba(0x6fb8ffff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
success: rgba(0x70cf82ff).into(),
warning: rgba(0xf5e147ff).into(),
},
git: GitStatusColors {
conflict: rgba(0xffa057ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
ignored: rgba(0xb0b4baff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
},
player: PlayerColors(vec![
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
]),
syntax: SyntaxTheme {
highlights: vec![
("attribute".into(), rgba(0x4ccce6ff).into()),
("boolean".into(), rgba(0xff977dff).into()),
("comment".into(), rgba(0xb0b4baff).into()),
("comment.doc".into(), rgba(0xe0dffeff).into()),
("constant".into(), rgba(0x8c323aff).into()),
("constructor".into(), rgba(0x8c323aff).into()),
("embedded".into(), rgba(0x8c323aff).into()),
("emphasis".into(), rgba(0x8c323aff).into()),
("emphasis.strong".into(), rgba(0x8c323aff).into()),
("enum".into(), rgba(0x8c323aff).into()),
("function".into(), rgba(0x8c323aff).into()),
("hint".into(), rgba(0x8c323aff).into()),
("keyword".into(), rgba(0xffa057ff).into()),
("label".into(), rgba(0x8c323aff).into()),
("link_text".into(), rgba(0x8c323aff).into()),
("link_uri".into(), rgba(0x8c323aff).into()),
("number".into(), rgba(0x8c323aff).into()),
("operator".into(), rgba(0x8c323aff).into()),
("predictive".into(), rgba(0x8c323aff).into()),
("preproc".into(), rgba(0x8c323aff).into()),
("primary".into(), rgba(0x8c323aff).into()),
("property".into(), rgba(0x8c323aff).into()),
("punctuation".into(), rgba(0xb0b4baff).into()),
("punctuation.bracket".into(), rgba(0xb0b4baff).into()),
("punctuation.delimiter".into(), rgba(0xb0b4baff).into()),
("punctuation.list_marker".into(), rgba(0x6fb8ffff).into()),
("punctuation.special".into(), rgba(0x8c323aff).into()),
("string".into(), rgba(0x1ed8a3ff).into()),
("string.escape".into(), rgba(0x8c323aff).into()),
("string.regex".into(), rgba(0xff977dff).into()),
("string.special".into(), rgba(0x8c323aff).into()),
("string.special.symbol".into(), rgba(0x8c323aff).into()),
("tag".into(), rgba(0x8c323aff).into()),
("text.literal".into(), rgba(0x8c323aff).into()),
("title".into(), rgba(0x8c323aff).into()),
("type".into(), rgba(0x8c323aff).into()),
("variable".into(), rgba(0x8c323aff).into()),
("variable.special".into(), rgba(0x8c323aff).into()),
("variant".into(), rgba(0x8c323aff).into()),
],
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()),
text: Some(rgba(0xffffffff).into()),
tab_inactive_background: Some(rgba(0x31364aff).into()),
tab_active_background: Some(rgba(0x292c3eff).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()
},
},
},
Theme {
id: "5ff8120f-37e9-4ad3-8bd0-c3e449ff1aa1".into(),
UserTheme {
name: "Palenight Operator".into(),
appearance: Appearance::Dark,
styles: ThemeStyles {
system: SystemColors {
transparent: rgba(0x00000000).into(),
mac_os_traffic_light_red: rgba(0xec6b5fff).into(),
mac_os_traffic_light_yellow: rgba(0xf3bf4dff).into(),
mac_os_traffic_light_green: rgba(0x61c454ff).into(),
},
colors: ThemeColors {
border: rgba(0x282b3bff).into(),
border_variant: rgba(0x282b3bff).into(),
border_focused: rgba(0x282b3bff).into(),
border_selected: rgba(0x282b3bff).into(),
border_transparent: rgba(0x282b3bff).into(),
border_disabled: rgba(0x282b3bff).into(),
elevated_surface_background: rgba(0x292c3eff).into(),
surface_background: rgba(0x292c3eff).into(),
background: rgba(0x292c3eff).into(),
element_background: rgba(0x7d56c1cc).into(),
element_hover: rgba(0x272a2dff).into(),
element_active: rgba(0x2e3135ff).into(),
element_selected: rgba(0x2e3135ff).into(),
element_disabled: rgba(0xddeaf814).into(),
element_placeholder: rgba(0xb0b4baff).into(),
element_drop_target: rgba(0x1166fb18).into(),
ghost_element_background: rgba(0x00000000).into(),
ghost_element_hover: rgba(0x272a2dff).into(),
ghost_element_active: rgba(0x2e3135ff).into(),
ghost_element_selected: rgba(0x2e3135ff).into(),
ghost_element_disabled: rgba(0xddeaf814).into(),
text: rgba(0xffffffff).into(),
text_muted: rgba(0xb0b4baff).into(),
text_placeholder: rgba(0x767a83ff).into(),
text_disabled: rgba(0x696e77ff).into(),
text_accent: rgba(0x6fb8ffff).into(),
icon: rgba(0xb0b4baff).into(),
icon_muted: rgba(0x767a83ff).into(),
icon_disabled: rgba(0x696e77ff).into(),
icon_placeholder: rgba(0x767a83ff).into(),
icon_accent: rgba(0x6fb8ffff).into(),
status_bar_background: rgba(0x18191bff).into(),
title_bar_background: rgba(0x18191bff).into(),
toolbar_background: rgba(0x111113ff).into(),
tab_bar_background: rgba(0x18191bff).into(),
tab_inactive_background: rgba(0x31364aff).into(),
tab_active_background: rgba(0x292c3eff).into(),
editor_background: rgba(0x111113ff).into(),
editor_gutter_background: rgba(0x111113ff).into(),
editor_subheader_background: rgba(0x18191bff).into(),
editor_active_line_background: rgba(0xddeaf814).into(),
editor_highlighted_line_background: rgba(0xd3edf81d).into(),
editor_line_number: rgba(0xddeaf814).into(),
editor_active_line_number: rgba(0xddeaf814).into(),
editor_invisible: rgba(0xd3edf81d).into(),
editor_wrap_guide: rgba(0xd3edf81d).into(),
editor_active_wrap_guide: rgba(0xd3edf81d).into(),
editor_document_highlight_read_background: rgba(0xd3edf81d).into(),
editor_document_highlight_write_background: rgba(0xd3edf81d).into(),
terminal_background: rgba(0x111113ff).into(),
terminal_ansi_bright_black: rgba(0x676e95ff).into(),
terminal_ansi_bright_red: rgba(0xff5571ff).into(),
terminal_ansi_bright_green: rgba(0xc3e88dff).into(),
terminal_ansi_bright_yellow: rgba(0xffcb6bff).into(),
terminal_ansi_bright_blue: rgba(0x82aaffff).into(),
terminal_ansi_bright_magenta: rgba(0xc792eaff).into(),
terminal_ansi_bright_cyan: rgba(0x89ddffff).into(),
terminal_ansi_bright_white: rgba(0xffffffff).into(),
terminal_ansi_black: rgba(0x676e95ff).into(),
terminal_ansi_red: rgba(0xff5571ff).into(),
terminal_ansi_green: rgba(0xa9c77dff).into(),
terminal_ansi_yellow: rgba(0xffcb6bff).into(),
terminal_ansi_blue: rgba(0x82aaffff).into(),
terminal_ansi_magenta: rgba(0xc792eaff).into(),
terminal_ansi_cyan: rgba(0x89ddffff).into(),
terminal_ansi_white: rgba(0xffffffff).into(),
},
status: StatusColors {
conflict: rgba(0xff9592ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
error: rgba(0xff9592ff).into(),
hidden: rgba(0xb0b4baff).into(),
ignored: rgba(0xb0b4baff).into(),
info: rgba(0x6fb8ffff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
success: rgba(0x70cf82ff).into(),
warning: rgba(0xf5e147ff).into(),
},
git: GitStatusColors {
conflict: rgba(0xffa057ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
ignored: rgba(0xb0b4baff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
},
player: PlayerColors(vec![
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
]),
syntax: SyntaxTheme {
highlights: vec![
("attribute".into(), rgba(0x4ccce6ff).into()),
("boolean".into(), rgba(0xff977dff).into()),
("comment".into(), rgba(0xb0b4baff).into()),
("comment.doc".into(), rgba(0xe0dffeff).into()),
("constant".into(), rgba(0x8c323aff).into()),
("constructor".into(), rgba(0x8c323aff).into()),
("embedded".into(), rgba(0x8c323aff).into()),
("emphasis".into(), rgba(0x8c323aff).into()),
("emphasis.strong".into(), rgba(0x8c323aff).into()),
("enum".into(), rgba(0x8c323aff).into()),
("function".into(), rgba(0x8c323aff).into()),
("hint".into(), rgba(0x8c323aff).into()),
("keyword".into(), rgba(0xffa057ff).into()),
("label".into(), rgba(0x8c323aff).into()),
("link_text".into(), rgba(0x8c323aff).into()),
("link_uri".into(), rgba(0x8c323aff).into()),
("number".into(), rgba(0x8c323aff).into()),
("operator".into(), rgba(0x8c323aff).into()),
("predictive".into(), rgba(0x8c323aff).into()),
("preproc".into(), rgba(0x8c323aff).into()),
("primary".into(), rgba(0x8c323aff).into()),
("property".into(), rgba(0x8c323aff).into()),
("punctuation".into(), rgba(0xb0b4baff).into()),
("punctuation.bracket".into(), rgba(0xb0b4baff).into()),
("punctuation.delimiter".into(), rgba(0xb0b4baff).into()),
("punctuation.list_marker".into(), rgba(0x6fb8ffff).into()),
("punctuation.special".into(), rgba(0x8c323aff).into()),
("string".into(), rgba(0x1ed8a3ff).into()),
("string.escape".into(), rgba(0x8c323aff).into()),
("string.regex".into(), rgba(0xff977dff).into()),
("string.special".into(), rgba(0x8c323aff).into()),
("string.special.symbol".into(), rgba(0x8c323aff).into()),
("tag".into(), rgba(0x8c323aff).into()),
("text.literal".into(), rgba(0x8c323aff).into()),
("title".into(), rgba(0x8c323aff).into()),
("type".into(), rgba(0x8c323aff).into()),
("variable".into(), rgba(0x8c323aff).into()),
("variable.special".into(), rgba(0x8c323aff).into()),
("variant".into(), rgba(0x8c323aff).into()),
],
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()),
text: Some(rgba(0xffffffff).into()),
tab_inactive_background: Some(rgba(0x31364aff).into()),
tab_active_background: Some(rgba(0x292c3eff).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()
},
},
},
Theme {
id: "cff26efb-72f8-4496-b33b-991080a47f1c".into(),
UserTheme {
name: "Palenight (Mild Contrast)".into(),
appearance: Appearance::Dark,
styles: ThemeStyles {
system: SystemColors {
transparent: rgba(0x00000000).into(),
mac_os_traffic_light_red: rgba(0xec6b5fff).into(),
mac_os_traffic_light_yellow: rgba(0xf3bf4dff).into(),
mac_os_traffic_light_green: rgba(0x61c454ff).into(),
},
colors: ThemeColors {
border: rgba(0x2c2f40ff).into(),
border_variant: rgba(0x2c2f40ff).into(),
border_focused: rgba(0x2c2f40ff).into(),
border_selected: rgba(0x2c2f40ff).into(),
border_transparent: rgba(0x2c2f40ff).into(),
border_disabled: rgba(0x2c2f40ff).into(),
elevated_surface_background: rgba(0x25283aff).into(),
surface_background: rgba(0x25283aff).into(),
background: rgba(0x292c3eff).into(),
element_background: rgba(0x7d56c1cc).into(),
element_hover: rgba(0x272a2dff).into(),
element_active: rgba(0x2e3135ff).into(),
element_selected: rgba(0x2e3135ff).into(),
element_disabled: rgba(0xddeaf814).into(),
element_placeholder: rgba(0xb0b4baff).into(),
element_drop_target: rgba(0x1166fb18).into(),
ghost_element_background: rgba(0x00000000).into(),
ghost_element_hover: rgba(0x272a2dff).into(),
ghost_element_active: rgba(0x2e3135ff).into(),
ghost_element_selected: rgba(0x2e3135ff).into(),
ghost_element_disabled: rgba(0xddeaf814).into(),
text: rgba(0xffffffff).into(),
text_muted: rgba(0xb0b4baff).into(),
text_placeholder: rgba(0x767a83ff).into(),
text_disabled: rgba(0x696e77ff).into(),
text_accent: rgba(0x6fb8ffff).into(),
icon: rgba(0xb0b4baff).into(),
icon_muted: rgba(0x767a83ff).into(),
icon_disabled: rgba(0x696e77ff).into(),
icon_placeholder: rgba(0x767a83ff).into(),
icon_accent: rgba(0x6fb8ffff).into(),
status_bar_background: rgba(0x18191bff).into(),
title_bar_background: rgba(0x18191bff).into(),
toolbar_background: rgba(0x111113ff).into(),
tab_bar_background: rgba(0x18191bff).into(),
tab_inactive_background: rgba(0x31364aff).into(),
tab_active_background: rgba(0x25283aff).into(),
editor_background: rgba(0x111113ff).into(),
editor_gutter_background: rgba(0x111113ff).into(),
editor_subheader_background: rgba(0x18191bff).into(),
editor_active_line_background: rgba(0xddeaf814).into(),
editor_highlighted_line_background: rgba(0xd3edf81d).into(),
editor_line_number: rgba(0xddeaf814).into(),
editor_active_line_number: rgba(0xddeaf814).into(),
editor_invisible: rgba(0xd3edf81d).into(),
editor_wrap_guide: rgba(0xd3edf81d).into(),
editor_active_wrap_guide: rgba(0xd3edf81d).into(),
editor_document_highlight_read_background: rgba(0xd3edf81d).into(),
editor_document_highlight_write_background: rgba(0xd3edf81d).into(),
terminal_background: rgba(0x111113ff).into(),
terminal_ansi_bright_black: rgba(0x676e95ff).into(),
terminal_ansi_bright_red: rgba(0xff5571ff).into(),
terminal_ansi_bright_green: rgba(0xc3e88dff).into(),
terminal_ansi_bright_yellow: rgba(0xffcb6bff).into(),
terminal_ansi_bright_blue: rgba(0x82aaffff).into(),
terminal_ansi_bright_magenta: rgba(0xc792eaff).into(),
terminal_ansi_bright_cyan: rgba(0x89ddffff).into(),
terminal_ansi_bright_white: rgba(0xffffffff).into(),
terminal_ansi_black: rgba(0x676e95ff).into(),
terminal_ansi_red: rgba(0xff5571ff).into(),
terminal_ansi_green: rgba(0xa9c77dff).into(),
terminal_ansi_yellow: rgba(0xffcb6bff).into(),
terminal_ansi_blue: rgba(0x82aaffff).into(),
terminal_ansi_magenta: rgba(0xc792eaff).into(),
terminal_ansi_cyan: rgba(0x89ddffff).into(),
terminal_ansi_white: rgba(0xffffffff).into(),
},
status: StatusColors {
conflict: rgba(0xff9592ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
error: rgba(0xff9592ff).into(),
hidden: rgba(0xb0b4baff).into(),
ignored: rgba(0xb0b4baff).into(),
info: rgba(0x6fb8ffff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
success: rgba(0x70cf82ff).into(),
warning: rgba(0xf5e147ff).into(),
},
git: GitStatusColors {
conflict: rgba(0xffa057ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
ignored: rgba(0xb0b4baff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
},
player: PlayerColors(vec![
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
]),
syntax: SyntaxTheme {
highlights: vec![
("attribute".into(), rgba(0x4ccce6ff).into()),
("boolean".into(), rgba(0xff977dff).into()),
("comment".into(), rgba(0xb0b4baff).into()),
("comment.doc".into(), rgba(0xe0dffeff).into()),
("constant".into(), rgba(0x8c323aff).into()),
("constructor".into(), rgba(0x8c323aff).into()),
("embedded".into(), rgba(0x8c323aff).into()),
("emphasis".into(), rgba(0x8c323aff).into()),
("emphasis.strong".into(), rgba(0x8c323aff).into()),
("enum".into(), rgba(0x8c323aff).into()),
("function".into(), rgba(0x8c323aff).into()),
("hint".into(), rgba(0x8c323aff).into()),
("keyword".into(), rgba(0xffa057ff).into()),
("label".into(), rgba(0x8c323aff).into()),
("link_text".into(), rgba(0x8c323aff).into()),
("link_uri".into(), rgba(0x8c323aff).into()),
("number".into(), rgba(0x8c323aff).into()),
("operator".into(), rgba(0x8c323aff).into()),
("predictive".into(), rgba(0x8c323aff).into()),
("preproc".into(), rgba(0x8c323aff).into()),
("primary".into(), rgba(0x8c323aff).into()),
("property".into(), rgba(0x8c323aff).into()),
("punctuation".into(), rgba(0xb0b4baff).into()),
("punctuation.bracket".into(), rgba(0xb0b4baff).into()),
("punctuation.delimiter".into(), rgba(0xb0b4baff).into()),
("punctuation.list_marker".into(), rgba(0x6fb8ffff).into()),
("punctuation.special".into(), rgba(0x8c323aff).into()),
("string".into(), rgba(0x1ed8a3ff).into()),
("string.escape".into(), rgba(0x8c323aff).into()),
("string.regex".into(), rgba(0xff977dff).into()),
("string.special".into(), rgba(0x8c323aff).into()),
("string.special.symbol".into(), rgba(0x8c323aff).into()),
("tag".into(), rgba(0x8c323aff).into()),
("text.literal".into(), rgba(0x8c323aff).into()),
("title".into(), rgba(0x8c323aff).into()),
("type".into(), rgba(0x8c323aff).into()),
("variable".into(), rgba(0x8c323aff).into()),
("variable.special".into(), rgba(0x8c323aff).into()),
("variant".into(), rgba(0x8c323aff).into()),
],
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()),
text: Some(rgba(0xffffffff).into()),
tab_inactive_background: Some(rgba(0x31364aff).into()),
tab_active_background: Some(rgba(0x25283aff).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()
},
},
},
],
scales: default_color_scales(),
}
}

View File

@ -1,518 +1,128 @@
use gpui::rgba;
use crate::{
default_color_scales, Appearance, GitStatusColors, PlayerColor, PlayerColors, StatusColors,
SyntaxTheme, SystemColors, Theme, ThemeColors, ThemeFamily, ThemeStyles,
Appearance, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement,
};
pub fn rose_pine() -> ThemeFamily {
ThemeFamily {
id: "9cf70eba-1185-4f3e-adb7-74f61c45c9dc".into(),
pub fn rose_pine() -> UserThemeFamily {
UserThemeFamily {
name: "Rose Pine".into(),
author: "Rosé Pine".into(),
themes: vec![
Theme {
id: "80a8f5dd-2ab5-4ee7-9b25-a60c8513234e".into(),
UserTheme {
name: "Rose Pine".into(),
appearance: Appearance::Dark,
styles: ThemeStyles {
system: SystemColors {
transparent: rgba(0x00000000).into(),
mac_os_traffic_light_red: rgba(0xec6b5fff).into(),
mac_os_traffic_light_yellow: rgba(0xf3bf4dff).into(),
mac_os_traffic_light_green: rgba(0x61c454ff).into(),
},
colors: ThemeColors {
border: rgba(0x000000ff).into(),
border_variant: rgba(0x000000ff).into(),
border_focused: rgba(0x000000ff).into(),
border_selected: rgba(0x000000ff).into(),
border_transparent: rgba(0x000000ff).into(),
border_disabled: rgba(0x000000ff).into(),
elevated_surface_background: rgba(0x1f1d2eff).into(),
surface_background: rgba(0x1f1d2eff).into(),
background: rgba(0x191724ff).into(),
element_background: rgba(0xebbcbaff).into(),
element_hover: rgba(0x272a2dff).into(),
element_active: rgba(0x2e3135ff).into(),
element_selected: rgba(0x2e3135ff).into(),
element_disabled: rgba(0xddeaf814).into(),
element_placeholder: rgba(0xb0b4baff).into(),
element_drop_target: rgba(0x1166fb18).into(),
ghost_element_background: rgba(0x00000000).into(),
ghost_element_hover: rgba(0x272a2dff).into(),
ghost_element_active: rgba(0x2e3135ff).into(),
ghost_element_selected: rgba(0x2e3135ff).into(),
ghost_element_disabled: rgba(0xddeaf814).into(),
text: rgba(0xe0def4ff).into(),
text_muted: rgba(0xb0b4baff).into(),
text_placeholder: rgba(0x767a83ff).into(),
text_disabled: rgba(0x696e77ff).into(),
text_accent: rgba(0x6fb8ffff).into(),
icon: rgba(0xb0b4baff).into(),
icon_muted: rgba(0x767a83ff).into(),
icon_disabled: rgba(0x696e77ff).into(),
icon_placeholder: rgba(0x767a83ff).into(),
icon_accent: rgba(0x6fb8ffff).into(),
status_bar_background: rgba(0x18191bff).into(),
title_bar_background: rgba(0x18191bff).into(),
toolbar_background: rgba(0x111113ff).into(),
tab_bar_background: rgba(0x18191bff).into(),
tab_inactive_background: rgba(0x000000ff).into(),
tab_active_background: rgba(0x6e6a861a).into(),
editor_background: rgba(0x111113ff).into(),
editor_gutter_background: rgba(0x111113ff).into(),
editor_subheader_background: rgba(0x18191bff).into(),
editor_active_line_background: rgba(0xddeaf814).into(),
editor_highlighted_line_background: rgba(0xd3edf81d).into(),
editor_line_number: rgba(0xddeaf814).into(),
editor_active_line_number: rgba(0xddeaf814).into(),
editor_invisible: rgba(0xd3edf81d).into(),
editor_wrap_guide: rgba(0xd3edf81d).into(),
editor_active_wrap_guide: rgba(0xd3edf81d).into(),
editor_document_highlight_read_background: rgba(0xd3edf81d).into(),
editor_document_highlight_write_background: rgba(0xd3edf81d).into(),
terminal_background: rgba(0x111113ff).into(),
terminal_ansi_bright_black: rgba(0x908caaff).into(),
terminal_ansi_bright_red: rgba(0xeb6f92ff).into(),
terminal_ansi_bright_green: rgba(0x30738fff).into(),
terminal_ansi_bright_yellow: rgba(0xf5c177ff).into(),
terminal_ansi_bright_blue: rgba(0x9ccfd8ff).into(),
terminal_ansi_bright_magenta: rgba(0xc4a7e7ff).into(),
terminal_ansi_bright_cyan: rgba(0xebbcbaff).into(),
terminal_ansi_bright_white: rgba(0xe0def4ff).into(),
terminal_ansi_black: rgba(0x26233aff).into(),
terminal_ansi_red: rgba(0xeb6f92ff).into(),
terminal_ansi_green: rgba(0x30738fff).into(),
terminal_ansi_yellow: rgba(0xf5c177ff).into(),
terminal_ansi_blue: rgba(0x9ccfd8ff).into(),
terminal_ansi_magenta: rgba(0xc4a7e7ff).into(),
terminal_ansi_cyan: rgba(0xebbcbaff).into(),
terminal_ansi_white: rgba(0xe0def4ff).into(),
},
status: StatusColors {
conflict: rgba(0xff9592ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
error: rgba(0xff9592ff).into(),
hidden: rgba(0xb0b4baff).into(),
ignored: rgba(0xb0b4baff).into(),
info: rgba(0x6fb8ffff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
success: rgba(0x70cf82ff).into(),
warning: rgba(0xf5e147ff).into(),
},
git: GitStatusColors {
conflict: rgba(0xffa057ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
ignored: rgba(0xb0b4baff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
},
player: PlayerColors(vec![
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
]),
syntax: SyntaxTheme {
highlights: vec![
("attribute".into(), rgba(0x4ccce6ff).into()),
("boolean".into(), rgba(0xff977dff).into()),
("comment".into(), rgba(0xb0b4baff).into()),
("comment.doc".into(), rgba(0xe0dffeff).into()),
("constant".into(), rgba(0x8c323aff).into()),
("constructor".into(), rgba(0x8c323aff).into()),
("embedded".into(), rgba(0x8c323aff).into()),
("emphasis".into(), rgba(0x8c323aff).into()),
("emphasis.strong".into(), rgba(0x8c323aff).into()),
("enum".into(), rgba(0x8c323aff).into()),
("function".into(), rgba(0x8c323aff).into()),
("hint".into(), rgba(0x8c323aff).into()),
("keyword".into(), rgba(0xffa057ff).into()),
("label".into(), rgba(0x8c323aff).into()),
("link_text".into(), rgba(0x8c323aff).into()),
("link_uri".into(), rgba(0x8c323aff).into()),
("number".into(), rgba(0x8c323aff).into()),
("operator".into(), rgba(0x8c323aff).into()),
("predictive".into(), rgba(0x8c323aff).into()),
("preproc".into(), rgba(0x8c323aff).into()),
("primary".into(), rgba(0x8c323aff).into()),
("property".into(), rgba(0x8c323aff).into()),
("punctuation".into(), rgba(0xb0b4baff).into()),
("punctuation.bracket".into(), rgba(0xb0b4baff).into()),
("punctuation.delimiter".into(), rgba(0xb0b4baff).into()),
("punctuation.list_marker".into(), rgba(0x6fb8ffff).into()),
("punctuation.special".into(), rgba(0x8c323aff).into()),
("string".into(), rgba(0x1ed8a3ff).into()),
("string.escape".into(), rgba(0x8c323aff).into()),
("string.regex".into(), rgba(0xff977dff).into()),
("string.special".into(), rgba(0x8c323aff).into()),
("string.special.symbol".into(), rgba(0x8c323aff).into()),
("tag".into(), rgba(0x8c323aff).into()),
("text.literal".into(), rgba(0x8c323aff).into()),
("title".into(), rgba(0x8c323aff).into()),
("type".into(), rgba(0x8c323aff).into()),
("variable".into(), rgba(0x8c323aff).into()),
("variable.special".into(), rgba(0x8c323aff).into()),
("variant".into(), rgba(0x8c323aff).into()),
],
styles: UserThemeStylesRefinement {
colors: ThemeColorsRefinement {
border: Some(rgba(0x000000ff).into()),
border_variant: Some(rgba(0x000000ff).into()),
border_focused: Some(rgba(0x000000ff).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()),
text: Some(rgba(0xe0def4ff).into()),
tab_inactive_background: Some(rgba(0x000000ff).into()),
tab_active_background: Some(rgba(0x6e6a861a).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()
},
},
},
Theme {
id: "fe9e3c9e-954e-4f8e-849e-451ba5f6ceca".into(),
UserTheme {
name: "Rose Moon".into(),
appearance: Appearance::Dark,
styles: ThemeStyles {
system: SystemColors {
transparent: rgba(0x00000000).into(),
mac_os_traffic_light_red: rgba(0xec6b5fff).into(),
mac_os_traffic_light_yellow: rgba(0xf3bf4dff).into(),
mac_os_traffic_light_green: rgba(0x61c454ff).into(),
},
colors: ThemeColors {
border: rgba(0x000000ff).into(),
border_variant: rgba(0x000000ff).into(),
border_focused: rgba(0x000000ff).into(),
border_selected: rgba(0x000000ff).into(),
border_transparent: rgba(0x000000ff).into(),
border_disabled: rgba(0x000000ff).into(),
elevated_surface_background: rgba(0x2a273eff).into(),
surface_background: rgba(0x2a273eff).into(),
background: rgba(0x232136ff).into(),
element_background: rgba(0xea9a97ff).into(),
element_hover: rgba(0x272a2dff).into(),
element_active: rgba(0x2e3135ff).into(),
element_selected: rgba(0x2e3135ff).into(),
element_disabled: rgba(0xddeaf814).into(),
element_placeholder: rgba(0xb0b4baff).into(),
element_drop_target: rgba(0x1166fb18).into(),
ghost_element_background: rgba(0x00000000).into(),
ghost_element_hover: rgba(0x272a2dff).into(),
ghost_element_active: rgba(0x2e3135ff).into(),
ghost_element_selected: rgba(0x2e3135ff).into(),
ghost_element_disabled: rgba(0xddeaf814).into(),
text: rgba(0xe0def4ff).into(),
text_muted: rgba(0xb0b4baff).into(),
text_placeholder: rgba(0x767a83ff).into(),
text_disabled: rgba(0x696e77ff).into(),
text_accent: rgba(0x6fb8ffff).into(),
icon: rgba(0xb0b4baff).into(),
icon_muted: rgba(0x767a83ff).into(),
icon_disabled: rgba(0x696e77ff).into(),
icon_placeholder: rgba(0x767a83ff).into(),
icon_accent: rgba(0x6fb8ffff).into(),
status_bar_background: rgba(0x18191bff).into(),
title_bar_background: rgba(0x18191bff).into(),
toolbar_background: rgba(0x111113ff).into(),
tab_bar_background: rgba(0x18191bff).into(),
tab_inactive_background: rgba(0x000000ff).into(),
tab_active_background: rgba(0x817c9c14).into(),
editor_background: rgba(0x111113ff).into(),
editor_gutter_background: rgba(0x111113ff).into(),
editor_subheader_background: rgba(0x18191bff).into(),
editor_active_line_background: rgba(0xddeaf814).into(),
editor_highlighted_line_background: rgba(0xd3edf81d).into(),
editor_line_number: rgba(0xddeaf814).into(),
editor_active_line_number: rgba(0xddeaf814).into(),
editor_invisible: rgba(0xd3edf81d).into(),
editor_wrap_guide: rgba(0xd3edf81d).into(),
editor_active_wrap_guide: rgba(0xd3edf81d).into(),
editor_document_highlight_read_background: rgba(0xd3edf81d).into(),
editor_document_highlight_write_background: rgba(0xd3edf81d).into(),
terminal_background: rgba(0x111113ff).into(),
terminal_ansi_bright_black: rgba(0x908caaff).into(),
terminal_ansi_bright_red: rgba(0xeb6f92ff).into(),
terminal_ansi_bright_green: rgba(0x3d8fb0ff).into(),
terminal_ansi_bright_yellow: rgba(0xf5c177ff).into(),
terminal_ansi_bright_blue: rgba(0x9ccfd8ff).into(),
terminal_ansi_bright_magenta: rgba(0xc4a7e7ff).into(),
terminal_ansi_bright_cyan: rgba(0xea9a97ff).into(),
terminal_ansi_bright_white: rgba(0xe0def4ff).into(),
terminal_ansi_black: rgba(0x393552ff).into(),
terminal_ansi_red: rgba(0xeb6f92ff).into(),
terminal_ansi_green: rgba(0x3d8fb0ff).into(),
terminal_ansi_yellow: rgba(0xf5c177ff).into(),
terminal_ansi_blue: rgba(0x9ccfd8ff).into(),
terminal_ansi_magenta: rgba(0xc4a7e7ff).into(),
terminal_ansi_cyan: rgba(0xea9a97ff).into(),
terminal_ansi_white: rgba(0xe0def4ff).into(),
},
status: StatusColors {
conflict: rgba(0xff9592ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
error: rgba(0xff9592ff).into(),
hidden: rgba(0xb0b4baff).into(),
ignored: rgba(0xb0b4baff).into(),
info: rgba(0x6fb8ffff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
success: rgba(0x70cf82ff).into(),
warning: rgba(0xf5e147ff).into(),
},
git: GitStatusColors {
conflict: rgba(0xffa057ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
ignored: rgba(0xb0b4baff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
},
player: PlayerColors(vec![
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
]),
syntax: SyntaxTheme {
highlights: vec![
("attribute".into(), rgba(0x4ccce6ff).into()),
("boolean".into(), rgba(0xff977dff).into()),
("comment".into(), rgba(0xb0b4baff).into()),
("comment.doc".into(), rgba(0xe0dffeff).into()),
("constant".into(), rgba(0x8c323aff).into()),
("constructor".into(), rgba(0x8c323aff).into()),
("embedded".into(), rgba(0x8c323aff).into()),
("emphasis".into(), rgba(0x8c323aff).into()),
("emphasis.strong".into(), rgba(0x8c323aff).into()),
("enum".into(), rgba(0x8c323aff).into()),
("function".into(), rgba(0x8c323aff).into()),
("hint".into(), rgba(0x8c323aff).into()),
("keyword".into(), rgba(0xffa057ff).into()),
("label".into(), rgba(0x8c323aff).into()),
("link_text".into(), rgba(0x8c323aff).into()),
("link_uri".into(), rgba(0x8c323aff).into()),
("number".into(), rgba(0x8c323aff).into()),
("operator".into(), rgba(0x8c323aff).into()),
("predictive".into(), rgba(0x8c323aff).into()),
("preproc".into(), rgba(0x8c323aff).into()),
("primary".into(), rgba(0x8c323aff).into()),
("property".into(), rgba(0x8c323aff).into()),
("punctuation".into(), rgba(0xb0b4baff).into()),
("punctuation.bracket".into(), rgba(0xb0b4baff).into()),
("punctuation.delimiter".into(), rgba(0xb0b4baff).into()),
("punctuation.list_marker".into(), rgba(0x6fb8ffff).into()),
("punctuation.special".into(), rgba(0x8c323aff).into()),
("string".into(), rgba(0x1ed8a3ff).into()),
("string.escape".into(), rgba(0x8c323aff).into()),
("string.regex".into(), rgba(0xff977dff).into()),
("string.special".into(), rgba(0x8c323aff).into()),
("string.special.symbol".into(), rgba(0x8c323aff).into()),
("tag".into(), rgba(0x8c323aff).into()),
("text.literal".into(), rgba(0x8c323aff).into()),
("title".into(), rgba(0x8c323aff).into()),
("type".into(), rgba(0x8c323aff).into()),
("variable".into(), rgba(0x8c323aff).into()),
("variable.special".into(), rgba(0x8c323aff).into()),
("variant".into(), rgba(0x8c323aff).into()),
],
styles: UserThemeStylesRefinement {
colors: ThemeColorsRefinement {
border: Some(rgba(0x000000ff).into()),
border_variant: Some(rgba(0x000000ff).into()),
border_focused: Some(rgba(0x000000ff).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()),
text: Some(rgba(0xe0def4ff).into()),
tab_inactive_background: Some(rgba(0x000000ff).into()),
tab_active_background: Some(rgba(0x817c9c14).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()
},
},
},
Theme {
id: "00cc7f69-9658-443e-b643-1c8dbffa047d".into(),
UserTheme {
name: "Rose Pine Dawn".into(),
appearance: Appearance::Light,
styles: ThemeStyles {
system: SystemColors {
transparent: rgba(0x00000000).into(),
mac_os_traffic_light_red: rgba(0xec6b5fff).into(),
mac_os_traffic_light_yellow: rgba(0xf3bf4dff).into(),
mac_os_traffic_light_green: rgba(0x61c454ff).into(),
},
colors: ThemeColors {
border: rgba(0x000000ff).into(),
border_variant: rgba(0x000000ff).into(),
border_focused: rgba(0x000000ff).into(),
border_selected: rgba(0x000000ff).into(),
border_transparent: rgba(0x000000ff).into(),
border_disabled: rgba(0x000000ff).into(),
elevated_surface_background: rgba(0xfffaf3ff).into(),
surface_background: rgba(0xfffaf3ff).into(),
background: rgba(0xfaf4edff).into(),
element_background: rgba(0xd7827dff).into(),
element_hover: rgba(0xe8e8ecff).into(),
element_active: rgba(0xe0e1e6ff).into(),
element_selected: rgba(0xe0e1e6ff).into(),
element_disabled: rgba(0x0000320f).into(),
element_placeholder: rgba(0x60646cff).into(),
element_drop_target: rgba(0x008bff0b).into(),
ghost_element_background: rgba(0x00000000).into(),
ghost_element_hover: rgba(0xe8e8ecff).into(),
ghost_element_active: rgba(0xe0e1e6ff).into(),
ghost_element_selected: rgba(0xe0e1e6ff).into(),
ghost_element_disabled: rgba(0x0000320f).into(),
text: rgba(0x575279ff).into(),
text_muted: rgba(0x60646cff).into(),
text_placeholder: rgba(0x80838dff).into(),
text_disabled: rgba(0x8b8d98ff).into(),
text_accent: rgba(0x0c73ceff).into(),
icon: rgba(0x60646cff).into(),
icon_muted: rgba(0x80838dff).into(),
icon_disabled: rgba(0x8b8d98ff).into(),
icon_placeholder: rgba(0x80838dff).into(),
icon_accent: rgba(0x0c73ceff).into(),
status_bar_background: rgba(0xf9f9fbff).into(),
title_bar_background: rgba(0xf9f9fbff).into(),
toolbar_background: rgba(0xfcfcfdff).into(),
tab_bar_background: rgba(0xf9f9fbff).into(),
tab_inactive_background: rgba(0x000000ff).into(),
tab_active_background: rgba(0x6e6a860d).into(),
editor_background: rgba(0xfcfcfdff).into(),
editor_gutter_background: rgba(0xfcfcfdff).into(),
editor_subheader_background: rgba(0xf9f9fbff).into(),
editor_active_line_background: rgba(0x0000320f).into(),
editor_highlighted_line_background: rgba(0x00002c17).into(),
editor_line_number: rgba(0x0000320f).into(),
editor_active_line_number: rgba(0x0000320f).into(),
editor_invisible: rgba(0x00002c17).into(),
editor_wrap_guide: rgba(0x00002c17).into(),
editor_active_wrap_guide: rgba(0x00002c17).into(),
editor_document_highlight_read_background: rgba(0x00002c17).into(),
editor_document_highlight_write_background: rgba(0x00002c17).into(),
terminal_background: rgba(0xfcfcfdff).into(),
terminal_ansi_bright_black: rgba(0x797593ff).into(),
terminal_ansi_bright_red: rgba(0xb3627aff).into(),
terminal_ansi_bright_green: rgba(0x276983ff).into(),
terminal_ansi_bright_yellow: rgba(0xea9d34ff).into(),
terminal_ansi_bright_blue: rgba(0x55949fff).into(),
terminal_ansi_bright_magenta: rgba(0x9079a9ff).into(),
terminal_ansi_bright_cyan: rgba(0xd7827dff).into(),
terminal_ansi_bright_white: rgba(0x575279ff).into(),
terminal_ansi_black: rgba(0xf2e9e1ff).into(),
terminal_ansi_red: rgba(0xb3627aff).into(),
terminal_ansi_green: rgba(0x276983ff).into(),
terminal_ansi_yellow: rgba(0xea9d34ff).into(),
terminal_ansi_blue: rgba(0x55949fff).into(),
terminal_ansi_magenta: rgba(0x9079a9ff).into(),
terminal_ansi_cyan: rgba(0xd7827dff).into(),
terminal_ansi_white: rgba(0x575279ff).into(),
},
status: StatusColors {
conflict: rgba(0xff9592ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
error: rgba(0xff9592ff).into(),
hidden: rgba(0xb0b4baff).into(),
ignored: rgba(0xb0b4baff).into(),
info: rgba(0x6fb8ffff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
success: rgba(0x70cf82ff).into(),
warning: rgba(0xf5e147ff).into(),
},
git: GitStatusColors {
conflict: rgba(0xffa057ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
ignored: rgba(0xb0b4baff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
},
player: PlayerColors(vec![
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
]),
syntax: SyntaxTheme {
highlights: vec![
("attribute".into(), rgba(0x4ccce6ff).into()),
("boolean".into(), rgba(0xff977dff).into()),
("comment".into(), rgba(0xb0b4baff).into()),
("comment.doc".into(), rgba(0xe0dffeff).into()),
("constant".into(), rgba(0x8c323aff).into()),
("constructor".into(), rgba(0x8c323aff).into()),
("embedded".into(), rgba(0x8c323aff).into()),
("emphasis".into(), rgba(0x8c323aff).into()),
("emphasis.strong".into(), rgba(0x8c323aff).into()),
("enum".into(), rgba(0x8c323aff).into()),
("function".into(), rgba(0x8c323aff).into()),
("hint".into(), rgba(0x8c323aff).into()),
("keyword".into(), rgba(0xffa057ff).into()),
("label".into(), rgba(0x8c323aff).into()),
("link_text".into(), rgba(0x8c323aff).into()),
("link_uri".into(), rgba(0x8c323aff).into()),
("number".into(), rgba(0x8c323aff).into()),
("operator".into(), rgba(0x8c323aff).into()),
("predictive".into(), rgba(0x8c323aff).into()),
("preproc".into(), rgba(0x8c323aff).into()),
("primary".into(), rgba(0x8c323aff).into()),
("property".into(), rgba(0x8c323aff).into()),
("punctuation".into(), rgba(0xb0b4baff).into()),
("punctuation.bracket".into(), rgba(0xb0b4baff).into()),
("punctuation.delimiter".into(), rgba(0xb0b4baff).into()),
("punctuation.list_marker".into(), rgba(0x6fb8ffff).into()),
("punctuation.special".into(), rgba(0x8c323aff).into()),
("string".into(), rgba(0x1ed8a3ff).into()),
("string.escape".into(), rgba(0x8c323aff).into()),
("string.regex".into(), rgba(0xff977dff).into()),
("string.special".into(), rgba(0x8c323aff).into()),
("string.special.symbol".into(), rgba(0x8c323aff).into()),
("tag".into(), rgba(0x8c323aff).into()),
("text.literal".into(), rgba(0x8c323aff).into()),
("title".into(), rgba(0x8c323aff).into()),
("type".into(), rgba(0x8c323aff).into()),
("variable".into(), rgba(0x8c323aff).into()),
("variable.special".into(), rgba(0x8c323aff).into()),
("variant".into(), rgba(0x8c323aff).into()),
],
styles: UserThemeStylesRefinement {
colors: ThemeColorsRefinement {
border: Some(rgba(0x000000ff).into()),
border_variant: Some(rgba(0x000000ff).into()),
border_focused: Some(rgba(0x000000ff).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()),
text: Some(rgba(0x575279ff).into()),
tab_inactive_background: Some(rgba(0x000000ff).into()),
tab_active_background: Some(rgba(0x6e6a860d).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()
},
},
},
],
scales: default_color_scales(),
}
}

View File

@ -1,351 +1,84 @@
use gpui::rgba;
use crate::{
default_color_scales, Appearance, GitStatusColors, PlayerColor, PlayerColors, StatusColors,
SyntaxTheme, SystemColors, Theme, ThemeColors, ThemeFamily, ThemeStyles,
Appearance, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement,
};
pub fn solarized() -> ThemeFamily {
ThemeFamily {
id: "96299b3e-c749-478c-bfc9-c96cdaea8630".into(),
pub fn solarized() -> UserThemeFamily {
UserThemeFamily {
name: "Solarized".into(),
author: "Ethan Schoonover (altercation)".into(),
themes: vec![
Theme {
id: "265f93c5-c8e7-4962-b083-8550f4b5c2ff".into(),
UserTheme {
name: "Solarized Dark".into(),
appearance: Appearance::Dark,
styles: ThemeStyles {
system: SystemColors {
transparent: rgba(0x00000000).into(),
mac_os_traffic_light_red: rgba(0xec6b5fff).into(),
mac_os_traffic_light_yellow: rgba(0xf3bf4dff).into(),
mac_os_traffic_light_green: rgba(0x61c454ff).into(),
},
colors: ThemeColors {
border: rgba(0x003847ff).into(),
border_variant: rgba(0x003847ff).into(),
border_focused: rgba(0x003847ff).into(),
border_selected: rgba(0x003847ff).into(),
border_transparent: rgba(0x003847ff).into(),
border_disabled: rgba(0x003847ff).into(),
elevated_surface_background: rgba(0x18191bff).into(),
surface_background: rgba(0x18191bff).into(),
background: rgba(0x002a35ff).into(),
element_background: rgba(0x29a19899).into(),
element_hover: rgba(0x272a2dff).into(),
element_active: rgba(0x2e3135ff).into(),
element_selected: rgba(0x2e3135ff).into(),
element_disabled: rgba(0xddeaf814).into(),
element_placeholder: rgba(0xb0b4baff).into(),
element_drop_target: rgba(0x1166fb18).into(),
ghost_element_background: rgba(0x00000000).into(),
ghost_element_hover: rgba(0x272a2dff).into(),
ghost_element_active: rgba(0x2e3135ff).into(),
ghost_element_selected: rgba(0x2e3135ff).into(),
ghost_element_disabled: rgba(0xddeaf814).into(),
text: rgba(0xedeef0ff).into(),
text_muted: rgba(0xb0b4baff).into(),
text_placeholder: rgba(0x767a83ff).into(),
text_disabled: rgba(0x696e77ff).into(),
text_accent: rgba(0x6fb8ffff).into(),
icon: rgba(0xb0b4baff).into(),
icon_muted: rgba(0x767a83ff).into(),
icon_disabled: rgba(0x696e77ff).into(),
icon_placeholder: rgba(0x767a83ff).into(),
icon_accent: rgba(0x6fb8ffff).into(),
status_bar_background: rgba(0x18191bff).into(),
title_bar_background: rgba(0x18191bff).into(),
toolbar_background: rgba(0x111113ff).into(),
tab_bar_background: rgba(0x18191bff).into(),
tab_inactive_background: rgba(0x003f51ff).into(),
tab_active_background: rgba(0x002a36ff).into(),
editor_background: rgba(0x111113ff).into(),
editor_gutter_background: rgba(0x111113ff).into(),
editor_subheader_background: rgba(0x18191bff).into(),
editor_active_line_background: rgba(0xddeaf814).into(),
editor_highlighted_line_background: rgba(0xd3edf81d).into(),
editor_line_number: rgba(0xddeaf814).into(),
editor_active_line_number: rgba(0xddeaf814).into(),
editor_invisible: rgba(0xd3edf81d).into(),
editor_wrap_guide: rgba(0xd3edf81d).into(),
editor_active_wrap_guide: rgba(0xd3edf81d).into(),
editor_document_highlight_read_background: rgba(0xd3edf81d).into(),
editor_document_highlight_write_background: rgba(0xd3edf81d).into(),
terminal_background: rgba(0x111113ff).into(),
terminal_ansi_bright_black: rgba(0x586e75ff).into(),
terminal_ansi_bright_red: rgba(0xcb4b15ff).into(),
terminal_ansi_bright_green: rgba(0x859900ff).into(),
terminal_ansi_bright_yellow: rgba(0x657b83ff).into(),
terminal_ansi_bright_blue: rgba(0x839496ff).into(),
terminal_ansi_bright_magenta: rgba(0x6c71c4ff).into(),
terminal_ansi_bright_cyan: rgba(0x93a1a1ff).into(),
terminal_ansi_bright_white: rgba(0x839496ff).into(),
terminal_ansi_black: rgba(0x063642ff).into(),
terminal_ansi_red: rgba(0xdc312eff).into(),
terminal_ansi_green: rgba(0x859900ff).into(),
terminal_ansi_yellow: rgba(0xb58800ff).into(),
terminal_ansi_blue: rgba(0x258ad2ff).into(),
terminal_ansi_magenta: rgba(0xd33582ff).into(),
terminal_ansi_cyan: rgba(0x29a198ff).into(),
terminal_ansi_white: rgba(0x839496ff).into(),
},
status: StatusColors {
conflict: rgba(0xff9592ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
error: rgba(0xff9592ff).into(),
hidden: rgba(0xb0b4baff).into(),
ignored: rgba(0xb0b4baff).into(),
info: rgba(0x6fb8ffff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
success: rgba(0x70cf82ff).into(),
warning: rgba(0xf5e147ff).into(),
},
git: GitStatusColors {
conflict: rgba(0xffa057ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
ignored: rgba(0xb0b4baff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
},
player: PlayerColors(vec![
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
]),
syntax: SyntaxTheme {
highlights: vec![
("attribute".into(), rgba(0x4ccce6ff).into()),
("boolean".into(), rgba(0xff977dff).into()),
("comment".into(), rgba(0xb0b4baff).into()),
("comment.doc".into(), rgba(0xe0dffeff).into()),
("constant".into(), rgba(0x8c323aff).into()),
("constructor".into(), rgba(0x8c323aff).into()),
("embedded".into(), rgba(0x8c323aff).into()),
("emphasis".into(), rgba(0x8c323aff).into()),
("emphasis.strong".into(), rgba(0x8c323aff).into()),
("enum".into(), rgba(0x8c323aff).into()),
("function".into(), rgba(0x8c323aff).into()),
("hint".into(), rgba(0x8c323aff).into()),
("keyword".into(), rgba(0xffa057ff).into()),
("label".into(), rgba(0x8c323aff).into()),
("link_text".into(), rgba(0x8c323aff).into()),
("link_uri".into(), rgba(0x8c323aff).into()),
("number".into(), rgba(0x8c323aff).into()),
("operator".into(), rgba(0x8c323aff).into()),
("predictive".into(), rgba(0x8c323aff).into()),
("preproc".into(), rgba(0x8c323aff).into()),
("primary".into(), rgba(0x8c323aff).into()),
("property".into(), rgba(0x8c323aff).into()),
("punctuation".into(), rgba(0xb0b4baff).into()),
("punctuation.bracket".into(), rgba(0xb0b4baff).into()),
("punctuation.delimiter".into(), rgba(0xb0b4baff).into()),
("punctuation.list_marker".into(), rgba(0x6fb8ffff).into()),
("punctuation.special".into(), rgba(0x8c323aff).into()),
("string".into(), rgba(0x1ed8a3ff).into()),
("string.escape".into(), rgba(0x8c323aff).into()),
("string.regex".into(), rgba(0xff977dff).into()),
("string.special".into(), rgba(0x8c323aff).into()),
("string.special.symbol".into(), rgba(0x8c323aff).into()),
("tag".into(), rgba(0x8c323aff).into()),
("text.literal".into(), rgba(0x8c323aff).into()),
("title".into(), rgba(0x8c323aff).into()),
("type".into(), rgba(0x8c323aff).into()),
("variable".into(), rgba(0x8c323aff).into()),
("variable.special".into(), rgba(0x8c323aff).into()),
("variant".into(), rgba(0x8c323aff).into()),
],
styles: UserThemeStylesRefinement {
colors: ThemeColorsRefinement {
border: Some(rgba(0x003847ff).into()),
border_variant: Some(rgba(0x003847ff).into()),
border_focused: Some(rgba(0x003847ff).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()),
tab_inactive_background: Some(rgba(0x003f51ff).into()),
tab_active_background: Some(rgba(0x002a36ff).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()
},
},
},
Theme {
id: "40e2070d-5846-4182-9dc9-bf56badf019f".into(),
UserTheme {
name: "Solarized Light".into(),
appearance: Appearance::Light,
styles: ThemeStyles {
system: SystemColors {
transparent: rgba(0x00000000).into(),
mac_os_traffic_light_red: rgba(0xec6b5fff).into(),
mac_os_traffic_light_yellow: rgba(0xf3bf4dff).into(),
mac_os_traffic_light_green: rgba(0x61c454ff).into(),
},
colors: ThemeColors {
border: rgba(0xddd6c1ff).into(),
border_variant: rgba(0xddd6c1ff).into(),
border_focused: rgba(0xddd6c1ff).into(),
border_selected: rgba(0xddd6c1ff).into(),
border_transparent: rgba(0xddd6c1ff).into(),
border_disabled: rgba(0xddd6c1ff).into(),
elevated_surface_background: rgba(0xf9f9fbff).into(),
surface_background: rgba(0xf9f9fbff).into(),
background: rgba(0xfdf6e3ff).into(),
element_background: rgba(0xab9d56ff).into(),
element_hover: rgba(0xe8e8ecff).into(),
element_active: rgba(0xe0e1e6ff).into(),
element_selected: rgba(0xe0e1e6ff).into(),
element_disabled: rgba(0x0000320f).into(),
element_placeholder: rgba(0x60646cff).into(),
element_drop_target: rgba(0x008bff0b).into(),
ghost_element_background: rgba(0x00000000).into(),
ghost_element_hover: rgba(0xe8e8ecff).into(),
ghost_element_active: rgba(0xe0e1e6ff).into(),
ghost_element_selected: rgba(0xe0e1e6ff).into(),
ghost_element_disabled: rgba(0x0000320f).into(),
text: rgba(0x1c2024ff).into(),
text_muted: rgba(0x60646cff).into(),
text_placeholder: rgba(0x80838dff).into(),
text_disabled: rgba(0x8b8d98ff).into(),
text_accent: rgba(0x0c73ceff).into(),
icon: rgba(0x60646cff).into(),
icon_muted: rgba(0x80838dff).into(),
icon_disabled: rgba(0x8b8d98ff).into(),
icon_placeholder: rgba(0x80838dff).into(),
icon_accent: rgba(0x0c73ceff).into(),
status_bar_background: rgba(0xf9f9fbff).into(),
title_bar_background: rgba(0xf9f9fbff).into(),
toolbar_background: rgba(0xfcfcfdff).into(),
tab_bar_background: rgba(0xf9f9fbff).into(),
tab_inactive_background: rgba(0xd3cbb7ff).into(),
tab_active_background: rgba(0xfdf6e3ff).into(),
editor_background: rgba(0xfcfcfdff).into(),
editor_gutter_background: rgba(0xfcfcfdff).into(),
editor_subheader_background: rgba(0xf9f9fbff).into(),
editor_active_line_background: rgba(0x0000320f).into(),
editor_highlighted_line_background: rgba(0x00002c17).into(),
editor_line_number: rgba(0x0000320f).into(),
editor_active_line_number: rgba(0x0000320f).into(),
editor_invisible: rgba(0x00002c17).into(),
editor_wrap_guide: rgba(0x00002c17).into(),
editor_active_wrap_guide: rgba(0x00002c17).into(),
editor_document_highlight_read_background: rgba(0x00002c17).into(),
editor_document_highlight_write_background: rgba(0x00002c17).into(),
terminal_background: rgba(0xfcfcfdff).into(),
terminal_ansi_bright_black: rgba(0x657b83ff).into(),
terminal_ansi_bright_red: rgba(0xcb4b15ff).into(),
terminal_ansi_bright_green: rgba(0x859900ff).into(),
terminal_ansi_bright_yellow: rgba(0x657b83ff).into(),
terminal_ansi_bright_blue: rgba(0x839496ff).into(),
terminal_ansi_bright_magenta: rgba(0x6c71c4ff).into(),
terminal_ansi_bright_cyan: rgba(0x93a1a1ff).into(),
terminal_ansi_bright_white: rgba(0xeee8d5ff).into(),
terminal_ansi_black: rgba(0x657b83ff).into(),
terminal_ansi_red: rgba(0xdc312eff).into(),
terminal_ansi_green: rgba(0x859900ff).into(),
terminal_ansi_yellow: rgba(0xb58800ff).into(),
terminal_ansi_blue: rgba(0x258ad2ff).into(),
terminal_ansi_magenta: rgba(0xd33582ff).into(),
terminal_ansi_cyan: rgba(0x29a198ff).into(),
terminal_ansi_white: rgba(0xeee8d5ff).into(),
},
status: StatusColors {
conflict: rgba(0xff9592ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
error: rgba(0xff9592ff).into(),
hidden: rgba(0xb0b4baff).into(),
ignored: rgba(0xb0b4baff).into(),
info: rgba(0x6fb8ffff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
success: rgba(0x70cf82ff).into(),
warning: rgba(0xf5e147ff).into(),
},
git: GitStatusColors {
conflict: rgba(0xffa057ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
ignored: rgba(0xb0b4baff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
},
player: PlayerColors(vec![
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
]),
syntax: SyntaxTheme {
highlights: vec![
("attribute".into(), rgba(0x4ccce6ff).into()),
("boolean".into(), rgba(0xff977dff).into()),
("comment".into(), rgba(0xb0b4baff).into()),
("comment.doc".into(), rgba(0xe0dffeff).into()),
("constant".into(), rgba(0x8c323aff).into()),
("constructor".into(), rgba(0x8c323aff).into()),
("embedded".into(), rgba(0x8c323aff).into()),
("emphasis".into(), rgba(0x8c323aff).into()),
("emphasis.strong".into(), rgba(0x8c323aff).into()),
("enum".into(), rgba(0x8c323aff).into()),
("function".into(), rgba(0x8c323aff).into()),
("hint".into(), rgba(0x8c323aff).into()),
("keyword".into(), rgba(0xffa057ff).into()),
("label".into(), rgba(0x8c323aff).into()),
("link_text".into(), rgba(0x8c323aff).into()),
("link_uri".into(), rgba(0x8c323aff).into()),
("number".into(), rgba(0x8c323aff).into()),
("operator".into(), rgba(0x8c323aff).into()),
("predictive".into(), rgba(0x8c323aff).into()),
("preproc".into(), rgba(0x8c323aff).into()),
("primary".into(), rgba(0x8c323aff).into()),
("property".into(), rgba(0x8c323aff).into()),
("punctuation".into(), rgba(0xb0b4baff).into()),
("punctuation.bracket".into(), rgba(0xb0b4baff).into()),
("punctuation.delimiter".into(), rgba(0xb0b4baff).into()),
("punctuation.list_marker".into(), rgba(0x6fb8ffff).into()),
("punctuation.special".into(), rgba(0x8c323aff).into()),
("string".into(), rgba(0x1ed8a3ff).into()),
("string.escape".into(), rgba(0x8c323aff).into()),
("string.regex".into(), rgba(0xff977dff).into()),
("string.special".into(), rgba(0x8c323aff).into()),
("string.special.symbol".into(), rgba(0x8c323aff).into()),
("tag".into(), rgba(0x8c323aff).into()),
("text.literal".into(), rgba(0x8c323aff).into()),
("title".into(), rgba(0x8c323aff).into()),
("type".into(), rgba(0x8c323aff).into()),
("variable".into(), rgba(0x8c323aff).into()),
("variable.special".into(), rgba(0x8c323aff).into()),
("variant".into(), rgba(0x8c323aff).into()),
],
styles: UserThemeStylesRefinement {
colors: ThemeColorsRefinement {
border: Some(rgba(0xddd6c1ff).into()),
border_variant: Some(rgba(0xddd6c1ff).into()),
border_focused: Some(rgba(0xddd6c1ff).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()),
tab_inactive_background: Some(rgba(0xd3cbb7ff).into()),
tab_active_background: Some(rgba(0xfdf6e3ff).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()
},
},
},
],
scales: default_color_scales(),
}
}

View File

@ -1,182 +1,37 @@
use gpui::rgba;
use crate::{
default_color_scales, Appearance, GitStatusColors, PlayerColor, PlayerColors, StatusColors,
SyntaxTheme, SystemColors, Theme, ThemeColors, ThemeFamily, ThemeStyles,
Appearance, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement,
};
pub fn synthwave_84() -> ThemeFamily {
ThemeFamily {
id: "161a14a0-533c-4df1-b909-2bac37ac807d".into(),
pub fn synthwave_84() -> UserThemeFamily {
UserThemeFamily {
name: "Synthwave 84".into(),
author: "Robb Owen (robb0wen)".into(),
themes: vec![Theme {
id: "7a7102b7-8778-4c24-ba79-7407857b4f8c".into(),
themes: vec![UserTheme {
name: "Synthwave 84".into(),
appearance: Appearance::Dark,
styles: ThemeStyles {
system: SystemColors {
transparent: rgba(0x00000000).into(),
mac_os_traffic_light_red: rgba(0xec6b5fff).into(),
mac_os_traffic_light_yellow: rgba(0xf3bf4dff).into(),
mac_os_traffic_light_green: rgba(0x61c454ff).into(),
},
colors: ThemeColors {
border: rgba(0x363a3fff).into(),
border_variant: rgba(0x2e3135ff).into(),
border_focused: rgba(0x004073ff).into(),
border_selected: rgba(0x004073ff).into(),
border_transparent: rgba(0x00000000).into(),
border_disabled: rgba(0x212225ff).into(),
elevated_surface_background: rgba(0x18191bff).into(),
surface_background: rgba(0x18191bff).into(),
background: rgba(0x252334ff).into(),
element_background: rgba(0x614d85ff).into(),
element_hover: rgba(0x272a2dff).into(),
element_active: rgba(0x2e3135ff).into(),
element_selected: rgba(0x2e3135ff).into(),
element_disabled: rgba(0xddeaf814).into(),
element_placeholder: rgba(0xb0b4baff).into(),
element_drop_target: rgba(0x1166fb18).into(),
ghost_element_background: rgba(0x00000000).into(),
ghost_element_hover: rgba(0x272a2dff).into(),
ghost_element_active: rgba(0x2e3135ff).into(),
ghost_element_selected: rgba(0x2e3135ff).into(),
ghost_element_disabled: rgba(0xddeaf814).into(),
text: rgba(0xffffffff).into(),
text_muted: rgba(0xb0b4baff).into(),
text_placeholder: rgba(0x767a83ff).into(),
text_disabled: rgba(0x696e77ff).into(),
text_accent: rgba(0x6fb8ffff).into(),
icon: rgba(0xb0b4baff).into(),
icon_muted: rgba(0x767a83ff).into(),
icon_disabled: rgba(0x696e77ff).into(),
icon_placeholder: rgba(0x767a83ff).into(),
icon_accent: rgba(0x6fb8ffff).into(),
status_bar_background: rgba(0x18191bff).into(),
title_bar_background: rgba(0x18191bff).into(),
toolbar_background: rgba(0x111113ff).into(),
tab_bar_background: rgba(0x18191bff).into(),
tab_inactive_background: rgba(0x252334ff).into(),
tab_active_background: rgba(0x111113ff).into(),
editor_background: rgba(0x111113ff).into(),
editor_gutter_background: rgba(0x111113ff).into(),
editor_subheader_background: rgba(0x18191bff).into(),
editor_active_line_background: rgba(0xddeaf814).into(),
editor_highlighted_line_background: rgba(0xd3edf81d).into(),
editor_line_number: rgba(0xddeaf814).into(),
editor_active_line_number: rgba(0xddeaf814).into(),
editor_invisible: rgba(0xd3edf81d).into(),
editor_wrap_guide: rgba(0xd3edf81d).into(),
editor_active_wrap_guide: rgba(0xd3edf81d).into(),
editor_document_highlight_read_background: rgba(0xd3edf81d).into(),
editor_document_highlight_write_background: rgba(0xd3edf81d).into(),
terminal_background: rgba(0x111113ff).into(),
terminal_ansi_bright_black: rgba(0x000000e6).into(),
terminal_ansi_bright_red: rgba(0xfe444fff).into(),
terminal_ansi_bright_green: rgba(0x71f1b7ff).into(),
terminal_ansi_bright_yellow: rgba(0xfede5cff).into(),
terminal_ansi_bright_blue: rgba(0x02edf9ff).into(),
terminal_ansi_bright_magenta: rgba(0xff7ddaff).into(),
terminal_ansi_bright_cyan: rgba(0x02edf9ff).into(),
terminal_ansi_bright_white: rgba(0xb0b4baff).into(),
terminal_ansi_black: rgba(0x000000f2).into(),
terminal_ansi_red: rgba(0xfe444fff).into(),
terminal_ansi_green: rgba(0x71f1b7ff).into(),
terminal_ansi_yellow: rgba(0xf3e70fff).into(),
terminal_ansi_blue: rgba(0x02edf9ff).into(),
terminal_ansi_magenta: rgba(0xff7ddaff).into(),
terminal_ansi_cyan: rgba(0x02edf9ff).into(),
terminal_ansi_white: rgba(0xedeef0ff).into(),
},
status: StatusColors {
conflict: rgba(0xff9592ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
error: rgba(0xff9592ff).into(),
hidden: rgba(0xb0b4baff).into(),
ignored: rgba(0xb0b4baff).into(),
info: rgba(0x6fb8ffff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
success: rgba(0x70cf82ff).into(),
warning: rgba(0xf5e147ff).into(),
},
git: GitStatusColors {
conflict: rgba(0xffa057ff).into(),
created: rgba(0x70cf82ff).into(),
deleted: rgba(0xff9592ff).into(),
ignored: rgba(0xb0b4baff).into(),
modified: rgba(0xf5e147ff).into(),
renamed: rgba(0x6fb8ffff).into(),
},
player: PlayerColors(vec![
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
PlayerColor {
cursor: rgba(0x000000ff).into(),
background: rgba(0x000000ff).into(),
selection: rgba(0x000000ff).into(),
},
]),
syntax: SyntaxTheme {
highlights: vec![
("attribute".into(), rgba(0x4ccce6ff).into()),
("boolean".into(), rgba(0xff977dff).into()),
("comment".into(), rgba(0xb0b4baff).into()),
("comment.doc".into(), rgba(0xe0dffeff).into()),
("constant".into(), rgba(0x8c323aff).into()),
("constructor".into(), rgba(0x8c323aff).into()),
("embedded".into(), rgba(0x8c323aff).into()),
("emphasis".into(), rgba(0x8c323aff).into()),
("emphasis.strong".into(), rgba(0x8c323aff).into()),
("enum".into(), rgba(0x8c323aff).into()),
("function".into(), rgba(0x8c323aff).into()),
("hint".into(), rgba(0x8c323aff).into()),
("keyword".into(), rgba(0xffa057ff).into()),
("label".into(), rgba(0x8c323aff).into()),
("link_text".into(), rgba(0x8c323aff).into()),
("link_uri".into(), rgba(0x8c323aff).into()),
("number".into(), rgba(0x8c323aff).into()),
("operator".into(), rgba(0x8c323aff).into()),
("predictive".into(), rgba(0x8c323aff).into()),
("preproc".into(), rgba(0x8c323aff).into()),
("primary".into(), rgba(0x8c323aff).into()),
("property".into(), rgba(0x8c323aff).into()),
("punctuation".into(), rgba(0xb0b4baff).into()),
("punctuation.bracket".into(), rgba(0xb0b4baff).into()),
("punctuation.delimiter".into(), rgba(0xb0b4baff).into()),
("punctuation.list_marker".into(), rgba(0x6fb8ffff).into()),
("punctuation.special".into(), rgba(0x8c323aff).into()),
("string".into(), rgba(0x1ed8a3ff).into()),
("string.escape".into(), rgba(0x8c323aff).into()),
("string.regex".into(), rgba(0xff977dff).into()),
("string.special".into(), rgba(0x8c323aff).into()),
("string.special.symbol".into(), rgba(0x8c323aff).into()),
("tag".into(), rgba(0x8c323aff).into()),
("text.literal".into(), rgba(0x8c323aff).into()),
("title".into(), rgba(0x8c323aff).into()),
("type".into(), rgba(0x8c323aff).into()),
("variable".into(), rgba(0x8c323aff).into()),
("variable.special".into(), rgba(0x8c323aff).into()),
("variant".into(), rgba(0x8c323aff).into()),
],
styles: UserThemeStylesRefinement {
colors: ThemeColorsRefinement {
background: Some(rgba(0x252334ff).into()),
element_background: Some(rgba(0x614d85ff).into()),
text: Some(rgba(0xffffffff).into()),
tab_inactive_background: Some(rgba(0x252334ff).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()
},
},
}],
scales: default_color_scales(),
}
}

View File

@ -0,0 +1,25 @@
use refineable::Refineable;
use serde::Deserialize;
use crate::{Appearance, ThemeColors, ThemeColorsRefinement};
#[derive(Deserialize)]
pub struct UserThemeFamily {
pub name: String,
pub author: String,
pub themes: Vec<UserTheme>,
}
#[derive(Deserialize)]
pub struct UserTheme {
pub name: String,
pub appearance: Appearance,
pub styles: UserThemeStylesRefinement,
}
#[derive(Refineable, Clone)]
#[refineable(deserialize)]
pub struct UserThemeStyles {
#[refineable]
pub colors: ThemeColors,
}

View File

@ -13,10 +13,10 @@ use gpui::serde_json;
use log::LevelFilter;
use serde::Deserialize;
use simplelog::SimpleLogger;
use theme::{default_color_scales, Appearance, ThemeFamily};
use theme::{Appearance, UserThemeFamily};
use vscode::VsCodeThemeConverter;
use crate::theme_printer::ThemeFamilyPrinter;
use crate::theme_printer::UserThemeFamilyPrinter;
use crate::vscode::VsCodeTheme;
#[derive(Debug, Deserialize)]
@ -120,12 +120,10 @@ fn main() -> Result<()> {
themes.push(theme);
}
let theme_family = ThemeFamily {
id: uuid::Uuid::new_v4().to_string(),
let theme_family = UserThemeFamily {
name: family_metadata.name.into(),
author: family_metadata.author.into(),
themes,
scales: default_color_scales(),
};
theme_families.push(theme_family);
@ -157,15 +155,14 @@ fn main() -> Result<()> {
use gpui::rgba;
use crate::{{
default_color_scales, Appearance, GitStatusColors, PlayerColor, PlayerColors, StatusColors,
SyntaxTheme, SystemColors, ThemeColors, ThemeFamily, ThemeStyles, ThemeVariant,
Appearance, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement,
}};
pub fn {theme_family_slug}() -> ThemeFamily {{
pub fn {theme_family_slug}() -> UserThemeFamily {{
{theme_family_definition}
}}
"#,
theme_family_definition = format!("{:#?}", ThemeFamilyPrinter::new(theme_family))
theme_family_definition = format!("{:#?}", UserThemeFamilyPrinter::new(theme_family))
);
output_file.write_all(theme_module.as_bytes())?;
@ -175,9 +172,9 @@ fn main() -> Result<()> {
let themes_vector_contents = format!(
r#"
use crate::ThemeFamily;
use crate::UserThemeFamily;
pub(crate) fn all_imported_themes() -> Vec<ThemeFamily> {{
pub(crate) fn all_imported_themes() -> Vec<UserThemeFamily> {{
vec![{all_themes}]
}}
"#,

View File

@ -3,7 +3,7 @@ use std::fmt::{self, Debug};
use gpui::{Hsla, Rgba};
use theme::{
Appearance, GitStatusColors, PlayerColor, PlayerColors, StatusColors, SyntaxTheme,
SystemColors, Theme, ThemeColors, ThemeFamily, ThemeStyles,
SystemColors, ThemeColorsRefinement, UserTheme, UserThemeFamily, UserThemeStylesRefinement,
};
struct RawSyntaxPrinter<'a>(&'a str);
@ -38,18 +38,17 @@ impl<'a, T: Debug> Debug for VecPrinter<'a, T> {
}
}
pub struct ThemeFamilyPrinter(ThemeFamily);
pub struct UserThemeFamilyPrinter(UserThemeFamily);
impl ThemeFamilyPrinter {
pub fn new(theme_family: ThemeFamily) -> Self {
impl UserThemeFamilyPrinter {
pub fn new(theme_family: UserThemeFamily) -> Self {
Self(theme_family)
}
}
impl Debug for ThemeFamilyPrinter {
impl Debug for UserThemeFamilyPrinter {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("ThemeFamily")
.field("id", &IntoPrinter(&self.0.id))
f.debug_struct("UserThemeFamily")
.field("name", &IntoPrinter(&self.0.name))
.field("author", &IntoPrinter(&self.0.author))
.field(
@ -59,24 +58,22 @@ impl Debug for ThemeFamilyPrinter {
.0
.themes
.iter()
.map(|theme| ThemeVariantPrinter(theme))
.map(|theme| UserThemePrinter(theme))
.collect(),
),
)
.field("scales", &RawSyntaxPrinter("default_color_scales()"))
.finish()
}
}
pub struct ThemeVariantPrinter<'a>(&'a Theme);
pub struct UserThemePrinter<'a>(&'a UserTheme);
impl<'a> Debug for ThemeVariantPrinter<'a> {
impl<'a> Debug for UserThemePrinter<'a> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("ThemeVariant")
.field("id", &IntoPrinter(&self.0.id))
f.debug_struct("UserTheme")
.field("name", &IntoPrinter(&self.0.name))
.field("appearance", &AppearancePrinter(self.0.appearance))
.field("styles", &ThemeStylesPrinter(&self.0.styles))
.field("styles", &UserThemeStylesRefinementPrinter(&self.0.styles))
.finish()
}
}
@ -89,17 +86,12 @@ impl Debug for AppearancePrinter {
}
}
pub struct ThemeStylesPrinter<'a>(&'a ThemeStyles);
pub struct UserThemeStylesRefinementPrinter<'a>(&'a UserThemeStylesRefinement);
impl<'a> Debug for ThemeStylesPrinter<'a> {
impl<'a> Debug for UserThemeStylesRefinementPrinter<'a> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("ThemeStyles")
.field("system", &SystemColorsPrinter(&self.0.system))
.field("colors", &ThemeColorsPrinter(&self.0.colors))
.field("status", &StatusColorsPrinter(&self.0.status))
.field("git", &GitStatusColorsPrinter(&self.0.git))
.field("player", &PlayerColorsPrinter(&self.0.player))
.field("syntax", &SyntaxThemePrinter(&self.0.syntax))
f.debug_struct("UserThemeStylesRefinement")
.field("colors", &ThemeColorsRefinementPrinter(&self.0.colors))
.finish()
}
}
@ -126,204 +118,136 @@ impl<'a> Debug for SystemColorsPrinter<'a> {
}
}
pub struct ThemeColorsPrinter<'a>(&'a ThemeColors);
pub struct ThemeColorsRefinementPrinter<'a>(&'a ThemeColorsRefinement);
impl<'a> Debug for ThemeColorsPrinter<'a> {
impl<'a> Debug for ThemeColorsRefinementPrinter<'a> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("ThemeColors")
.field("border", &HslaPrinter(self.0.border))
.field("border_variant", &HslaPrinter(self.0.border_variant))
.field("border_focused", &HslaPrinter(self.0.border_focused))
.field("border_selected", &HslaPrinter(self.0.border_selected))
.field(
"border_transparent",
&HslaPrinter(self.0.border_transparent),
)
.field("border_disabled", &HslaPrinter(self.0.border_disabled))
.field(
let theme_colors = vec![
("border", self.0.border),
("border_variant", self.0.border_variant),
("border_focused", self.0.border_focused),
("border_selected", self.0.border_selected),
("border_transparent", self.0.border_transparent),
("border_disabled", self.0.border_disabled),
(
"elevated_surface_background",
&HslaPrinter(self.0.elevated_surface_background),
)
.field(
"surface_background",
&HslaPrinter(self.0.surface_background),
)
.field("background", &HslaPrinter(self.0.background))
.field(
"element_background",
&HslaPrinter(self.0.element_background),
)
.field("element_hover", &HslaPrinter(self.0.element_hover))
.field("element_active", &HslaPrinter(self.0.element_active))
.field("element_selected", &HslaPrinter(self.0.element_selected))
.field("element_disabled", &HslaPrinter(self.0.element_disabled))
.field(
"element_placeholder",
&HslaPrinter(self.0.element_placeholder),
)
.field(
"element_drop_target",
&HslaPrinter(self.0.element_drop_target),
)
.field(
"ghost_element_background",
&HslaPrinter(self.0.ghost_element_background),
)
.field(
"ghost_element_hover",
&HslaPrinter(self.0.ghost_element_hover),
)
.field(
"ghost_element_active",
&HslaPrinter(self.0.ghost_element_active),
)
.field(
"ghost_element_selected",
&HslaPrinter(self.0.ghost_element_selected),
)
.field(
"ghost_element_disabled",
&HslaPrinter(self.0.ghost_element_disabled),
)
.field("text", &HslaPrinter(self.0.text))
.field("text_muted", &HslaPrinter(self.0.text_muted))
.field("text_placeholder", &HslaPrinter(self.0.text_placeholder))
.field("text_disabled", &HslaPrinter(self.0.text_disabled))
.field("text_accent", &HslaPrinter(self.0.text_accent))
.field("icon", &HslaPrinter(self.0.icon))
.field("icon_muted", &HslaPrinter(self.0.icon_muted))
.field("icon_disabled", &HslaPrinter(self.0.icon_disabled))
.field("icon_placeholder", &HslaPrinter(self.0.icon_placeholder))
.field("icon_accent", &HslaPrinter(self.0.icon_accent))
.field(
"status_bar_background",
&HslaPrinter(self.0.status_bar_background),
)
.field(
"title_bar_background",
&HslaPrinter(self.0.title_bar_background),
)
.field(
"toolbar_background",
&HslaPrinter(self.0.toolbar_background),
)
.field(
"tab_bar_background",
&HslaPrinter(self.0.tab_bar_background),
)
.field(
"tab_inactive_background",
&HslaPrinter(self.0.tab_inactive_background),
)
.field(
"tab_active_background",
&HslaPrinter(self.0.tab_active_background),
)
.field("editor_background", &HslaPrinter(self.0.editor_background))
.field(
"editor_gutter_background",
&HslaPrinter(self.0.editor_gutter_background),
)
.field(
self.0.elevated_surface_background,
),
("surface_background", self.0.surface_background),
("background", self.0.background),
("element_background", self.0.element_background),
("element_hover", self.0.element_hover),
("element_active", self.0.element_active),
("element_selected", self.0.element_selected),
("element_disabled", self.0.element_disabled),
("element_placeholder", self.0.element_placeholder),
("element_drop_target", self.0.element_drop_target),
("ghost_element_background", self.0.ghost_element_background),
("ghost_element_hover", self.0.ghost_element_hover),
("ghost_element_active", self.0.ghost_element_active),
("ghost_element_selected", self.0.ghost_element_selected),
("ghost_element_disabled", self.0.ghost_element_disabled),
("text", self.0.text),
("text_muted", self.0.text_muted),
("text_placeholder", self.0.text_placeholder),
("text_disabled", self.0.text_disabled),
("text_accent", self.0.text_accent),
("icon", self.0.icon),
("icon_muted", self.0.icon_muted),
("icon_disabled", self.0.icon_disabled),
("icon_placeholder", self.0.icon_placeholder),
("icon_accent", self.0.icon_accent),
("status_bar_background", self.0.status_bar_background),
("title_bar_background", self.0.title_bar_background),
("toolbar_background", self.0.toolbar_background),
("tab_bar_background", self.0.tab_bar_background),
("tab_inactive_background", self.0.tab_inactive_background),
("tab_active_background", self.0.tab_active_background),
("editor_background", self.0.editor_background),
("editor_gutter_background", self.0.editor_gutter_background),
(
"editor_subheader_background",
&HslaPrinter(self.0.editor_subheader_background),
)
.field(
self.0.editor_subheader_background,
),
(
"editor_active_line_background",
&HslaPrinter(self.0.editor_active_line_background),
)
.field(
self.0.editor_active_line_background,
),
(
"editor_highlighted_line_background",
&HslaPrinter(self.0.editor_highlighted_line_background),
)
.field(
"editor_line_number",
&HslaPrinter(self.0.editor_line_number),
)
.field(
self.0.editor_highlighted_line_background,
),
("editor_line_number", self.0.editor_line_number),
(
"editor_active_line_number",
&HslaPrinter(self.0.editor_active_line_number),
)
.field("editor_invisible", &HslaPrinter(self.0.editor_invisible))
.field("editor_wrap_guide", &HslaPrinter(self.0.editor_wrap_guide))
.field(
"editor_active_wrap_guide",
&HslaPrinter(self.0.editor_active_wrap_guide),
)
.field(
self.0.editor_active_line_number,
),
("editor_invisible", self.0.editor_invisible),
("editor_wrap_guide", self.0.editor_wrap_guide),
("editor_active_wrap_guide", self.0.editor_active_wrap_guide),
(
"editor_document_highlight_read_background",
&HslaPrinter(self.0.editor_document_highlight_read_background),
)
.field(
self.0.editor_document_highlight_read_background,
),
(
"editor_document_highlight_write_background",
&HslaPrinter(self.0.editor_document_highlight_write_background),
)
.field(
"terminal_background",
&HslaPrinter(self.0.terminal_background),
)
.field(
self.0.editor_document_highlight_write_background,
),
("terminal_background", self.0.terminal_background),
(
"terminal_ansi_bright_black",
&HslaPrinter(self.0.terminal_ansi_bright_black),
)
.field(
"terminal_ansi_bright_red",
&HslaPrinter(self.0.terminal_ansi_bright_red),
)
.field(
self.0.terminal_ansi_bright_black,
),
("terminal_ansi_bright_red", self.0.terminal_ansi_bright_red),
(
"terminal_ansi_bright_green",
&HslaPrinter(self.0.terminal_ansi_bright_green),
)
.field(
self.0.terminal_ansi_bright_green,
),
(
"terminal_ansi_bright_yellow",
&HslaPrinter(self.0.terminal_ansi_bright_yellow),
)
.field(
self.0.terminal_ansi_bright_yellow,
),
(
"terminal_ansi_bright_blue",
&HslaPrinter(self.0.terminal_ansi_bright_blue),
)
.field(
self.0.terminal_ansi_bright_blue,
),
(
"terminal_ansi_bright_magenta",
&HslaPrinter(self.0.terminal_ansi_bright_magenta),
)
.field(
self.0.terminal_ansi_bright_magenta,
),
(
"terminal_ansi_bright_cyan",
&HslaPrinter(self.0.terminal_ansi_bright_cyan),
)
.field(
self.0.terminal_ansi_bright_cyan,
),
(
"terminal_ansi_bright_white",
&HslaPrinter(self.0.terminal_ansi_bright_white),
)
.field(
"terminal_ansi_black",
&HslaPrinter(self.0.terminal_ansi_black),
)
.field("terminal_ansi_red", &HslaPrinter(self.0.terminal_ansi_red))
.field(
"terminal_ansi_green",
&HslaPrinter(self.0.terminal_ansi_green),
)
.field(
"terminal_ansi_yellow",
&HslaPrinter(self.0.terminal_ansi_yellow),
)
.field(
"terminal_ansi_blue",
&HslaPrinter(self.0.terminal_ansi_blue),
)
.field(
"terminal_ansi_magenta",
&HslaPrinter(self.0.terminal_ansi_magenta),
)
.field(
"terminal_ansi_cyan",
&HslaPrinter(self.0.terminal_ansi_cyan),
)
.field(
"terminal_ansi_white",
&HslaPrinter(self.0.terminal_ansi_white),
)
.finish()
self.0.terminal_ansi_bright_white,
),
("terminal_ansi_black", self.0.terminal_ansi_black),
("terminal_ansi_red", self.0.terminal_ansi_red),
("terminal_ansi_green", self.0.terminal_ansi_green),
("terminal_ansi_yellow", self.0.terminal_ansi_yellow),
("terminal_ansi_blue", self.0.terminal_ansi_blue),
("terminal_ansi_magenta", self.0.terminal_ansi_magenta),
("terminal_ansi_cyan", self.0.terminal_ansi_cyan),
("terminal_ansi_white", self.0.terminal_ansi_white),
];
f.write_str("ThemeColorsRefinement {")?;
for (color_name, color) in theme_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("}")
}
}

View File

@ -1,10 +1,7 @@
use anyhow::Result;
use gpui::{Hsla, Refineable, Rgba};
use gpui::{Hsla, Rgba};
use serde::Deserialize;
use theme::{
Appearance, GitStatusColors, PlayerColors, StatusColors, SyntaxTheme, SystemColors, Theme,
ThemeColors, ThemeColorsRefinement, ThemeStyles,
};
use theme::{ThemeColorsRefinement, UserTheme, UserThemeStylesRefinement};
use crate::util::Traverse;
use crate::ThemeMetadata;
@ -433,14 +430,9 @@ impl VsCodeThemeConverter {
}
}
pub fn convert(self) -> Result<Theme> {
pub fn convert(self) -> Result<UserTheme> {
let appearance = self.theme_metadata.appearance.into();
let mut theme_colors = match appearance {
Appearance::Light => ThemeColors::default_light(),
Appearance::Dark => ThemeColors::default_dark(),
};
let vscode_colors = &self.theme.colors;
let theme_colors_refinements = ThemeColorsRefinement {
@ -567,40 +559,12 @@ impl VsCodeThemeConverter {
..Default::default()
};
theme_colors.refine(&theme_colors_refinements);
Ok(Theme {
id: uuid::Uuid::new_v4().to_string(),
Ok(UserTheme {
name: self.theme_metadata.name.into(),
appearance,
styles: ThemeStyles {
system: SystemColors::default(),
colors: theme_colors,
status: StatusColors::default(),
git: GitStatusColors::default(),
player: PlayerColors::default(),
syntax: SyntaxTheme::default_dark(),
styles: UserThemeStylesRefinement {
colors: theme_colors_refinements,
},
})
}
}
// #[cfg(test)]
// mod tests {
// use super::*;
// use std::path::PathBuf;
// #[test]
// fn test_deserialize_theme() {
// let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
// let root_dir = manifest_dir.parent().unwrap().parent().unwrap();
// let mut d = root_dir.to_path_buf();
// d.push("assets/themes/src/vsc/dracula/dracula.json");
// let data = std::fs::read_to_string(d).expect("Unable to read file");
// let result: Theme = serde_json::from_str(&data).unwrap();
// println!("{:#?}", result);
// }
// }