- From: initramfs via GitHub <noreply@w3.org>
- Date: Fri, 09 Jan 2026 23:37:02 +0000
- To: public-css-archive@w3.org
initramfs has just created a new issue for https://github.com/w3c/csswg-drafts:
== [css-color-4] Discrepancy between § 19.1. ΔE2000 implementation and ISO 11664-6:2014/Sharma et al., 2005 ==
The sample implementation in section of 19.1. ΔE2000 of CIEDE2000 has a discrepancy in the computation of the mean hue angle $\overline{h'}$ versus the equation in ISO/CIE 11664-6:2014 (I do not have the 2022 version available) which reference the paper by Sharma et al., 2005.
The offending line exists on line 103 of the code snippet:
```js
if (Cdash1 == 0 && Cdash2 == 0) {
```
where $\overline{h'}$ (`hdash` in code) is set to `hsum` if `Cdash1` **and** `Cdash2` is zero, which differs from the specification condition that $C'_1 \cdot{} C'_2 = 0$, which would be implemented in code as:
```js
if (Cdash1 * Cdash2 === 0) {
```
The above condition is correctly implemented for the computation of $Δh'$ (`Δh` in code) as seen on line 75 of the implementation.
Mathematically, the discrepancy does not matter in the final computation of the ΔE2000 value since having either $C'_1$ or $C'_2$ be 0 means that the $ΔH$ value is 0, and the mean hue angle $\overline{h'}$ is always eventually multiplied with $ΔH$, making the discrepancy disappear in the final result.
However, the intermediate values $Δθ$, $T$, and $R_T$ do show the discrepancy and may not match testing data that expect all the intermediate values to match as well.
A specific test pair of:
`Reference L = 50.00, a = 0.000, b = 0.000`
and
`Sample L = 50.00, a = 10.00, b = -114.3`
can be used to show large deviations between the two specifications for the $Δθ$, $T$, and $R_T$ values (as well as $\overline{h'}$), with $Δθ = 30.000$ for ISO/CIE 11664-6:2014 and $Δθ = 1.6669$ for the sample implementation in section 19.1. ΔE2000.
---
I was wondering what the rationale behind the change in implementation is, as the code comments don't seem to note anything about this discrepancy.
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13322 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 9 January 2026 23:37:03 UTC