fix: make color proper

This commit is contained in:
Nova
2025-10-21 16:44:34 -07:00
parent 2b07345286
commit 181224767d
4 changed files with 8 additions and 12 deletions

View File

@@ -3,10 +3,8 @@ use stardust_xr::values::color::{AlphaColor, Rgb, color_space::LinearRgb};
pub trait ColorConvert {
fn to_bevy(&self) -> bevy::color::Color;
}
// even tho its supposed to be linear the values have to be interpreted as Srgba to produce the
// correct result because StereoKit used Srgba while it was assumed that is uses linear rgba
impl ColorConvert for AlphaColor<f32, Rgb<f32, LinearRgb>> {
fn to_bevy(&self) -> bevy::color::Color {
bevy::color::Color::srgba(self.c.r, self.c.g, self.c.b, self.a)
bevy::color::Color::linear_rgba(self.c.r, self.c.g, self.c.b, self.a)
}
}