Skip to content

Commit

Permalink
Correctly use as_hsla_f32 in Add<Color> and AddAssign<Color>, fixes #…
Browse files Browse the repository at this point in the history
…5543 (#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 #5543.



Co-authored-by: Verte <105466627+vertesians@users.noreply.github.com>
  • Loading branch information
Verte and vertesians committed Aug 17, 2022
1 parent aed3232 commit 56fc1df
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 @@ -745,7 +745,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 @@ -794,7 +794,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 56fc1df

Please sign in to comment.