StratoSDK is a framework with a declarative approach similar to Flutter/React, written and designed entirely for Rust.
| 1 | use strato_core::types::Color; |
| 2 | |
| 3 | #[derive(Clone, Copy)] |
| 4 | pub struct AppTheme { |
| 5 | pub bg_primary: Color, |
| 6 | pub bg_secondary: Color, |
| 7 | pub bg_tertiary: Color, |
| 8 | pub accent: Color, |
| 9 | pub accent_hover: Color, |
| 10 | pub text_primary: Color, |
| 11 | pub text_secondary: Color, |
| 12 | pub border: Color, |
| 13 | pub success: Color, |
| 14 | pub warning: Color, |
| 15 | pub error: Color, |
| 16 | } |
| 17 | |
| 18 | impl AppTheme { |
| 19 | pub fn dark() -> Self { |
| 20 | Self { |
| 21 | bg_primary: Color::rgba(0.05, 0.05, 0.06, 1.0), // #0D0D10 |
| 22 | bg_secondary: Color::rgba(0.09, 0.09, 0.11, 1.0), // #17171C |
| 23 | bg_tertiary: Color::rgba(0.13, 0.13, 0.16, 1.0), // #212129 |
| 24 | accent: Color::rgba(0.39, 0.35, 0.88, 1.0), // #6459E1 |
| 25 | accent_hover: Color::rgba(0.45, 0.41, 0.92, 1.0), |
| 26 | text_primary: Color::rgba(0.95, 0.95, 0.97, 1.0), |
| 27 | text_secondary: Color::rgba(0.60, 0.60, 0.65, 1.0), |
| 28 | border: Color::rgba(0.20, 0.20, 0.24, 1.0), |
| 29 | success: Color::rgba(0.2, 0.8, 0.4, 1.0), |
| 30 | warning: Color::rgba(0.9, 0.7, 0.2, 1.0), |
| 31 | error: Color::rgba(0.9, 0.3, 0.3, 1.0), |
| 32 | } |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | pub const BORDER_RADIUS_LG: f32 = 16.0; |
| 37 | pub const BORDER_RADIUS_MD: f32 = 12.0; |
| 38 | pub const BORDER_RADIUS_SM: f32 = 8.0; |
| 39 | |
| 40 | pub const SPACING_XS: f32 = 4.0; |
| 41 | pub const SPACING_SM: f32 = 8.0; |
| 42 | pub const SPACING_MD: f32 = 16.0; |
| 43 | pub const SPACING_LG: f32 = 24.0; |
| 44 | pub const SPACING_XL: f32 = 32.0; |
| 45 |