Coder Social home page Coder Social logo

coreyginnivan / whocanuse Goto Github PK

View Code? Open in Web Editor NEW
433.0 11.0 47.0 1.68 MB

WhoCanUse is a tool that brings attention and understanding to how color contrast can affect different people with visual impairments.

Home Page: https://whocanuse.com/

License: MIT License

JavaScript 87.67% CSS 12.33%
a11y accessibility-service accessibility color contrast-ratio

whocanuse's Introduction

WhoCanUse Logo

WhoCanUse.com

All Contributors

What is WhoCanUse?

It's a tool that brings attention and understanding to how color contrast can affect different people with visual impairments.

The Web Content Accessibility Guidelines (WCAG) covers a wide range of recommendations for making Web content more accessible. Just a tiny part of making the web more accessible is accommodating for those with a form of blindness or low vision.

The standard grading system is a great start, but I thought I'd try to humanize the people who are affected by the different grades.

What is WhoCanUse? Where did you get the info from?

The percentages are sourced from both colour-blindness.com and Vision Australia. P.S. You're both the best, thankyou ✌️

Your maths is off, it doesn't add up to 100%...?

Good eyes! (haha) The population data provided are estimates for individual impairments, and don't cover the vast amount of visual impairments in the world. This is to give you not just an understanding of how color contrast affects different people but also who it can affect.

I'm fascinated by how this works, can you tell me more?

Of course! There's a few stages to get to this point. First we figure out the contrast between two HEX values. For this we're using a plugin called chroma.js - this does the heavy lifting for us. Once we have the ratio (and using font size and font weight) we can apply a grade to that specific color combo.

For the color blindness options we're using another plugin aptly called Color-blind that converts our HEX codes in to ones that would be seen by people with the different impairments, then we can apply our same process to obtain the color ratios and determine their grade.

For cataracts, glaucoma, low vision, and the situational events I've personally created simulations to help identify their rating.

What does a failing grade mean?

The grading uses a combination of color contrast, text size and text weight. A fail simply means that the color combination offers some visual strain to the person seeing it and should be avoided if possible.

Can I help contribute?

Absolutely! This project follows the all-contributors specification. Contributions of any kind are welcome!

Check out CONTRIBUTING.md for more info.

whocanuse's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

whocanuse's Issues

Dynamically create color comparison image for social sharing

Right now, you get a generic OpenGraph preview image when you share a WhoCanUse link in a chat client or social network. Here's what I get when sharing a comparison between #0078c2 and #ffeb38 (https://www.whocanuse.com/?bg=0078c2&fg=ffeb38&fs=16&fw=):

The generic WhoCanUse image shown as an unfurl in Slack and Discord

It would be cool if the image preview for the URL's specific color combination was dynamically generated so that shared link unfurls showed the colors and contrast ratio information like 11ty's Rainglow demo does:

The image it generates for #048e86 (https://rainglow.zachleat.dev/048e86/):
A dynamic image that has a #048e86 background color along with contrast information for white and black

How it appears in social share previews:
The image shown as an unfurl in Slack and Discord

This is accomplished using 11ty's serverless plugin on Netlify alongside 11ty's OpenGraph image API. It seems like it might be possible to create a new layout to use with 11ty's API or a similar one, but I'm not familiar with Vercel and have no idea how feasible it is to do either/both of these on there?

Can't reach the bottom of the left side color picker.

On a low res monitor

Width: 1360
Height: 768
Device Pixel Ratio: 1

Display Dimensions:(width x height) 14.2" x 8.0"
Screen Diagonal: 16.3" Screen

I am unable to get to the bottom of the left side color picker as the no scroll option.

image

On high res

Width: 3840
Height: 2400
Device Pixel Ratio: 2.5

Display Dimensions:(width x height) 16.0" x 10.0"
Screen Diagonal: 18.9" Screen

I can see this.

image

Avoid back button trap by using `replaceState`

This tool is awesome! Nice work Corey!

I was testing it out and noticed that if you change your colors a number of times, then you have to use the back button an equal number of times to exit back out of the website.

I think it would be better if you only had to use the back button once to exit, regardless of how many changes you'd made.

I think this could be achieved by changing pushState to replaceState in updatePath. If I opened a PR for that would you be open to merging it in?

Thanks!

How does astigmatism figure into your ratings?

I agree with the posting at https://jessicaotis.com/academia/never-use-white-text-on-a-black-background-astygmatism-and-conference-slides/ It notes that light text on a dark background can be hard to read. The examples in her article match my experience: I do see ghost images of the glyphs that interfere with readability. So my question:

Does your rating system incorporate a factor for astigmatism? (I imagine that smaller fonts would suffer more...) Many thanks.

There a way for another tool to leverage your work?

I've got this project https://github.com/GoogleChromeLabs/ProjectVisBug and I'd love to enhance the accessibility hover tooltip with the information your site is currently displaying.

Screen Shot 2019-12-06 at 6 56 38 PM

Give it a try by visiting the tool sandbox http://visbug.web.app and picking the accessibility tool from the left toolbar and hovering on things with color you want to compare. Imagine it was that easy to see the information you've uncovered right there in the moment.

thoughts!?

Can’t Copypaste Colors

I tried to copypaste a hex color without the # into the foreground and background color fields, but it won’t work.

My Environment
Safari 13.0.3
macOS 10.15.1

Input field text color frequently disobeys WhoCanUse's own color-contrast recommendations

WhoCanUse sets the text color of its input fields to white on dark backgrounds and black on light backgrounds:

Screenshot_2019-12-14_18-32-57

Hilariously, the function used for this frequently disagrees with WhoCanUse's own contrast recommendations. In the above example, it placed white text on the #169155, even though WhoCanUse assigns that color combination a FAIL rating for all but a tiny minority of color-blind users. It should have chosen a black text color --- that combination gets an AA rating.

Personally, I think that the white text is actually a little more readable against the green background than black text. But the whole point of this website is to teach people like me (and the misguided designers who create inaccessible products like this) that we can't rely on our eyes to tell us which color combinations have the best contrast. To maximize accessibility and inclusion, we must defer to the WCAG contrast function, so the input field should use the WCAG contrast function as well.

Pass/Fail is misleading

You apply contrast calculations after applying the simulation and base pass/fail results on the adjusted colours. With this you make it seem like #663399 vs #FF99FF fails WCAG, but this is not the case.

Contrast calculation should be done on the original colours only. The 3:1, 4.5:1, and 7:1 contrast ratios already take into account if the end result would be sufficiently visible/readable to people with these visual impairments.

Add ability to check larger font sizes

I have run into an issue where a font is sized at 115px for a specific design, and as of right now the whocanuse only increases to 60px. I would love to be able to check for larger fonts.

Localization (Translation) into different languages

This is a question/request, not an issue.

Is it possible to localize/translate this tool into different languages? For me, I'd like to contribute to Japanese translation if possible. If yes, could you please give me the instructions? Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.