mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +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
5e2c04516c
commit
dff6471049
2 changed files with 2 additions and 2 deletions
|
@ -117,7 +117,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,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,7 +113,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