mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
config: Premultiply alpha in Color when converting to f32
Smithay wants premultiplied alpha.
This commit is contained in:
@@ -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]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user