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(color-contrast): take into account parent opacity for foreground color #1902

Merged
merged 7 commits into from Nov 18, 2019

Conversation

straker
Copy link
Contributor

@straker straker commented Nov 14, 2019

Our foreground color check did not take into account the parent opacity, so would incorrectly calculate the final color. Added a function that would gather the parent opacity level and cache it for quicker lookups.

Also did a quick performance optimization by passing the already calculated bgColor from the parent into the foreground color check so we didn't have to do that expensive operation again.

Closes issue: #1228

Reviewer checks

Required fields, to be filled out by PR reviewer(s)

  • Follows the commit message policy, appropriate for next version
  • Code is reviewed for security

@straker straker requested a review from a team as a code owner November 14, 2019 19:05
@straker straker merged commit 8719700 into develop Nov 18, 2019
@straker straker deleted the opacityParentTree branch November 18, 2019 17:11
straker added a commit that referenced this pull request Dec 11, 2019
…color (#1902)

* fix(color-contrast): take into account parent opacity for foreground color

* fix rounding errors

* proper closeTo params

* update

* test recursive
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.

None yet

2 participants