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

Option to check colour contrast #30

Open
KaneCheshire opened this issue Mar 23, 2018 · 3 comments
Open

Option to check colour contrast #30

KaneCheshire opened this issue Mar 23, 2018 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed In progress

Comments

@KaneCheshire
Copy link
Owner

It would be really ace if it's feasible to somehow fail a test if the view fails colour contrast accessibility standards

@KaneCheshire KaneCheshire added the enhancement New feature or request label Mar 23, 2018
@KaneCheshire
Copy link
Owner Author

This won't be quick or super easy to implement but would be nice to crack. Some things to consider:

  • Contrast checks shouldn't really fail for backgrounds over other backgrounds, only text. Might mean doing something like finding all the labels in a view and snapshotting the label's frame (including whatever is behind it), and checking that contrast ratio
  • Transparent backgrounds will throw off the test, so might be a good idea to add a white background for testing contrast by default
  • This should be opt-in for all tests and on a per-view basis

@KaneCheshire KaneCheshire added the help wanted Extra attention is needed label Mar 23, 2018
@Neil3079
Copy link

I wonder if we need actual snapshotting logic for this, maybe it can be done by injecting the colour of the labels font and background colours of layers, though might cause issues when images are backgrounds...

@KaneCheshire
Copy link
Owner Author

Definitely an option, but my gut is telling me to go with snapshotting the frame of each label within the "main" view, if that makes sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed In progress
Projects
None yet
Development

No branches or pull requests

2 participants