We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 259bb96 commit 5896862Copy full SHA for 5896862
crates/processing_ffi/src/color.rs
@@ -1,4 +1,4 @@
1
-use bevy::color::LinearRgba;
+use bevy::color::{LinearRgba, Srgba};
2
3
/// A sRGB (?) color
4
#[repr(C)]
@@ -18,7 +18,18 @@ impl From<Color> for bevy::color::Color {
18
19
impl From<LinearRgba> for Color {
20
fn from(lin: LinearRgba) -> Self {
21
- let srgb = bevy::color::Color::srgba(lin.red, lin.green, lin.blue, lin.alpha);
+ let srgb: Srgba = lin.into();
22
srgb.into()
23
}
24
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