Skip to content

Commit b9fd768

Browse files
authored
Fixed Xyza to Laba color conversion. (#20728)
# Objective Fixes `Xyza` to `Laba` color conversion. As the website referenced in comment: <img width="236" height="77" alt="image" src="https://github.com/user-attachments/assets/aad9676a-33f5-428e-be8d-b25f2eb3b7f0" /> The variable that used to compares to `epsilon` is `zr`, but in actual code, it's mistyped into `yr`. ## Solution Changed `yr` to `zr`.
1 parent 07ea4a2 commit b9fd768

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/bevy_color/src/laba.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ impl From<Xyza> for Laba {
275275
} else {
276276
(Laba::CIE_KAPPA * yr + 16.0) / 116.0
277277
};
278-
let fz = if yr > Laba::CIE_EPSILON {
278+
let fz = if zr > Laba::CIE_EPSILON {
279279
ops::cbrt(zr)
280280
} else {
281281
(Laba::CIE_KAPPA * zr + 16.0) / 116.0

0 commit comments

Comments
 (0)