Skip to content

Commit d7f415a

Browse files
initramfssvgeesus
authored andcommitted
[css-color-4] Fix discrepency in ΔE2000 sample implementation
1 parent 33422e0 commit d7f415a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

css-color-4/deltaE2000.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ function deltaE2000 (reference, sample) {
100100
// Four possibilities for hue weighting factor,
101101
// depending on the angles, to get the correct sign
102102
let hdash;
103-
if (Cdash1 == 0 && Cdash2 == 0) {
104-
hdash = hsum; // which should be zero
103+
if (Cdash1 * Cdash2 === 0) {
104+
hdash = hsum;
105105
}
106106
else if (habs <= 180) {
107107
hdash = hsum / 2;

0 commit comments

Comments
 (0)