Skip to content

Commit c4a9780

Browse files
committed
Fix SVG import treating gamma-encoded colors as linear-light
1 parent 256dd26 commit c4a9780

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

editor/src/messages/portfolio/document/graph_operation/graph_operation_message_handler.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,8 @@ struct ArtboardInfo {
485485
}
486486

487487
fn usvg_color(c: usvg::Color, a: f32) -> Color {
488-
Color::from_rgbaf32_unchecked(c.red as f32 / 255., c.green as f32 / 255., c.blue as f32 / 255., a)
488+
// `usvg::Color` channels are u8 sRGB display values (gamma-encoded); lift to linear-light for the internal `Color`
489+
Color::from_gamma_srgb_channels(c.red as f32 / 255., c.green as f32 / 255., c.blue as f32 / 255., a)
489490
}
490491

491492
fn usvg_transform(c: usvg::Transform) -> DAffine2 {

0 commit comments

Comments
 (0)