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
cmd/go: test / tool cover: colours alone can be difficult to use for coverage, add additional indicators #27553
Comments
Interesting. @robpike picked the colours specifically because they were distinguishable by people with the most common forms of colour blindness. They aren't plain red/green. Do you have a specific form of colour blindness? Note that the HTML output has CSS classes for the elements, so you can completely customise the chosen colours with a user stylesheet. |
I am surprised because the colors were specifically chosen by me because I am red-green colorblind. We mixed a lot of blue into the green and were careful to adjust the saturations. |
(CC @katiehockman) |
From an accessibility perspective, it's generally better to not rely on color as the sole means of representing something. In this case, the hue of the green conveys how much test coverage exists for a line of code, and that's difficult to interpret in general (I personally found it a bit challenging). Even if this will work for people with a specific type of colorblindness, it is important to consider users who use modes like high contrast or grayscale. Many screen reader users will not be able to rely on color at all, so having some other option to convey the information can be helpful. Side note: great that usability for colorblind users was considered in this design! |
Ah, now that it's bright again, I see that the red/green are indeed easier to distinguish. So partly this was just because it was late and my screen was very dim. I still think that colour intensity alone is not very usable as a form of coverage indication (especially in light of the screen reader concern, but also in general I find it hard to use even now with a brighter screen). As for user stylesheets, that's a good idea but it appears that Chrome only supports user stylesheets via an extension that by design requires very invasive permissions, so maybe a way to just add arbitrary content to generated coverage reports would still be useful. Thanks for taking a look! |
Heh, this is embarrassing. Apparently I had a blue-light filter running 😳. |
Thanks for following up. |
Happy! |
What version of Go are you using (
go version
)?go version go1.11 linux/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
What did you expect to see?
Easily distinguishable colours for covered, uncovered, and low coverage lines.
What did you see instead?
Red/green/grey, which are very hard to distinguish for quite a few people.
Possible solutions:
The text was updated successfully, but these errors were encountered: