Convert sRGB to linear RGB for text in iced_wgpu

This commit is contained in:
Héctor Ramón Jiménez 2023-02-01 04:06:29 +01:00
parent c68edb3278
commit bb27982009
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -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,