Add Metrics and Theme consts
This commit is contained in:
parent
218e2fde74
commit
2f5d25a3f4
|
@ -1,4 +1,4 @@
|
|||
use canary_script::Color;
|
||||
use canary_script::{api::Font, Color};
|
||||
|
||||
/// A reusable set of colors. Used by default widget styles.
|
||||
pub struct Palette {
|
||||
|
@ -10,7 +10,7 @@ pub struct Palette {
|
|||
|
||||
/// Sword Art Online color palette.
|
||||
pub const SAO_PALETTE: Palette = Palette {
|
||||
base: Color::WHITE.with_alpha(0xc0),
|
||||
base: Color::WHITE.with_alpha(0xa0),
|
||||
surface: Color::WHITE,
|
||||
overlay: Color::WHITE,
|
||||
text: Color::BLACK,
|
||||
|
@ -24,5 +24,21 @@ pub const ROSE_PINE_PALETTE: Palette = Palette {
|
|||
text: Color(0xe0def4ff),
|
||||
};
|
||||
|
||||
/// The global palette.
|
||||
pub const PALETTE: Palette = ROSE_PINE_PALETTE;
|
||||
/// 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,
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue