We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
sample()
Thanks for the library, it works great for computing a dominant color in the image. The results are great for our purposes.
However, I noticed that RGB components are being ignored and only H, S and M are taking into account.
((img.data[i] & mask) << shiftR) + ((img.data[i + 1] & mask) << shiftG) + ((img.data[i + 2] & mask << shiftB));
This evaluates to 0, because shiftR. shiftG and shiftB are all negative:
0
shiftR
shiftG
shiftB
var shiftR:number = -lowBits + 2 * topBits; var shiftG:number = -lowBits + topBits; var shiftB:number = -lowBits;
Just check 42 << -1 or 42 >> -1
42 << -1
42 >> -1
There are two ways to fix this:
I'll let you decide what do with this.
The text was updated successfully, but these errors were encountered:
fixing #1 and #2, updating build toolchain and dependencies
12d5ff8
fixing #1 and #2, updating build toolchain and dependencies (#3)
4302c3d
@eleweek Thanks a lot! I dropped the RGB completely.
Sorry, something went wrong.
No branches or pull requests
Thanks for the library, it works great for computing a dominant color in the image. The results are great for our purposes.
However, I noticed that RGB components are being ignored and only H, S and M are taking into account.
This evaluates to
0
, becauseshiftR
.shiftG
andshiftB
are all negative:Just check
42 << -1
or42 >> -1
There are two ways to fix this:
I'll let you decide what do with this.
The text was updated successfully, but these errors were encountered: