diff options
author | 2023-02-01 04:06:29 +0100 | |
---|---|---|
committer | 2023-02-24 13:20:55 +0100 | |
commit | bb27982009d89a1cf4874697f7c17ff0af71d93d (patch) | |
tree | c358ff79e1fd6f297489c6555dbc78bbd7e2f12f | |
parent | c68edb3278fdfa3c5ea6b29b9e2213fed56d4e66 (diff) | |
download | iced-bb27982009d89a1cf4874697f7c17ff0af71d93d.tar.gz iced-bb27982009d89a1cf4874697f7c17ff0af71d93d.tar.bz2 iced-bb27982009d89a1cf4874697f7c17ff0af71d93d.zip |
Convert sRGB to linear RGB for text in `iced_wgpu`
-rw-r--r-- | wgpu/src/text.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs index 19d0782a..3f828da1 100644 --- a/wgpu/src/text.rs +++ b/wgpu/src/text.rs @@ -67,8 +67,14 @@ impl Pipeline { section.content, glyphon::Attrs::new() .color({ - let [r, g, b, a] = section.color.into_rgba8(); - glyphon::Color::rgba(r, g, b, a) + let [r, g, b, a] = section.color.into_linear(); + + glyphon::Color::rgba( + (r * 255.0) as u8, + (g * 255.0) as u8, + (b * 255.0) as u8, + (a * 255.0) as u8, + ) }) .family(match section.font { Font::Default => glyphon::Family::SansSerif, |