Skip to content

Commit

Permalink
Correctly use as_hsla_f32 in Add<Color> and AddAssign<Color>, fixes b…
Browse files Browse the repository at this point in the history
…evyengine#5543 (bevyengine#5546)

Probably a copy-paste error, but `Add<Color>` and `AddAssign<Color>` should use `rhs.as_hlsa_f32()` instead of `rhs.as_linear_rgba_f32()` when the LHS is a `Color::Hsla`. Fixes bevyengine#5543.



Co-authored-by: Verte <105466627+vertesians@users.noreply.github.com>
  • Loading branch information
2 people authored and inodentry committed Aug 19, 2022
1 parent 8057f10 commit 2b09a06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_render/src/color/mod.rs
Expand Up @@ -659,7 +659,7 @@ impl AddAssign<Color> for Color {
lightness,
alpha,
} => {
let rhs = rhs.as_linear_rgba_f32();
let rhs = rhs.as_hsla_f32();
*hue += rhs[0];
*saturation += rhs[1];
*lightness += rhs[2];
Expand Down Expand Up @@ -708,7 +708,7 @@ impl Add<Color> for Color {
lightness,
alpha,
} => {
let rhs = rhs.as_linear_rgba_f32();
let rhs = rhs.as_hsla_f32();
Color::Hsla {
hue: hue + rhs[0],
saturation: saturation + rhs[1],
Expand Down

0 comments on commit 2b09a06

Please sign in to comment.