mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-25 20:11:49 +03:00
Add Noctis Theme
This commit is contained in:
parent
f8504c349c
commit
80f80df5cf
2
.gitignore
vendored
2
.gitignore
vendored
@ -24,5 +24,3 @@ DerivedData/
|
||||
.netrc
|
||||
.swiftpm
|
||||
**/*.db
|
||||
**/src/themes/*.rs
|
||||
!**/src/themes/.gitkeep
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "Andromeda",
|
||||
"name": "Gruvbox",
|
||||
"author": "morhetz",
|
||||
"themes": [
|
||||
{
|
||||
|
9
assets/themes/src/vscode/noctis/LICENSE
Normal file
9
assets/themes/src/vscode/noctis/LICENSE
Normal file
@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 Liviu Schera
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1113
assets/themes/src/vscode/noctis/azureus.json
Normal file
1113
assets/themes/src/vscode/noctis/azureus.json
Normal file
File diff suppressed because it is too large
Load Diff
1112
assets/themes/src/vscode/noctis/bordo.json
Normal file
1112
assets/themes/src/vscode/noctis/bordo.json
Normal file
File diff suppressed because it is too large
Load Diff
61
assets/themes/src/vscode/noctis/family.json
Normal file
61
assets/themes/src/vscode/noctis/family.json
Normal file
@ -0,0 +1,61 @@
|
||||
{
|
||||
"name": "Notctis",
|
||||
"author": "Liviu Schera (liviuschera)",
|
||||
"themes": [
|
||||
{
|
||||
"name": "Noctis Azureus",
|
||||
"file_name": "azureus.json",
|
||||
"appearance": "dark"
|
||||
},
|
||||
{
|
||||
"name": "Noctis Bordo",
|
||||
"file_name": "bordo.json",
|
||||
"appearance": "dark"
|
||||
},
|
||||
{
|
||||
"name": "Noctus Hibernus",
|
||||
"file_name": "hibernus.json",
|
||||
"appearance": "light"
|
||||
},
|
||||
{
|
||||
"name": "Noctis Lilac",
|
||||
"file_name": "lilac.json",
|
||||
"appearance": "dark"
|
||||
},
|
||||
{
|
||||
"name": "Noctis Lux",
|
||||
"file_name": "lux.json",
|
||||
"appearance": "light"
|
||||
},
|
||||
{
|
||||
"name": "Noctis Minimus",
|
||||
"file_name": "minimus.json",
|
||||
"appearance": "dark"
|
||||
},
|
||||
{
|
||||
"name": "Noctis",
|
||||
"file_name": "noctis.json",
|
||||
"appearance": "dark"
|
||||
},
|
||||
{
|
||||
"name": "Noctis Obscuro",
|
||||
"file_name": "obscuro.json",
|
||||
"appearance": "dark"
|
||||
},
|
||||
{
|
||||
"name": "Noctis Sereno",
|
||||
"file_name": "obscuro.json",
|
||||
"appearance": "dark"
|
||||
},
|
||||
{
|
||||
"name": "Noctis Uva",
|
||||
"file_name": "uva.json",
|
||||
"appearance": "dark"
|
||||
},
|
||||
{
|
||||
"name": "Noctis Viola",
|
||||
"file_name": "viola.json",
|
||||
"appearance": "dark"
|
||||
}
|
||||
]
|
||||
}
|
1108
assets/themes/src/vscode/noctis/hibernus.json
Normal file
1108
assets/themes/src/vscode/noctis/hibernus.json
Normal file
File diff suppressed because it is too large
Load Diff
1113
assets/themes/src/vscode/noctis/lilac.json
Normal file
1113
assets/themes/src/vscode/noctis/lilac.json
Normal file
File diff suppressed because it is too large
Load Diff
1108
assets/themes/src/vscode/noctis/lux.json
Normal file
1108
assets/themes/src/vscode/noctis/lux.json
Normal file
File diff suppressed because it is too large
Load Diff
1113
assets/themes/src/vscode/noctis/minimus.json
Normal file
1113
assets/themes/src/vscode/noctis/minimus.json
Normal file
File diff suppressed because it is too large
Load Diff
1108
assets/themes/src/vscode/noctis/noctis.json
Normal file
1108
assets/themes/src/vscode/noctis/noctis.json
Normal file
File diff suppressed because it is too large
Load Diff
1108
assets/themes/src/vscode/noctis/obscuro.json
Normal file
1108
assets/themes/src/vscode/noctis/obscuro.json
Normal file
File diff suppressed because it is too large
Load Diff
1108
assets/themes/src/vscode/noctis/sereno.json
Normal file
1108
assets/themes/src/vscode/noctis/sereno.json
Normal file
File diff suppressed because it is too large
Load Diff
1112
assets/themes/src/vscode/noctis/uva.json
Normal file
1112
assets/themes/src/vscode/noctis/uva.json
Normal file
File diff suppressed because it is too large
Load Diff
1112
assets/themes/src/vscode/noctis/viola.json
Normal file
1112
assets/themes/src/vscode/noctis/viola.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -5,6 +5,7 @@ mod registry;
|
||||
mod scale;
|
||||
mod settings;
|
||||
mod syntax;
|
||||
mod themes;
|
||||
|
||||
use ::settings::Settings;
|
||||
pub use colors::*;
|
||||
@ -14,6 +15,7 @@ pub use registry::*;
|
||||
pub use scale::*;
|
||||
pub use settings::*;
|
||||
pub use syntax::*;
|
||||
pub use themes::*;
|
||||
|
||||
use gpui::{AppContext, Hsla, SharedString};
|
||||
|
||||
|
18
crates/theme2/src/themes/andromeda.rs
Normal file
18
crates/theme2/src/themes/andromeda.rs
Normal file
File diff suppressed because one or more lines are too long
18
crates/theme2/src/themes/ayu.rs
Normal file
18
crates/theme2/src/themes/ayu.rs
Normal file
File diff suppressed because one or more lines are too long
18
crates/theme2/src/themes/dracula.rs
Normal file
18
crates/theme2/src/themes/dracula.rs
Normal file
File diff suppressed because one or more lines are too long
18
crates/theme2/src/themes/gruvbox.rs
Normal file
18
crates/theme2/src/themes/gruvbox.rs
Normal file
File diff suppressed because one or more lines are too long
12
crates/theme2/src/themes/mod.rs
Normal file
12
crates/theme2/src/themes/mod.rs
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
mod andromeda;
|
||||
mod ayu;
|
||||
mod dracula;
|
||||
mod gruvbox;
|
||||
mod notctis;
|
||||
|
||||
pub use andromeda::*;
|
||||
pub use ayu::*;
|
||||
pub use dracula::*;
|
||||
pub use gruvbox::*;
|
||||
pub use notctis::*;
|
18
crates/theme2/src/themes/notctis.rs
Normal file
18
crates/theme2/src/themes/notctis.rs
Normal file
File diff suppressed because one or more lines are too long
@ -52,11 +52,14 @@ pub struct ThemeMetadata {
|
||||
fn main() -> Result<()> {
|
||||
SimpleLogger::init(LevelFilter::Info, Default::default()).expect("could not initialize logger");
|
||||
|
||||
println!("Creating path: assets/themes/src/vscode/");
|
||||
let vscode_themes_path = PathBuf::from_str("assets/themes/src/vscode/")?;
|
||||
|
||||
let mut theme_families = Vec::new();
|
||||
|
||||
for theme_family_dir in fs::read_dir(&vscode_themes_path)? {
|
||||
println!("Reading directory: {:?}", vscode_themes_path);
|
||||
|
||||
let theme_family_dir = theme_family_dir?;
|
||||
|
||||
if theme_family_dir.file_name().to_str() == Some(".DS_Store") {
|
||||
@ -69,6 +72,10 @@ fn main() -> Result<()> {
|
||||
.ok_or(anyhow!("no file stem"))
|
||||
.map(|stem| stem.to_string_lossy().to_string())?;
|
||||
|
||||
println!(
|
||||
"Opening file: {:?}",
|
||||
theme_family_dir.path().join("family.json")
|
||||
);
|
||||
let family_metadata_file = File::open(theme_family_dir.path().join("family.json"))
|
||||
.context(format!("no `family.json` found for '{theme_family_slug}'"))?;
|
||||
|
||||
@ -82,7 +89,13 @@ fn main() -> Result<()> {
|
||||
for theme_metadata in family_metadata.themes {
|
||||
let theme_file_path = theme_family_dir.path().join(&theme_metadata.file_name);
|
||||
|
||||
let theme_file = File::open(&theme_file_path)?;
|
||||
let theme_file = match File::open(&theme_file_path) {
|
||||
Ok(file) => file,
|
||||
Err(_) => {
|
||||
println!("Failed to open file at path: {:?}", theme_file_path);
|
||||
continue;
|
||||
}
|
||||
};
|
||||
|
||||
let vscode_theme: VsCodeTheme = serde_json::from_reader(theme_file)
|
||||
.context(format!("failed to parse theme {theme_file_path:?}"))?;
|
||||
@ -114,6 +127,10 @@ fn main() -> Result<()> {
|
||||
|
||||
let mut output_file =
|
||||
File::create(themes_output_path.join(format!("{theme_family_slug}.rs")))?;
|
||||
println!(
|
||||
"Creating file: {:?}",
|
||||
themes_output_path.join(format!("{theme_family_slug}.rs"))
|
||||
);
|
||||
|
||||
let theme_module = format!(
|
||||
r#"
|
||||
@ -136,6 +153,10 @@ fn main() -> Result<()> {
|
||||
theme_modules.push(theme_family_slug);
|
||||
}
|
||||
|
||||
println!(
|
||||
"Creating file: {:?}",
|
||||
themes_output_path.join(format!("mod.rs"))
|
||||
);
|
||||
let mut mod_rs_file = File::create(themes_output_path.join(format!("mod.rs")))?;
|
||||
|
||||
let mod_rs_contents = format!(
|
||||
|
Loading…
Reference in New Issue
Block a user