mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-23 19:58:13 +08:00
Fix SVG import treating gamma-encoded colors as linear-light
This commit is contained in:
+2
-1
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user