Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
test(rendering): add color conversion normalization test
Richie McIlroy574f85303a71
diff --git a/crates/rendering/src/layers/background.rs b/crates/rendering/src/layers/background.rsindex 8d06c2e98..2ca37e484 100644--- a/crates/rendering/src/layers/background.rs+++ b/crates/rendering/src/layers/background.rs@@ -574,6 +574,24 @@ mod tests {}}+ #[test]+ fn test_color_conversion_uses_normalized_byte_values() {+ let source = BackgroundSource::Color {+ value: [128, 64, 32],+ alpha: 200,+ };+ let background = Background::from(source);+ match background {+ Background::Color(color) => {+ assert!((color[0] - (128.0 / 255.0)).abs() < 1e-6);+ assert!((color[1] - (64.0 / 255.0)).abs() < 1e-6);+ assert!((color[2] - (32.0 / 255.0)).abs() < 1e-6);+ assert!((color[3] - (200.0 / 255.0)).abs() < 1e-6);+ }+ _ => panic!("Expected Color variant"),+ }+ }+#[test]fn test_gradient_conversion() {let source = BackgroundSource::Gradient {