Skip to content

Commit

Permalink
fix(examples): off-by-one error in minChroma filter
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Aug 4, 2021
1 parent d3c3ffa commit 3475ec5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/dominant-colors/src/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const processImage = (
buf = buf.scale(256 / Math.max(buf.width, buf.height), "nearest");
const colors = dominantColors(floatBuffer(buf, FLOAT_RGB), num, {
// use min chroma as pre-filter criteria
filter: (p) => lch(srgb(p)).c > minChroma,
filter: (p) => lch(srgb(p)).c >= minChroma,
}).map((c) => <DominantColor>{ col: lch(srgb(c.color)), area: c.area });
return { buf, colors };
});
Expand Down

0 comments on commit 3475ec5

Please sign in to comment.