The 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.
Edit: here you go
https://pastebin.com/5Kypr4kh Edit 2: I would, but I'm at work so personal GH is a no-go atm. I'll cycle back here EOD & make the PR if OP agrees w/ proposal
This 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 then iterate a couple times till I get what I'm looking for. It seems like even more effort to try to select colors from the CSS palette when it might turn out that there isn't even a satisfactory one. The CSS colors are still extremely limited. E.g. the distance between neighbors like "dark cyan" and "darkslategray" is huge.
I prefer to use named colors in my own CSS layouts. "lightsalmon" is more descriptive to me than "#FFA07A" or "rgb(255, 160, 122)" or "hsl(17, 100%, 73.9%)" at a glance.
Awesome if you're in your office on your usual work computer. Not great if you're in the field trying to make quick fixes on whatever terminal a client provides.
> "lightsalmon" is more descriptive to me than "#FFA07A" or "rgb(255, 160, 122)"
While I agree, I feel that learning to look at "#FFA07A" and immediately grok "pink" has been of general benefit to me as a frontend dev. > or "hsl(17, 100%, 73.9%)" at a glance I must admit though that I haven't mastered identifying hue by number just yet (though if I do, it will be even better as Saturation and Lightness/Luminosity are much easier to reason about).
I always found hex codes non-intuitive, but the hue values are easy once you just remember:
0 = red 120 = green 240 = blue Then you just interpolate as desired, so yellow is 60, orange is 30, red-orange is 15. And really all you need to remember is red = 0 (lowest energy wavelength) and the three RGB primaries are spread evenly around the 360° color wheel, therefore 0, 120, 240.
This would be true if the CSS color names were actually reasonable, but many of them are not.
One would be better off using the results [1] of Heer & Stone (2012) [2] (or a similar analysis) to assign names to sRGB colors. You end up with 33 unique names instead of more than 100, and the number of unique names can be reduced further by merging synonyms. [1] http://vis.stanford.edu/color-names/analyzer/
[2] https://doi.org/10.1145/2207676.2208547
It doesn't matter what the names are, the point is you can have a plugin that changes one color to another based on their names and what you can see. The names are a much smaller search space than "all possible hex codes".
Are you saying such a plugin exists that only works with named colors?
That would seem like a... usability disaster. Any accessibility tool for vision should operate at an OS level to map colors across everything. And even if you wanted a web-only tool, it would need to similarly operate across all colors -- whether hex codes or in images or SVG's. Very few sites use any named CSS colors at all except for "white" or "black". There are lots of areas where it's important to keep accessibility in mind... but named CSS colors would not seem to be one of them.
For contrast, css can be quite effective. A brute force background black, text white, link yellow has served me very well. For color blindness correction an OS level filter is the way to go.
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.
I feel pretty confident saying that is not a relevant use case.
I used to use a hand written user stylesheet for color accessibility and know various people using different tools to get the contrast they need. Named colors are not a factor.
> 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%)"
That's what I do too, but I find it leads me to get stuck in a rut with certain color areas. Looking at this site was a good reminder to me to give named colors a try just because it will help me break out of my usual color habits.
I've never used them or seen them used for large-scale production sites but I reach for them all the time when building out small proof of concept or isolated examples for debugging in places like Codepen. It's handy to have a few appealing colors memorized when you're sketching things out.
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 of css preprocessors in the late 2000s that allow defining variables, I have not used them since.
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.
I remembered it wrongly. It wasn't about named colors, but "web-safe colors" that can be displayed by 256 color displays directly, without having to fallback to the closest color or by using dithering. Some of them happened to have a name attached to it. Don't know if the original 16 named colors are also all safe colors.
This is very nicely done, but I still prefer the simplicity of <http://davidbau.com/colors/>. Despite being only 2-dimentional, I find that layout strangely more intuitive. I think the author manually tweaked the color positions, so that may be the reason.
Comments (159) 35 threads
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.
Continue this thread — 1 reply
Continue this thread — 3 replies
Edit: here you go https://pastebin.com/5Kypr4kh
Edit 2: I would, but I'm at work so personal GH is a no-go atm. I'll cycle back here EOD & make the PR if OP agrees w/ proposal
in other words: how can i just bunch more colors together?
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 then iterate a couple times till I get what I'm looking for.
It seems like even more effort to try to select colors from the CSS palette when it might turn out that there isn't even a satisfactory one. The CSS colors are still extremely limited. E.g. the distance between neighbors like "dark cyan" and "darkslategray" is huge.
Continue this thread — 3 replies
While I agree, I feel that learning to look at "#FFA07A" and immediately grok "pink" has been of general benefit to me as a frontend dev.
> or "hsl(17, 100%, 73.9%)" at a glance
I must admit though that I haven't mastered identifying hue by number just yet (though if I do, it will be even better as Saturation and Lightness/Luminosity are much easier to reason about).
0 = red
120 = green
240 = blue
Then you just interpolate as desired, so yellow is 60, orange is 30, red-orange is 15.
And really all you need to remember is red = 0 (lowest energy wavelength) and the three RGB primaries are spread evenly around the 360° color wheel, therefore 0, 120, 240.
Continue this thread — 1 reply
This thread is about developers writing CSS...
[0]: https://duckduckgo.com/?q=%23004cff
Continue this thread — 1 reply
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.
One would be better off using the results [1] of Heer & Stone (2012) [2] (or a similar analysis) to assign names to sRGB colors. You end up with 33 unique names instead of more than 100, and the number of unique names can be reduced further by merging synonyms.
[1] http://vis.stanford.edu/color-names/analyzer/ [2] https://doi.org/10.1145/2207676.2208547
Continue this thread — 1 reply
That would seem like a... usability disaster.
Any accessibility tool for vision should operate at an OS level to map colors across everything. And even if you wanted a web-only tool, it would need to similarly operate across all colors -- whether hex codes or in images or SVG's. Very few sites use any named CSS colors at all except for "white" or "black".
There are lots of areas where it's important to keep accessibility in mind... but named CSS colors would not seem to be one of them.
Does this exist, or is this hypothetical? If it exists, it's something I would add to my toolkit.
Continue this thread — 1 reply
That's what I do too, but I find it leads me to get stuck in a rut with certain color areas. Looking at this site was a good reminder to me to give named colors a try just because it will help me break out of my usual color habits.
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 of css preprocessors in the late 2000s that allow defining variables, I have not used them since.
https://en.wikipedia.org/wiki/Web_colors#Web-safe_colors
Continue this thread — 1 reply
Continue this thread — 6 more replies
Continue this thread — 28 replies
Continue this thread — 2 replies
All comments shown.
Couldn't load more comments. Check your connection and try again.