color-thief
color-thief copied to clipboard
How do you determine the threshold like 125 for alpha and 250 for rgb
Dear lokesh,
I encountered a problem when the alpha of the image are all below 125 such as the following image.
I want to know can lower the alpha threshold to 100 ?
thx!
Fork and implement a patch of your own at #L122-L127
I also have same question. It doesn't make sense to filter with the following logic:
// If pixel is mostly opaque and not white
if (typeof a === 'undefined' || a >= 125) {
if (!(r > 250 && g > 250 && b > 250)) {
pixelArray.push([r, g, b]);
}
}
why r, g, b must less than 250? and alpha must bigger than 125?