Why some GitHub labels are illegible
firsching.ch
firsching.ch
For example:
contrast-color(
wheat tbd-bg wcag2(aa),
bisque, darkgoldenrod, olive, sienna, darkgreen, maroon
)
will return "darkgreen".- "wcag2(aa)" means level AA of the WCAG2.1 luminance contrast algorithm, which computes to "4.5".
- "tbd-bg/tbd-fg" sets whether it is determining the background or the text color.
This proposal is still in the experimental phase, and not all parts of the spec are finalized (such as the tbd-bg or tbd-fg keywords, or even the name of the function itself).
[1]: https://w3c.github.io/csswg-drafts/css-color-6/#colorcontras...
I use it for a number of sites I browse regularly
Or maybe just whoever designed that had different monitor settings than average user and it looks okayish there...
CSS function doing "here is color A, here is color B, make one that is same hue as color B but contrasting" would be much more useful
Your site's design should just have well-chosen colours.
And there's decent reason to not want to tell the server either.
Honestly surprised GitHub did this.
I've worked with software where a user picks a color for something that renders text atop it. Never once did I think to allow for an in-between color.
It's been a while since I've done UX but I remember a couple of rules of thumb involving projectors (if you work on project management tools it is a certainty that your tool will be used in anger on a projector, and shitty UI in an emotionally charged room is a toxic cocktail).
Anything greater than #eee is indistinguishable from white, and anything less than #222 is indistinguishable from black.
In the days before font weights actually worked, you could do three font weights by mixing #222, #444, and bold.
So that's a third of the greyscale range that isn't grey, at least, and it also misses other mostly-grey colors, and a bunch of shades of blue. Which I think is a long way of saying it's not grey that's the problem, it's low-contrast that's the problem. While grey is heavily represented in that set of colors, it's not all of them, and it might not even be half of them.
Imageworsener has a nice page about this issue in the context of converting to grayscale:
In theory a solution would be something like:
clamp(0,(var(--perceived-lightness) - var(--threshold)) * Infinity, 1)
But most browsers don’t support Infinity. I assume that GitHub can find a suitably large number to put there though. (Maybe I’m wrong though because of precision issues elsewhere).Another potential solution would be with sign but this function is also largely unsupported
In the case of generating a white or black number, this works (unless you want a number between 0 and 255, then just multiply the result by 255): https://i.imgur.com/hXNw0EA.png
It also ignores Gamma, but at least it is described in the comments in the code.
Nevertheless, I enjoy the colors every time I launch clickhouse-server.
Basically they have this muted pastel look which I know is the stylish thing, but it means there aren't really more then half a dozen distinguishable label colors if that, because the contrast is hindered so much by whatever they've done to it.
> I submitted a bug report to GitHub; hopefully it gets fixed soon!
How do you report bug about GitHub itself?
I tried to do that before (for other issues) but never find the right place.
For example I couldn't tell the text at all in any of the four tags, including the "hard to read" or "quite unreadable".
Edit: I see from the FAQs there's some kind of display calibration portion at the start of the test; should have read the website more carefully before asking!
For what it's worth, I couldn't tell the difference either. All of them were completely incomprehensible.
> What can cause a contrast sensitivity deficit? > Many things can affect the ability to perceive contrast. These include nutritional deficiencies, the consumption of alcohol, drug/medication use, and exposure to endogenous or exogenous neurotoxins and/or biotoxins, including volatile organic compounds (VOCs), venom from animal or insect stings or bites, some species of mold and the mycotoxins and microbial VOCs they produce, cyanobacteria, dinoflagellates (particularly Pfiesteria and Ciguatera), apicomplexans, parasites, heavy metals like mercury and lead, and the pathogens responsible for Lyme disease and its common co-infections. For more information, see our Research resources.
Some new color spaces with the same purpose exist now, maybe I should update it.
And it has decent support:
I think I read that while I was at uni, so well over 20 years ago now. GitHub messing this up now seems disappointing (and aren't they part of MS now? shouldn't this be on the standard "new ui QA tasks" list?)
1. You can't use selection as a hack to make text more legible. Some terminal emulator always use black on white for selection, which helps in this case.
2. If you select a region with the same background and foreground colors, then the selection itself is invisible.
"The value where perceived-lightness equals the lightness-threshold is a plane cutting through the cube ... The intersection between the cube and the plane is a parallelogram..."
Face palm smack.
Of course it is. Feeling really stupid I never realized this before.
Great article.