Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Why Dark Gray Is Brighter Than Gray in CSS (medium.com/commitlog)
89 points by pplonski86 on June 10, 2019 | hide | past | favorite | 18 comments


Originally, HTML didn't support any kind of colours at all.

Netscape introduced HTML attributes for colouring things, and it passed the colour names straight through to X11. Because X11 shipped with a suite of pre-defined colour names, Netscape supported those pre-defined colour names. Because X11 supported custom colours in #RGB, #RRGGBB and #RRRRGGGGBBBB syntax, Netscape supported those too.

Meanwhile, Microsoft wanted in on the browser game, but a lot of people still used Windows on machines with 16-colour VGA rather than high-end workstations with true-colour displays, so Internet Explorer couldn't offer the hundreds of named colours Netscape could. Instead, it provided names for the standard Windows 16 colour palette: black, maroon, green, olive, navy, purple, teal, silver, gray, red, lime, yellow, blue, fuchsia, aqua, white.


> Netscape introduced HTML attributes for colouring things, and it passed the colour names straight through to X11. Because X11 shipped with a suite of pre-defined colour names, Netscape supported those pre-defined colour names. Because X11 supported custom colours in #RGB, #RRGGBB and #RRRRGGGGBBBB syntax, Netscape supported those too.

Thank you. This is much clearer than the article.


Thanks, I didn't quite follow the explanation in the article, but I'm still confused. When was the decision made to use "dark gray" for something brighter than 50% gray? Why? By whom?


The real problem is the web color uses the same name, but not the same color. X11 'gray' is rather light (#BEBEBE / 75%), where the W3C 'gray' is significantly darker (#808080 / 50%). (X11 also had a 'web gray' that matched this!)

The X11 'dark gray' at 66% (rather like the W3C 'silver') thus made sense in its color set, though not when imported into a different set.

You might say, "this means X11 only had very light grays", and from a named perspective this seems to be true. I'm not certain if this is due to UI fashion or a physical artefact of the monitors. But in any case, if you wanted darker shades in X11, you could use 'grayNN', from grey0 (black) on up to grey100 (white).


Ah, thanks, now I get it. Also not sure about the reason for the x11 naming, but I can imagine the gamma curve influencing the choices for those values.



>Even today in the latest CSS draft the color “dark-gray” produces a lighter shade than the color “gray”, and just to prove naming things is hard both grey and gray are valid color names.

Now if we can just make both color and colour into valid colour names, I'll be happy.


You mean, valid color names right?


Can anyone remember 'web safe colours'?

https://en.wikipedia.org/wiki/Web_colors#Web-safe_colors

In the days when you could even get an SGI workstation with 8 bit colours the 'web safe colours' was a safe bet.

I very much like the colour names, although some are way off. In particular 'chocolate' is more orange than chocolate coloured.

I also like the 'black' and 'white' easy colours rather than the hex codes even if it is one or two more bytes.


The old X11 rgb.txt has a lot of historical choices that are dubious today.

Randall Monroe built a "better" one[1] from crowdsourced data on the internet, but even he admits that it's too late to change.

[1] https://blog.xkcd.com/2010/05/03/color-survey-results/


"Fuchsia" seems a problem colour. Funny to think Google are using the least well spelt colour for their operating system project.


If DarkGray is too bright (66%), there's always DimGray at #696969 (41%)


nice


A bit of a tangent: given how modern monitors are increasingly being factory color-calibrated and having HDR with zone-controllable backlights, etc.; is there (or could there be) a color space where “brightness” is absolute, i.e. radiated photons per area, measured in e.g. lumens per square millimeter? (Presumably, anything needing to render elements defined in such a color space would need to probe the OS for information about the nits, DPI, and gamma-curve setting of the monitor, and then work backward.)

I don’t know if it’s something CSS would adopt, but it’d be neat to be able to create e.g. a JPEG image of the sun that shows up as eye-searingly-bright on all compliant HDR monitors, sitting in a window next to regular windows where “white” just means a not-too-eye-searing shade.

What’s CSS’s policy on adopting units that only make sense for certain media, anyway? (E.g. “seconds of arc” as a size measurement for VR displays?)


https://github.com/w3c/strategy/issues/18

there has been some discussion about adopting HDR images for the web.


TLDR: “dark-gray” came from when the X11 color set was imported into CSS, while “gray” came from the original HTML colors.


This has always bothered me.


Once again, an article behind what is effectively a paywall. Medium is perhaps more objectionable than a true paywall, since you have to pay via agreeing to tracking...




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: