Add Noctis Theme

This commit is contained in:
Nate Butler 2023-11-06 12:43:10 -05:00
parent f8504c349c
commit 80f80df5cf
23 changed files with 12412 additions and 4 deletions

2
.gitignore vendored
View file

@ -24,5 +24,3 @@ DerivedData/
.netrc
.swiftpm
**/*.db
**/src/themes/*.rs
!**/src/themes/.gitkeep

View file

@ -1,5 +1,5 @@
{
"name": "Andromeda",
"name": "Gruvbox",
"author": "morhetz",
"themes": [
{

View 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.

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View 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"
}
]
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -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};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View 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::*;

File diff suppressed because one or more lines are too long

View file

@ -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!(