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 ItsDoot committed Feb 1, 2023
1 parent 421171d commit ce01546
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_render/src/color/mod.rs
Original file line number Diff line number Diff line change
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 ce01546

Please sign in to comment.