Skip to content
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

fix: farthest compare logic #45

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open

Conversation

caijf
Copy link

@caijf caijf commented Nov 19, 2021

No description provided.

@LeaVerou
Copy link
Collaborator

Hey, thanks! Which bug does this fix?

@caijf
Copy link
Author

caijf commented Nov 19, 2021

var max = Math.max(contrastOnBlack, contrastOnWhite);
// ...

return {
  // ...
  farthest: onWhite == max? _.WHITE : _.BLACK
}

onWhite == max The conditional judgment here is always no. I think it should be contrastOnWhite == max .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants