canary-rs/scripts/sao-ui/src/style.rs

45 lines
993 B
Rust

use canary_script::{api::Font, Color};
/// A reusable set of colors. Used by default widget styles.
pub struct Palette {
pub base: Color,
pub surface: Color,
pub overlay: Color,
pub text: Color,
}
/// Sword Art Online color palette.
pub const SAO_PALETTE: Palette = Palette {
base: Color::WHITE.with_alpha(0xa0),
surface: Color::WHITE,
overlay: Color::WHITE,
text: Color::BLACK,
};
/// Rose Pine color palette.
pub const ROSE_PINE_PALETTE: Palette = Palette {
base: Color(0x191724ff),
surface: Color(0x1f1d2eff),
overlay: Color(0x26233aff),
text: Color(0xe0def4ff),
};
/// Common measurements for widget shapes.
pub struct Metrics {
pub surface_rounding: f32,
}
/// Common default parameters for widget styles.
pub struct Theme {
pub palette: Palette,
pub metrics: Metrics,
}
/// The global theme.
pub const THEME: Theme = Theme {
palette: ROSE_PINE_PALETTE,
metrics: Metrics {
surface_rounding: 5.0,
},
};