Skip to content

Commit

Permalink
Merge pull request simonwep#206 from bandzoogle/fix-hsl-to-hsv-divisi…
Browse files Browse the repository at this point in the history
…on-by-zero

Fix `hslToHsv` with 0 saturation and lightness
  • Loading branch information
simonwep authored Apr 23, 2020
2 parents a0ce2eb + 484dfbe commit f866198
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/pickr.es5.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pickr.es5.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pickr.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pickr.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/js/utils/color.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function hslToHsv(h, s, l) {

const ns = (2 * s / (l + s)) * 100;
const v = (l + s) * 100;
return [h, ns, v];
return [h, isNaN(ns) ? 0 : ns, v];
}

/**
Expand Down

0 comments on commit f866198

Please sign in to comment.