Skip to content

Commit d749039

Browse files
committed
Fix ZCAM domain error corner case
1 parent 53c9771 commit d749039

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

coloraide/spaces/zcam_jmh.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def xyz_d65_to_zcam(xyzd65: Vector, env: Environment, calc_hue_quadrature: bool
346346
Cz = 100 * (Mz / env.qzw)
347347

348348
# Step 16
349-
Sz = 100 * (env.fl ** 0.6) * math.sqrt(Mz / Qz) if Qz else 0.0
349+
Sz = 100 * (env.fl ** 0.6) * alg.nth_root(Mz / Qz, 2) if Qz else 0.0
350350

351351
# Step 17
352352
Vz = math.sqrt((Jz - 58) ** 2 + 3.4 * (Cz ** 2))

docs/src/markdown/about/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
recreate the aforementioned pre-configured methods themselves or their own desired variants.
1818

1919
- **FIX**: HWB and HSV cannot normalize hue and saturation the same way as HSL when saturation is negative.
20+
- **FIX**: Fix corner case in ZCAM that could throw a domain error.
2021

2122
## 3.3.1
2223

0 commit comments

Comments
 (0)