Skip to content

Commit 5896862

Browse files
committed
Fix from/into
1 parent 259bb96 commit 5896862

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

crates/processing_ffi/src/color.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use bevy::color::LinearRgba;
1+
use bevy::color::{LinearRgba, Srgba};
22

33
/// A sRGB (?) color
44
#[repr(C)]
@@ -18,7 +18,18 @@ impl From<Color> for bevy::color::Color {
1818

1919
impl From<LinearRgba> for Color {
2020
fn from(lin: LinearRgba) -> Self {
21-
let srgb = bevy::color::Color::srgba(lin.red, lin.green, lin.blue, lin.alpha);
21+
let srgb: Srgba = lin.into();
2222
srgb.into()
2323
}
2424
}
25+
26+
impl From<Srgba> for Color {
27+
fn from(srgb: Srgba) -> Self {
28+
Color {
29+
r: srgb.red,
30+
g: srgb.green,
31+
b: srgb.blue,
32+
a: srgb.alpha,
33+
}
34+
}
35+
}

0 commit comments

Comments
 (0)