Skip to content

Commit 56fc1df

Browse files
Vertevertesians
Verte
andcommitted
Correctly use as_hsla_f32 in Add<Color> and AddAssign<Color>, fixes #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 <[email protected]>
1 parent aed3232 commit 56fc1df

File tree

1 file changed

+2
-2
lines changed
  • crates/bevy_render/src/color

1 file changed

+2
-2
lines changed

crates/bevy_render/src/color/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ impl AddAssign<Color> for Color {
745745
lightness,
746746
alpha,
747747
} => {
748-
let rhs = rhs.as_linear_rgba_f32();
748+
let rhs = rhs.as_hsla_f32();
749749
*hue += rhs[0];
750750
*saturation += rhs[1];
751751
*lightness += rhs[2];
@@ -794,7 +794,7 @@ impl Add<Color> for Color {
794794
lightness,
795795
alpha,
796796
} => {
797-
let rhs = rhs.as_linear_rgba_f32();
797+
let rhs = rhs.as_hsla_f32();
798798
Color::Hsla {
799799
hue: hue + rhs[0],
800800
saturation: saturation + rhs[1],

0 commit comments

Comments
 (0)