commit 60ded246ee4957ea352aef2c07a206d71434cd74 Author: flemming-it Date: Tue Jun 2 01:35:53 2026 +0200 chore: initial studio-theme-sunset 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..5dac96c --- /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_sunset.wasm + +[package] +name = "studio_theme_sunset" +version = "0.1.0" +edition = "2021" +authors = ["Dr. Stefan Flemming "] +license = "Apache-2.0" +publish = false +description = "F∆I Studio plugin — Dusky pink / orange / violet Studio theme." +repository = "https://git.flemming.ai/fai-plugins/studio-theme-sunset" +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..124adb0 --- /dev/null +++ b/MODULE.de.md @@ -0,0 +1,8 @@ +# sunset + +Sonnenuntergangs-Look in Pink / Orange / Violett. + +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..358fb1d --- /dev/null +++ b/MODULE.md @@ -0,0 +1,19 @@ +# sunset + +Dusky pink / orange / violet 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 + +- Demo presentations — the palette photographs well +- Onboarding sessions where you want the UI to feel + welcoming rather than enterprise +- Operators who simply prefer warmer tones over cool ones + +Pink primary, orange secondary, purple tertiary. The +gradient feel matches FaiEditorStyle.modern (gradient +canvas backdrop) particularly well. diff --git a/README.md b/README.md new file mode 100644 index 0000000..fc2cb6c --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# studio-theme-sunset + +Dusky pink / orange / violet Studio theme. + +Ships a Material 3 ColorScheme pair (light + dark) through +the WIT `theme` export. Studio loads it as a +`studio.theme.sunset` 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_sunset.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..caf2426 Binary files /dev/null and b/module.wasm differ diff --git a/module.yaml b/module.yaml new file mode 100644 index 0000000..db66b4b --- /dev/null +++ b/module.yaml @@ -0,0 +1,17 @@ +schema_version: 3 +provider: fai +name: studio-theme-sunset +version: 0.1.0 + +provides: + - capability: studio.theme.sunset + 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..5e52c83 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,91 @@ +//! `studio.theme.sunset` — warm dusk Studio theme. +//! +//! Pink / orange / violet gradient feel. Reads like the sky +//! 20 minutes after sunset: still bright at the horizon, +//! purple settling in above. Light mode keeps a warm-white +//! surface; dark mode drops into a deep mulberry navy. + +#![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 SUNSET_LIGHT: [u32; 14] = [ + 0xFFE91E63, // primary — pink 500 + 0xFFFFFFFF, // on_primary + 0xFFFF7043, // secondary — deep orange 400 + 0xFFFFFFFF, // on_secondary + 0xFF8E24AA, // tertiary — purple 600 + 0xFFFFFFFF, // on_tertiary + 0xFFC62828, // error + 0xFFFFFFFF, // on_error + 0xFFFFF5F0, // surface — warm whitespace + 0xFF38121F, // on_surface + 0xFFFFDDD0, // surface_variant + 0xFF804040, // on_surface_variant + 0xFFC97070, // outline + 0xFFE6BFB5, // outline_variant +]; + +const SUNSET_DARK: [u32; 14] = [ + 0xFFF48FB1, // primary — pink 200 + 0xFF38121F, // on_primary + 0xFFFFAB91, // secondary — deep orange 200 + 0xFF381200, // on_secondary + 0xFFCE93D8, // tertiary — purple 200 + 0xFF38003A, // on_tertiary + 0xFFEF5350, // error + 0xFF1A0000, // on_error + 0xFF2A0F1F, // surface — dark sunset + 0xFFFFD6E0, // on_surface + 0xFF4A2030, // surface_variant + 0xFFE6BFB5, // on_surface_variant + 0xFF806060, // outline + 0xFF4A2D38, // outline_variant +]; + +struct SunsetPlugin; + +impl bindings::exports::fai::studio_plugin::theme::Guest for SunsetPlugin { + fn theme_for(brightness: String) -> Result { + let tokens = match brightness.as_str() { + "light" => SUNSET_LIGHT.to_vec(), + "dark" => SUNSET_DARK.to_vec(), + other => { + return Err(PluginError::Declined(format!( + "sunset has no scheme for brightness '{other}' \ + (supported: light, dark)" + ))); + } + }; + Ok(ColorScheme { brightness, tokens }) + } +} + +impl bindings::exports::fai::studio_plugin::translate::Guest for SunsetPlugin { + fn translate( + _text: String, + _from_locale: String, + _to_locale: String, + ) -> Result { + Err(PluginError::Declined( + "sunset is a theme plugin and does not translate".to_string(), + )) + } +} + +impl bindings::exports::fai::studio_plugin::output_view::Guest for SunsetPlugin { + fn render( + _mime_type: String, + _data: Vec, + ) -> Result { + Err(PluginError::Declined( + "sunset is a theme plugin and does not render outputs".to_string(), + )) + } +} + +export_plugin!(SunsetPlugin);