Earlier quoted context omitted.
When I started web dev in the early 2000s, I remember it being recommended to use the named colors because of them being more consistent accross different monitors. Not sure if this was true at all and/or only for the original 16 basic colors. Nonetheless, I kept using them for a while, because I think it makes the css easier to read, when having names (even suboptimal ones) over hex codes. But with the introduction…
This might be a dumb question but how would named colors be more consistent across monitors? I thought they mapped to the same RGB value so there would be no difference between 'red' and #FF0000.
Show HN: Sorted CSS Colors – Sort the named CSS colors in a nice way
111–120 of 167 posts
Re: Show HN: Sorted CSS Colors – Sort the named CSS colors in a nice way
#112Good reminder that in CSS, darkgray is a light gray and gray is a dark gray. Also presumably up is down and wet is dry.
CSS is just an embarrassment of mistakes: white-space: nowrap So they take a word "whitespace" which needs no hyphen and jam one in. Then they take two completely distinct words "no wrap" and jam them together with no separator. And then you have to remember both of these on the same rule .
Re: Show HN: Sorted CSS Colors – Sort the named CSS colors in a nice way
#113Earlier quoted context omitted.
People with vision disabilities can have a custom plugin that changes the colors based on their name, instead of trying to convert all the hex codes. Does this exist, or is this hypothetical? If it exists, it's something I would add to my toolkit.
I honestly don't know, it's just what I was told by someone who is visually impaired a long time ago. That it's easier if people use the names instead of the hex codes because then they can more easily convert that.
It would make much more sense to do something check the lightness ratio between the foreground and background colors, and increase that ratio on the fly. Chrome can already tell you if the color ratio is too low to pass accessibility guidelines. There are a number of plugins that do this, like Color Enhancer [1] or High Contrast [2].
1. https://chrome.google.com/webstore/detail/color-enhancer/ipk...? 2. https://chrome.google.com/webstore/detail/high-contrast/djcf...
Re: Show HN: Sorted CSS Colors – Sort the named CSS colors in a nice way
#114Earlier quoted context omitted.
Looks like it's on Github, you could submit a pull request to add those things :)
I think giving feedback is a valid way to contribute, I certainly would welcome feedback if it were my project. Not all contributions must be code.
Re: Show HN: Sorted CSS Colors – Sort the named CSS colors in a nice way
#115The idea was to create a tool to sort the named CSS colors in a way that it shows related colors together. So, next time I can't decide between a few CSS colors, I can just check them here side by side. I've created this tool last summer, but I hadn't shared it here back then. It's a PWA that I made with pure JS.
Re: Show HN: Sorted CSS Colors – Sort the named CSS colors in a nice way
#116This is definitely a cool way of exploring CSS colors. But, serious question: does anyone actually use CSS colors except for a handful of the basics ("red", "blue") for prototyping/debugging? I mean, the idea of typing "background-color: lightsalmon;" just feels so bizarre to me. Whenever I've needed to come up with colors from scratch, I'll just start with an intuitive best guess -- e.g. "hsl(30, 80%, 50%)" -- and t…
Words in stead of numbers add a nice touch
Those who treat it as craft and an art
May find that named colors are a good start.
Re: Show HN: Sorted CSS Colors – Sort the named CSS colors in a nice way
#117Slightly off topic, I always thought named CSS colors are generally ignored (in favour of 'rgba' / '#hex'). Are named CSS colors seeing any practical use?
I see them used a lot in SVGs. But I don't know if that's a technical issue, or programmer preference.
Re: Show HN: Sorted CSS Colors – Sort the named CSS colors in a nice way
#118This is definitely a cool way of exploring CSS colors. But, serious question: does anyone actually use CSS colors except for a handful of the basics ("red", "blue") for prototyping/debugging? I mean, the idea of typing "background-color: lightsalmon;" just feels so bizarre to me. Whenever I've needed to come up with colors from scratch, I'll just start with an intuitive best guess -- e.g. "hsl(30, 80%, 50%)" -- and t…
.notice {
padding: 1em;
border: 1px solid black;
margin-bottom: 1em;
}
.notice.warning {
background-color: peachpuff;
border-color: red;
}
.notice.success {
background-color: green;
border-color: lightgreen;
}
I think the end-result is pretty nice.Re: Show HN: Sorted CSS Colors – Sort the named CSS colors in a nice way
#119Slightly off topic, I always thought named CSS colors are generally ignored (in favour of 'rgba' / '#hex'). Are named CSS colors seeing any practical use?
Re: Show HN: Sorted CSS Colors – Sort the named CSS colors in a nice way
#120This is definitely a cool way of exploring CSS colors. But, serious question: does anyone actually use CSS colors except for a handful of the basics ("red", "blue") for prototyping/debugging? I mean, the idea of typing "background-color: lightsalmon;" just feels so bizarre to me. Whenever I've needed to come up with colors from scratch, I'll just start with an intuitive best guess -- e.g. "hsl(30, 80%, 50%)" -- and t…
Code is poetry when written as such, Words in stead of numbers add a nice touch Those who treat it as craft and an art May find that named colors are a good start.
Or red or lightsalmon or yew
Remember that if life is rough
Just add in a little more peachpuff!