config: Premultiply alpha in Color when converting to f32

Smithay wants premultiplied alpha.
This commit is contained in:
Ivan Molodetskikh
2024-02-01 18:53:45 +04:00
parent 9afd728ae9
commit 2036116f16
+2 -1
View File
@@ -348,7 +348,8 @@ impl Color {
impl From<Color> for [f32; 4] {
fn from(c: Color) -> Self {
[c.r, c.g, c.b, c.a].map(|x| x as f32 / 255.)
let [r, g, b, a] = [c.r, c.g, c.b, c.a].map(|x| x as f32 / 255.);
[r * a, g * a, b * a, a]
}
}