get-image-colors icon indicating copy to clipboard operation
get-image-colors copied to clipboard

When the count is set more than 7, the return colors are one less.

Open ynynl opened this issue 4 years ago • 1 comments

example: count: 7 => return 7colors count: 8 => return 7 colors count: 30 => return 29 colors

ynynl avatar Dec 05 '20 03:12 ynynl

@ynynl

If you will set to options.count negative number you will get something like this:

options = {
  count: -1
}

[ "color", "color" ]

options = {
  count: -2
}

[ "color" ]

options = {
  count: -3
}

[  ]

And so one. Decreasing the number further will also result in an empty array.

It seems to me that the problem is most likely in the packages that this utility uses. That is chroma.js or get-rgba-palette. Since I did not see any strange logic in the index.js file of this library.

RinatValiullov avatar Jul 22 '22 21:07 RinatValiullov