chore: audit components

This commit is contained in:
2026-11-10 15:06:16 +07:00
parent af2177c6c8
commit 03369f501e
92 changed files with 2744 additions and 1947 deletions
+10
View File
@@ -12,6 +12,16 @@ pub(crate) trait ThemeSource: 'static {
fn label(&self) -> &'static str;
}
/// Narrows an f64 color component to f32, clamping to the 0..=1 range and
/// mapping non-finite values to 0.0 rather than truncating garbage silently.
pub(crate) fn narrow_component(value: f64) -> f32 {
if value.is_finite() {
value.clamp(0.0, 1.0) as f32
} else {
0.0
}
}
#[cfg(target_os = "macos")]
pub(crate) fn platform_source() -> Box<dyn ThemeSource> {
Box::new(macos::MacosSource::default())