commit 021beaa9625e7c2d4065be127de81d657d2eb4c5 Author: flemming-it Date: Tue Jun 2 01:35:53 2026 +0200 chore: initial studio-theme-space 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..2075e0f --- /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_space.wasm + +[package] +name = "studio_theme_space" +version = "0.1.0" +edition = "2021" +authors = ["Dr. Stefan Flemming "] +license = "Apache-2.0" +publish = false +description = "F∆I Studio plugin — Deep-space indigo / violet / cyan Studio theme." +repository = "https://git.flemming.ai/fai-plugins/studio-theme-space" +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..5a1128b --- /dev/null +++ b/MODULE.de.md @@ -0,0 +1,8 @@ +# space + +Tiefraum-Indigo / Violett / Cyan Studio-Look. + +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..9941107 --- /dev/null +++ b/MODULE.md @@ -0,0 +1,18 @@ +# space + +Deep-space indigo / violet / cyan 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 + +- Late-night sessions where dark mode helps focus +- Audit work where you want long inspection sessions + without eye strain +- Operators who associate "deep work" with darker palettes + +Light mode is a softer lavender base; dark mode drops the +surface to near-black navy so the canvas reads as the focus. diff --git a/README.md b/README.md new file mode 100644 index 0000000..0044d3b --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# studio-theme-space + +Deep-space indigo / violet / cyan Studio theme. + +Ships a Material 3 ColorScheme pair (light + dark) through +the WIT `theme` export. Studio loads it as a +`studio.theme.space` 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_space.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..e0118cb Binary files /dev/null and b/module.wasm differ diff --git a/module.yaml b/module.yaml new file mode 100644 index 0000000..543a771 --- /dev/null +++ b/module.yaml @@ -0,0 +1,17 @@ +schema_version: 3 +provider: fai +name: studio-theme-space +version: 0.1.0 + +provides: + - capability: studio.theme.space + 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..135cfe9 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,91 @@ +//! `studio.theme.space` — deep-space Studio theme. +//! +//! Indigo / violet / cyan accents over a navy-black surface +//! in dark mode; a softer lavender + indigo pair in light +//! mode. Calm, focused, "starfield at midnight" feel without +//! any actual starfield (themes are pure colour data). + +#![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 SPACE_LIGHT: [u32; 14] = [ + 0xFF5E35B1, // primary — deep purple 600 + 0xFFFFFFFF, // on_primary + 0xFF3949AB, // secondary — indigo 600 + 0xFFFFFFFF, // on_secondary + 0xFF00ACC1, // tertiary — cyan 600 + 0xFFFFFFFF, // on_tertiary + 0xFFD32F2F, // error + 0xFFFFFFFF, // on_error + 0xFFF5F3FF, // surface — pale lavender + 0xFF1A1438, // on_surface — near-black indigo + 0xFFE6E1F5, // surface_variant + 0xFF4A4170, // on_surface_variant + 0xFF8B82B5, // outline + 0xFFC5BFE0, // outline_variant +]; + +const SPACE_DARK: [u32; 14] = [ + 0xFFB39DDB, // primary — deep purple 200 + 0xFF1A1438, // on_primary + 0xFF9FA8DA, // secondary — indigo 200 + 0xFF1A1438, // on_secondary + 0xFF4DD0E1, // tertiary — cyan 300 + 0xFF003540, // on_tertiary + 0xFFEF5350, // error + 0xFF1A0000, // on_error + 0xFF0B0820, // surface — deep-space navy + 0xFFE6E1FF, // on_surface + 0xFF1F1A3D, // surface_variant + 0xFFC0B9E8, // on_surface_variant + 0xFF6E66A0, // outline + 0xFF2A2452, // outline_variant +]; + +struct SpacePlugin; + +impl bindings::exports::fai::studio_plugin::theme::Guest for SpacePlugin { + fn theme_for(brightness: String) -> Result { + let tokens = match brightness.as_str() { + "light" => SPACE_LIGHT.to_vec(), + "dark" => SPACE_DARK.to_vec(), + other => { + return Err(PluginError::Declined(format!( + "space has no scheme for brightness '{other}' \ + (supported: light, dark)" + ))); + } + }; + Ok(ColorScheme { brightness, tokens }) + } +} + +impl bindings::exports::fai::studio_plugin::translate::Guest for SpacePlugin { + fn translate( + _text: String, + _from_locale: String, + _to_locale: String, + ) -> Result { + Err(PluginError::Declined( + "space is a theme plugin and does not translate".to_string(), + )) + } +} + +impl bindings::exports::fai::studio_plugin::output_view::Guest for SpacePlugin { + fn render( + _mime_type: String, + _data: Vec, + ) -> Result { + Err(PluginError::Declined( + "space is a theme plugin and does not render outputs".to_string(), + )) + } +} + +export_plugin!(SpacePlugin);