-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Percentage of color #51
Comments
+1 |
1 similar comment
+1 |
Maybe not the best solution, but you can change the function palette line 351 in color-thief.js: palette: function() {
return this.vboxes.map(function(vb) { return vb.color.concat(vb.vbox._count);});
} When you will use getColor() or getPalette(), the array of each color will still contains red, green and blue but also at the index 3, the count of pixels of this color (or close). Calculate the percentage should be easy with the size of the picture or the sum of the color counts! |
This is just a quick add. When we will use getColor() or getPalette(), the array of each color will still contains red, green and blue but also at the index 3, the count of pixels of this color (or close) See lokesh#51
+1 |
4 similar comments
+1 |
+1 |
+1 |
+1 |
Hello,
Is it possible to know the percentage of picked color? If on output we receive 9 colors so what is the percentage of each of them?
Thanks
The text was updated successfully, but these errors were encountered: