chore: initial studio-theme-glass-apple 0.1.0
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
commit
5819e5e4b1
9 changed files with 200 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_glass_apple.wasm
|
||||||
|
|
||||||
|
[package]
|
||||||
|
name = "studio_theme_glass_apple"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
authors = ["Dr. Stefan Flemming <platform@flemming.ai>"]
|
||||||
|
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
|
||||||
8
MODULE.de.md
Normal file
8
MODULE.de.md
Normal file
|
|
@ -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.
|
||||||
21
MODULE.md
Normal file
21
MODULE.md
Normal file
|
|
@ -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.
|
||||||
22
README.md
Normal file
22
README.md
Normal file
|
|
@ -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).
|
||||||
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-glass-apple
|
||||||
|
version: 0.1.0
|
||||||
|
|
||||||
|
provides:
|
||||||
|
- capability: studio.theme.glass_apple
|
||||||
|
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"]
|
||||||
94
src/lib.rs
Normal file
94
src/lib.rs
Normal file
|
|
@ -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<ColorScheme, PluginError> {
|
||||||
|
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<String, PluginError> {
|
||||||
|
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<u8>,
|
||||||
|
) -> Result<RenderedOutput, PluginError> {
|
||||||
|
Err(PluginError::Declined(
|
||||||
|
"glass-apple is a theme plugin and does not render outputs"
|
||||||
|
.to_string(),
|
||||||
|
))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export_plugin!(GlassApplePlugin);
|
||||||
Loading…
Add table
Add a link
Reference in a new issue