commit 5819e5e4b1babcf80c7669854967e99e2fde0f75 Author: flemming-it Date: Tue Jun 2 01:35:53 2026 +0200 chore: initial studio-theme-glass-apple 0.1.0 Signed-off-by: flemming-it diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2c96eb1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +target/ +Cargo.lock diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..d89bef7 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,32 @@ +# Standalone Cargo.toml — targets wasm32-wasip2. +# +# Build: +# cargo build --release --target wasm32-wasip2 +# +# Output: target/wasm32-wasip2/release/studio_theme_glass_apple.wasm + +[package] +name = "studio_theme_glass_apple" +version = "0.1.0" +edition = "2021" +authors = ["Dr. Stefan Flemming "] +license = "Apache-2.0" +publish = false +description = "F∆I Studio plugin — Cool neutral Apple-system-inspired Studio theme." +repository = "https://git.flemming.ai/fai-plugins/studio-theme-glass-apple" +rust-version = "1.85" + +[lib] +crate-type = ["cdylib"] + +[dependencies] +fai-plugin-sdk = { path = "../../fai_plugin_sdk_rust" } + +[package.metadata.component] +package = "fai:studio-plugin" + +[profile.release] +opt-level = "s" +lto = true +codegen-units = 1 +strip = true diff --git a/MODULE.de.md b/MODULE.de.md new file mode 100644 index 0000000..cc09f0c --- /dev/null +++ b/MODULE.de.md @@ -0,0 +1,8 @@ +# glass-apple + +Klares Apple-inspiriertes Neutral-Theme. + +Eines der mit F∆I Studio gelieferten Theme-Plugins. Nach +Installation erscheint es unter **Einstellungen → Themes** +neben den eingebauten Hell- und Dunkel-Themes. Auswahl +schaltet die gesamte Studio-Oberfläche um — ohne Neustart. diff --git a/MODULE.md b/MODULE.md new file mode 100644 index 0000000..d356c32 --- /dev/null +++ b/MODULE.md @@ -0,0 +1,21 @@ +# glass-apple + +Cool neutral Apple-system-inspired Studio theme. + +This is one of F∆I Studio's bundled theme plugins. When +installed, it appears in **Settings → Themes** alongside the +built-in light and dark themes. Select it and the entire +Studio UI re-themes immediately — no restart required. + +## When to pick this theme + +- Operators on macOS who want the UI to blend with the rest + of their environment +- Anyone who values the SF / Apple system palette as a + pre-tested, accessible baseline +- Demo + screenshot work where the UI needs to look at + home next to other Mac apps + +Combined with FaiEditorStyle.modern (frosted-glass panels ++ gradient backdrop), this is the closest the editor gets +to native-macOS look. diff --git a/README.md b/README.md new file mode 100644 index 0000000..691c49c --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# studio-theme-glass-apple + +Cool neutral Apple-system-inspired Studio theme. + +Ships a Material 3 ColorScheme pair (light + dark) through +the WIT `theme` export. Studio loads it as a +`studio.theme.glass_apple` capability and switches the app's +ColorScheme when the operator picks it from the themes +picker. + +## Build + +```bash +cargo build --release --target wasm32-wasip2 +``` + +Output: `target/wasm32-wasip2/release/studio_theme_glass_apple.wasm`. + +## Palette + +See `src/lib.rs` for the 14 ARGB tokens per brightness, in +Material 3 order (primary → on_primary → … → outline_variant). diff --git a/module.wasm b/module.wasm new file mode 100644 index 0000000..1c87444 Binary files /dev/null and b/module.wasm differ diff --git a/module.yaml b/module.yaml new file mode 100644 index 0000000..4620b49 --- /dev/null +++ b/module.yaml @@ -0,0 +1,17 @@ +schema_version: 3 +provider: fai +name: studio-theme-glass-apple +version: 0.1.0 + +provides: + - capability: studio.theme.glass_apple + version: 0.1.0 + +inputs: {} +outputs: {} + +permissions: [] + +studio_extension: + hooks: + - theme diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..32add0c --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "1.86" +targets = ["wasm32-wasip2"] +components = ["rustfmt", "clippy"] diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..410fc74 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,94 @@ +//! `studio.theme.glass-apple` — clean, neutral, frosted-glass +//! Studio theme inspired by Apple's macOS system palette. +//! +//! Cool grays, blue accent, indigo + green + red system +//! colours. Pairs cleanly with FaiEditorStyle.modern (frosted +//! panel + gradient backdrop) for the "Apple sidebar" feel. +//! Light mode reads as a sunlit studio; dark mode reads as +//! a quiet evening workspace. + +#![allow(clippy::result_large_err)] + +use fai_plugin_sdk::{bindings, export_plugin}; + +type ColorScheme = bindings::fai::studio_plugin::plugin_types::ColorScheme; +type PluginError = bindings::fai::studio_plugin::plugin_types::PluginError; +type RenderedOutput = bindings::fai::studio_plugin::plugin_types::RenderedOutput; + +const GLASS_APPLE_LIGHT: [u32; 14] = [ + 0xFF007AFF, // primary — Apple system blue + 0xFFFFFFFF, // on_primary + 0xFF5856D6, // secondary — Apple system indigo + 0xFFFFFFFF, // on_secondary + 0xFF34C759, // tertiary — Apple system green + 0xFFFFFFFF, // on_tertiary + 0xFFFF3B30, // error — Apple system red + 0xFFFFFFFF, // on_error + 0xFFF2F2F7, // surface — Apple system gray 6 light + 0xFF1C1C1E, // on_surface + 0xFFE5E5EA, // surface_variant — Apple system gray 5 light + 0xFF3A3A3C, // on_surface_variant + 0xFFC7C7CC, // outline + 0xFFD1D1D6, // outline_variant +]; + +const GLASS_APPLE_DARK: [u32; 14] = [ + 0xFF0A84FF, // primary — Apple system blue dark + 0xFFFFFFFF, // on_primary + 0xFF5E5CE6, // secondary — Apple system indigo dark + 0xFFFFFFFF, // on_secondary + 0xFF30D158, // tertiary — Apple system green dark + 0xFF003800, // on_tertiary + 0xFFFF453A, // error — Apple system red dark + 0xFFFFFFFF, // on_error + 0xFF1C1C1E, // surface — Apple system gray 6 dark + 0xFFFFFFFF, // on_surface + 0xFF2C2C2E, // surface_variant — Apple system gray 5 dark + 0xFFEBEBF5, // on_surface_variant + 0xFF48484A, // outline + 0xFF3A3A3C, // outline_variant +]; + +struct GlassApplePlugin; + +impl bindings::exports::fai::studio_plugin::theme::Guest for GlassApplePlugin { + fn theme_for(brightness: String) -> Result { + let tokens = match brightness.as_str() { + "light" => GLASS_APPLE_LIGHT.to_vec(), + "dark" => GLASS_APPLE_DARK.to_vec(), + other => { + return Err(PluginError::Declined(format!( + "glass-apple has no scheme for brightness '{other}' \ + (supported: light, dark)" + ))); + } + }; + Ok(ColorScheme { brightness, tokens }) + } +} + +impl bindings::exports::fai::studio_plugin::translate::Guest for GlassApplePlugin { + fn translate( + _text: String, + _from_locale: String, + _to_locale: String, + ) -> Result { + Err(PluginError::Declined( + "glass-apple is a theme plugin and does not translate".to_string(), + )) + } +} + +impl bindings::exports::fai::studio_plugin::output_view::Guest for GlassApplePlugin { + fn render( + _mime_type: String, + _data: Vec, + ) -> Result { + Err(PluginError::Declined( + "glass-apple is a theme plugin and does not render outputs" + .to_string(), + )) + } +} + +export_plugin!(GlassApplePlugin);