pub mod built_in;
pub mod color;
pub mod provider;
pub mod radius;
pub mod shadow;
pub mod spacing;
pub mod theme;
pub mod themes;
pub mod typography;
pub use color::{Color, ColorScheme};
pub use provider::{set_theme, use_theme, set_animations, ThemeMode, use_theme_mode, set_theme_mode, sync_system_theme, register_theme_pair};
pub use radius::BorderRadius;
pub use shadow::{ShadowLayer, Shadows};
pub use spacing::Spacing;
pub use theme::{AnimationConfig, ThemeData, RosaceTheme, AppBarStyle, TitleAlign};
pub use themes::Themes;
pub use typography::{FontFamily, FontWeight, TextStyle, Typography};
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn color_lerp_integration() {
let red = Color::rgb(1.0, 0.0, 0.0);
let blue = Color::rgb(0.0, 0.0, 1.0);
let mid = red.lerp(blue, 0.5);
assert!((mid.r - 0.5).abs() < 1e-6);
assert!((mid.b - 0.5).abs() < 1e-6);
}
#[test]
fn color_from_hex_integration() {
let c = Color::from_hex(0xFF0000); assert!((c.r - 1.0).abs() < 1e-5);
assert!(c.g.abs() < 1e-5);
assert!(c.b.abs() < 1e-5);
assert_eq!(c.a, 1.0);
}
#[test]
fn spacing_defaults_integration() {
let s = Spacing::default();
assert_eq!(s.xs, 4.0);
assert_eq!(s.sm, 8.0);
}
#[test]
fn border_radius_defaults_integration() {
let r = BorderRadius::default();
assert_eq!(r.none, 0.0);
assert_eq!(r.full, 9999.0);
}
#[test]
fn light_theme_is_dark_false() {
let theme = built_in::light_theme();
assert!(!theme.is_dark);
}
#[test]
fn dark_theme_is_dark_true() {
let theme = built_in::dark_theme();
assert!(theme.is_dark);
}
#[test]
fn typography_scale_order() {
let typo = Typography::default();
assert!(typo.display_large.size > typo.headline_large.size);
assert!(typo.headline_large.size > typo.body_large.size);
}
#[test]
fn use_theme_returns_valid_theme_integration() {
let theme = use_theme();
assert!(theme.spacing.md > 0.0);
assert!(theme.radius.md >= 0.0);
assert!(theme.typography.display_large.size > 0.0);
}
}