chore: initial studio-theme-sunflower 0.1.0
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
commit
df89d9ae79
9 changed files with 196 additions and 0 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
target/
|
||||
Cargo.lock
|
||||
32
Cargo.toml
Normal file
32
Cargo.toml
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# Standalone Cargo.toml — targets wasm32-wasip2.
|
||||
#
|
||||
# Build:
|
||||
# cargo build --release --target wasm32-wasip2
|
||||
#
|
||||
# Output: target/wasm32-wasip2/release/studio_theme_sunflower.wasm
|
||||
|
||||
[package]
|
||||
name = "studio_theme_sunflower"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
authors = ["Dr. Stefan Flemming <platform@flemming.ai>"]
|
||||
license = "Apache-2.0"
|
||||
publish = false
|
||||
description = "F∆I Studio plugin — Warm, optimistic yellow / amber Studio theme."
|
||||
repository = "https://git.flemming.ai/fai-plugins/studio-theme-sunflower"
|
||||
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
|
||||
8
MODULE.de.md
Normal file
8
MODULE.de.md
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# sunflower
|
||||
|
||||
Warmer, optimistischer Gelb-/Amber-Look für Studio.
|
||||
|
||||
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.
|
||||
18
MODULE.md
Normal file
18
MODULE.md
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# sunflower
|
||||
|
||||
Warm, optimistic yellow / amber 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
|
||||
|
||||
- Long working sessions on bright displays
|
||||
- Print-friendly previews
|
||||
- When the platform's default cool palette feels clinical
|
||||
|
||||
The amber primary stays readable under direct sunlight; the
|
||||
cream surface is easier on the eyes than pure white for
|
||||
extended use.
|
||||
22
README.md
Normal file
22
README.md
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# studio-theme-sunflower
|
||||
|
||||
Warm, optimistic yellow / amber Studio theme.
|
||||
|
||||
Ships a Material 3 ColorScheme pair (light + dark) through
|
||||
the WIT `theme` export. Studio loads it as a
|
||||
`studio.theme.sunflower` 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_sunflower.wasm`.
|
||||
|
||||
## Palette
|
||||
|
||||
See `src/lib.rs` for the 14 ARGB tokens per brightness, in
|
||||
Material 3 order (primary → on_primary → … → outline_variant).
|
||||
BIN
module.wasm
Normal file
BIN
module.wasm
Normal file
Binary file not shown.
17
module.yaml
Normal file
17
module.yaml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
schema_version: 3
|
||||
provider: fai
|
||||
name: studio-theme-sunflower
|
||||
version: 0.1.0
|
||||
|
||||
provides:
|
||||
- capability: studio.theme.sunflower
|
||||
version: 0.1.0
|
||||
|
||||
inputs: {}
|
||||
outputs: {}
|
||||
|
||||
permissions: []
|
||||
|
||||
studio_extension:
|
||||
hooks:
|
||||
- theme
|
||||
4
rust-toolchain.toml
Normal file
4
rust-toolchain.toml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
[toolchain]
|
||||
channel = "1.86"
|
||||
targets = ["wasm32-wasip2"]
|
||||
components = ["rustfmt", "clippy"]
|
||||
93
src/lib.rs
Normal file
93
src/lib.rs
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
//! `studio.theme.sunflower` — warm, optimistic Studio theme.
|
||||
//!
|
||||
//! Yellow / amber / cream tones designed to feel like working
|
||||
//! at a sunlit kitchen table. Pairs a saturated amber primary
|
||||
//! with deep walnut text in light mode; a golden-amber primary
|
||||
//! over a near-black surface in dark mode.
|
||||
|
||||
#![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;
|
||||
|
||||
/// 14 ARGB tokens, Material 3 order. See the SDK docs for
|
||||
/// the canonical slot ordering.
|
||||
const SUNFLOWER_LIGHT: [u32; 14] = [
|
||||
0xFFFFB300, // primary — amber 600
|
||||
0xFF1B1300, // on_primary — espresso
|
||||
0xFFFF6F00, // secondary — orange 900
|
||||
0xFF1B1300, // on_secondary
|
||||
0xFF8BC34A, // tertiary — leaf green
|
||||
0xFF1B2900, // on_tertiary
|
||||
0xFFC62828, // error
|
||||
0xFFFFFFFF, // on_error
|
||||
0xFFFFFAF0, // surface — floral white
|
||||
0xFF2C1F00, // on_surface — dark walnut
|
||||
0xFFFFF3D6, // surface_variant — light cream
|
||||
0xFF6B4F00, // on_surface_variant
|
||||
0xFFC9A86B, // outline
|
||||
0xFFE6D6A8, // outline_variant
|
||||
];
|
||||
|
||||
const SUNFLOWER_DARK: [u32; 14] = [
|
||||
0xFFFFCA28, // primary — amber 400
|
||||
0xFF2C1F00, // on_primary
|
||||
0xFFFFA726, // secondary — orange 400
|
||||
0xFF2C1F00, // on_secondary
|
||||
0xFFAED581, // tertiary — light green 300
|
||||
0xFF1B2900, // on_tertiary
|
||||
0xFFEF5350, // error
|
||||
0xFF2C0000, // on_error
|
||||
0xFF1F1700, // surface — deep amber-brown
|
||||
0xFFFFE7A8, // on_surface
|
||||
0xFF332507, // surface_variant
|
||||
0xFFC9A86B, // on_surface_variant
|
||||
0xFF806E40, // outline
|
||||
0xFF4A3D14, // outline_variant
|
||||
];
|
||||
|
||||
struct SunflowerPlugin;
|
||||
|
||||
impl bindings::exports::fai::studio_plugin::theme::Guest for SunflowerPlugin {
|
||||
fn theme_for(brightness: String) -> Result<ColorScheme, PluginError> {
|
||||
let tokens = match brightness.as_str() {
|
||||
"light" => SUNFLOWER_LIGHT.to_vec(),
|
||||
"dark" => SUNFLOWER_DARK.to_vec(),
|
||||
other => {
|
||||
return Err(PluginError::Declined(format!(
|
||||
"sunflower has no scheme for brightness '{other}' \
|
||||
(supported: light, dark)"
|
||||
)));
|
||||
}
|
||||
};
|
||||
Ok(ColorScheme { brightness, tokens })
|
||||
}
|
||||
}
|
||||
|
||||
impl bindings::exports::fai::studio_plugin::translate::Guest for SunflowerPlugin {
|
||||
fn translate(
|
||||
_text: String,
|
||||
_from_locale: String,
|
||||
_to_locale: String,
|
||||
) -> Result<String, PluginError> {
|
||||
Err(PluginError::Declined(
|
||||
"sunflower is a theme plugin and does not translate".to_string(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
impl bindings::exports::fai::studio_plugin::output_view::Guest for SunflowerPlugin {
|
||||
fn render(
|
||||
_mime_type: String,
|
||||
_data: Vec<u8>,
|
||||
) -> Result<RenderedOutput, PluginError> {
|
||||
Err(PluginError::Declined(
|
||||
"sunflower is a theme plugin and does not render outputs".to_string(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
export_plugin!(SunflowerPlugin);
|
||||
Loading…
Add table
Add a link
Reference in a new issue