Fix SVG import treating gamma-encoded colors as linear-light
This commit is contained in:
parent
256dd26b99
commit
c4a978009a
|
|
@ -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 {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue