From c4a978009acc503b00e314f5a298317e585e71fd Mon Sep 17 00:00:00 2001 From: Keavon Chambers Date: Sat, 16 May 2026 05:37:01 -0700 Subject: [PATCH] Fix SVG import treating gamma-encoded colors as linear-light --- .../graph_operation/graph_operation_message_handler.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editor/src/messages/portfolio/document/graph_operation/graph_operation_message_handler.rs b/editor/src/messages/portfolio/document/graph_operation/graph_operation_message_handler.rs index 01694407..bb47e54c 100644 --- a/editor/src/messages/portfolio/document/graph_operation/graph_operation_message_handler.rs +++ b/editor/src/messages/portfolio/document/graph_operation/graph_operation_message_handler.rs @@ -485,7 +485,8 @@ struct ArtboardInfo { } fn usvg_color(c: usvg::Color, a: f32) -> Color { - Color::from_rgbaf32_unchecked(c.red as f32 / 255., c.green as f32 / 255., c.blue as f32 / 255., a) + // `usvg::Color` channels are u8 sRGB display values (gamma-encoded); lift to linear-light for the internal `Color` + Color::from_gamma_srgb_channels(c.red as f32 / 255., c.green as f32 / 255., c.blue as f32 / 255., a) } fn usvg_transform(c: usvg::Transform) -> DAffine2 {