chore: initial studio-theme-space 0.1.0
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
commit
021beaa962
9 changed files with 194 additions and 0 deletions
91
src/lib.rs
Normal file
91
src/lib.rs
Normal file
|
|
@ -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<ColorScheme, PluginError> {
|
||||
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<String, PluginError> {
|
||||
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<u8>,
|
||||
) -> Result<RenderedOutput, PluginError> {
|
||||
Err(PluginError::Declined(
|
||||
"space is a theme plugin and does not render outputs".to_string(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
export_plugin!(SpacePlugin);
|
||||
Loading…
Add table
Add a link
Reference in a new issue