Fix SVG import treating gamma-encoded colors as linear-light

This commit is contained in:
Keavon Chambers 2026-05-16 05:37:01 -07:00
parent 256dd26b99
commit c4a978009a
1 changed files with 2 additions and 1 deletions

View File

@ -485,7 +485,8 @@ struct ArtboardInfo {
} }
fn usvg_color(c: usvg::Color, a: f32) -> Color { 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 { fn usvg_transform(c: usvg::Transform) -> DAffine2 {