Why is the color GREY darker than DARKGREY?

Asked

Viewed 56 times

7

When we use keywords to define a CSS property, we can choose colors by name. What often irritates me is that the color Grey/Gray is noticeably darker than the color Darkgrey/darkgray, which makes no sense to me.

Why is that difference?

PS: I didn’t mean just "visibly", because technically that’s true. Gray’s hexadeximal is #808080 while darkgray is #a9a9a9, i.e., the white color (#ffffff) is closer to darkgray than to Gray.

div {
  display: flex;
}

p {
  padding: 20px;
  flex: 1;
}

div p:nth-child(1) {
  background-color: darkgray;
  color: white;
}

div p:nth-child(2) {
  background-color: gray;
  color: white
}

div p:nth-child(3) {
  background-color: lightgray;
  color: black
}
<div>
  <p>CINZA ESCURO (darkgray)</p>
  <p>CINZA (gray)</p>
  <p>CINZA CLARO (lightgray)</p>
</div>

  • 3

    "... which makes no sense to me." Phrase I heard most about back-end developers when they had to work CSS XD. Short answer: Why the W3C thus defined.. Reason: I don’t know. I’ll wait for a very explanatory answer too :)

  • How’s your monitor’s color profile?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.