Skip to content

Commit

Permalink
Use epsilon 0 for inGamut checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesnw committed Dec 17, 2023
1 parent 105f240 commit 907c8f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/toGamut.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export function toGamutCSS (origin, { space = origin.space }) {
return to(black, space);
}

if (inGamut(origin_OKLCH, space)) {
if (inGamut(origin_OKLCH, space, {epsilon: 0})) {
return to(origin_OKLCH, space);
}

Expand Down Expand Up @@ -187,7 +187,7 @@ export function toGamutCSS (origin, { space = origin.space }) {
while ((max - min) > ε) {
const chroma = (min + max) / 2;
current.coords[1] = chroma;
if (min_inGamut && inGamut(current, space)) {
if (min_inGamut && inGamut(current, space, {epsilon: 0})) {
min = chroma;
}
else {
Expand Down

0 comments on commit 907c8f3

Please sign in to comment.