mirror of
https://github.com/bevyengine/bevy
synced 2024-11-21 20:23:28 +00:00
Fix hue mixing for Lcha
and Oklcha
(#14468)
# Objective Fix erroneous hue mixing in `Lcha` and `Oklcha`. Purple + Red == Green is the current behavior. ## Solution Use `crate::color_ops::lerp_hue` to handle the wrap-around at 360 degrees, the same way that `Hsla`, `Hsva`, and `Hwba` do it. ## Testing Game jamming, but tested that the workaround below produces correct-looking colors in my jam game.
This commit is contained in:
parent
3a880b5c30
commit
e7e10f2c0f
2 changed files with 2 additions and 2 deletions
|
@ -118,7 +118,7 @@ impl Mix for Lcha {
|
|||
Self {
|
||||
lightness: self.lightness * n_factor + other.lightness * factor,
|
||||
chroma: self.chroma * n_factor + other.chroma * factor,
|
||||
hue: self.hue * n_factor + other.hue * factor,
|
||||
hue: crate::color_ops::lerp_hue(self.hue, other.hue, factor),
|
||||
alpha: self.alpha * n_factor + other.alpha * factor,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ impl Mix for Oklcha {
|
|||
Self {
|
||||
lightness: self.lightness * n_factor + other.lightness * factor,
|
||||
chroma: self.chroma * n_factor + other.chroma * factor,
|
||||
hue: self.hue * n_factor + other.hue * factor,
|
||||
hue: crate::color_ops::lerp_hue(self.hue, other.hue, factor),
|
||||
alpha: self.alpha * n_factor + other.alpha * factor,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue