183 comments

[ 2.7 ms ] story [ 248 ms ] thread
I like the way you're displaying this.

How did you decide on the coordinates for each block of color? KNN on a traditional color wheel?

It is a Voronoi diagram (https://mathworld.wolfram.com/VoronoiDiagram.html) where each point is a web color as it would be positioned on a full hue-saturation color wheel.
It's cheating a bit and using `saturation + brightness / 5` as radius. This separates colors with the same saturation and hue, in particular grays.

    // Based on https://stackoverflow.com/a/54522007/91238 .
    // I've tweaked it to spread out some of the colors (especially they greys)
    // that don't fit well into a true H/S wheel.
    let colorRadius = (s + v/5)*0.75 * radius;
    let colorAngle = h/360 * 2 * Math.PI;
Doesn’t work on iPad
(comment deleted)
Specifically, in renderWheel() at c.setAttribute('points', points), Safari balks at the assignment and says it cannot parse the value it's been given. Perhaps the terminal comma isn't supported? (Chrome complains about it but proceeds.)
I love this! I've had the 'Web colors' Wikipedia page in my bookmarks for years.

I often use them when I'm working on new designs and want to experiment on responsive layouts with colourful test elements.

Funny to me that how #FF0000 is named Red, #0000FF is named Blue, but #00FF00 is Lime. Maybe it was supposed to be RLB. Although Green is the canonical name for that color range, what we actually refer as Green in daily life is close to #008000.
Yup, it's due to the fact that we perceive green as much brighter.

It's actually very interesting to look at "constant luminance color wheels" which correct for this perceptually:

https://www.researchgate.net/profile/Ralph_Redden/publicatio...

https://i.stack.imgur.com/f4n0P.png

What we traditionally call "yellow" isn't even present, it becomes more like "khaki" or "olive".

On hot summer days I set my LED lights to 100% green. The idea is that I get more perceptual brightness per unit of heat released into the house. On days like that I am still getting light through the window, even if it is filtered by a space blanket, and I am mainly looking at screens, so there is still plenty of red and blue light around.
Why do you do that, does it have a health benefit?
> I get more perceptual brightness per unit of heat released into the house
To reduce the heat that the bulbs are putting out, I think? Though, LED bulbs are already very efficient, and the difference in power usage between green light and a perceptibly the same brightness normal warm or sky tone light is probably minimal.
You may want to measure the actual power usage and light output of your LED lights. Typically, green LEDs are less efficient than blue or red, which may cancel out the perceptual differences.
(comment deleted)
I don't see any red in this either

  Funny to me that how... #00FF00 is Lime... what we actually refer as Green in daily life is close to #008000
And that "limegreen" (#32CD32) is a third, distinct color name.
That doesn't sound SO absurd to me when I think about it. Limes do go through a fair range of colour space, after all. Maybe there should be a limeyellow?
Very cool.

Would be fun to add data visualisation, like "see how often those color are used" or "what color is associated with that subject" !

Don't know how you could do it but it can be interesting

Broken on iPhone
I'm picturing Bob Ross standing over this palette whispering "We're going to put a happy little div here with a shade of cornflowerblue".
cornflowerblue? That's happy little mistake in the making.
should have gone with burnt umber imo, but to each their own
Is there a Bob Ross for websites/apps (or general programming) somewhere out there on Youtube or Twitch?
"Happy little JavaScript errors"
Lots of video game mechanics were "happy little accidents" that were then codified. For instance, in Space Invaders, the aliens speed up as there are fewer of them; this was an emergent behavior that was codified, at first it was caused by the game outputting frames as fast as possible & having less computation to perform as aliens were eliminated.

(Mentioned here: https://youtu.be/Jbn8IRmSq8M)

The Coding Train. Daniel is amazing and has a Bob Ross-esque vibe to him.
+1

My number one recommendation for people who want to get into programming. Daniel is wonderfully quirky, enthusiastic and warm.

In case the named web colors aren't enough, we're making excellent progress naming every color in the RGB space.

https://colornames.org/

(comment deleted)
Which RGB space?

8-bit? and then which bit-8? the "2 bits for blue" 8-bit?

Or 16-bit? 24-bit? 32-bit? Using floats or not?

The one that everyone and their grandmother uses to pick screen colors: 8bits per channel, integer.
To be fair there's a point here, which is that color spaces from sRGB to DCI-P3 to REC2020 do have quite different color/tone/brightness ranges (gamuts). Old windows boxes (and old monitors) also displayed them very differently (especially the low brightness ones). Macs were much better, and that made picking colors on them far more repeatable.

Now everyone in Windows world has standardized on sRGB and Mac on DCI-P3, but mobile is more important, where I believe it's still split sRGB Android, and DCI iPhone.

I don't know, but expect that HTML picked sRGB for their color space since this is the one people historically meant. I'd be surprised that it wasn't configurable and there weren't multiple versions, because why have a standard, when you can choose!

We won't even get into HDR, automatic brightness/eye-saver, or white point adjustment. You'ld be better off looking for a color perception scale rather than display scale, if you wanted to avoid that. Environmental lighting has big effects on perception though.

just fyi they're adding support for different color spaces to css
I remember that! I participated a bit, it was pretty fun
This is absolutely deranged and I love it.
It would be interesting to have goals or visualize tiers by number of significant bits of the individual color components.
I've used this a lot actually and appreciate it exists but I have a lot of issues. First of all is how much it's used for memeing and coming up with funny sounding names for certain colors. There are also many professional color palette names. Some, like CSS named colors, are very well-represented. Others like Wikipedia's list of named colors[0] draw from various sources. Then there's others that might be historically important[1] but little known otherwise. But basically anything outside of CSS named colors, Crayola, and Pantone is completely ignored. There have been many instances where I've seen major color-naming bodies (e.g. ISCC or the Federal Standard 595C) all agree that some color name is mapped to a certain color but the users of colornames.org have just completely ignored it and come up with a new color for it. How do we name new colors without ignoring names that have already been assigned?

My second major issue is how deeply susceptible it is to cultural biases. Wikipedia handles the issue of constantly changing knowledge/culture by stating that its mission is to capture knowledge "as it currently" exists.

I'd like to see a version of the colornames scores where votes are weighed by recency. Older votes can still count, but in order to capture constantly changing/adapting culture and emerging consensuses we can maybe weigh more recent votes more heavily

Another thing I'd love to see is to just have accounts answer the question: "Which language have you spoken the most of in the past (7) years of your life?" I think this one simple data point can solve a LOOOT of the issues and captures both culture and heritage without having to differentiate between place of birth, changing life circumstances and upbringings, etc. This would also mean that people who speak Tagalog don't have to see their well-agreed-upon name for a color being overwritten by the norms of demographic majority of the userbase which skews English-speakers

---

Clearly I have a lot of thoughts haha. I still love that color-names exists. One thing I'd like to build out some day is something to aggregate all the different color naming schemes out there and have colornames.org simply be a source amongst many others. Similar projects already exist[2] but none that are explicit about being attempt to aggregate sources and not BE the ultimate word on what color is named what

.. [0] https://en.wikipedia.org/wiki/Lists_of_colors

.. [1] https://github.com/davo/Color-Standards-and-Color-Nomenclatu...

.. [2] https://github.com/meodai/color-names

Welp, this ate my time. Fun. Cool.
does not work on Safari (MacOS)
Yep. Error inside: function renderWheel().

Interestingly, errors in Chrome in the same function — apparently rendering continues however.

Guessing the problem is that the line: points += `${s.x} ${s.y}, `;

is adding an extra `, ` to the end of the string causing the assignment/parse that follows to fail.

https://meyerweb.com/eric/thoughts/2014/06/19/rebeccapurple/

Time to resurface the most human side to CSS. She's in this color picker, too.

I can't speak for anyone else, but I try to include rebeccapurple whenever I can in the web sites I build.

Some may consider it an Easter Egg. I consider it being a human, and a throwback to when computing was more of a community, and less of a competition.

I still have fond memories of the time when the Smashing Network was a thing.
I didn’t know about this 8 years ago. I’m glad I found out about it today - as the father of a young child - because this post was incredibly moving to me.

Thanks for sharing.

(comment deleted)
(comment deleted)
So simple and so elegant.

Would it be a good idea to make the click copy the color in the clipboard? Not the color code, of course, in the spirit of the website.

This is quite cool. I've always used some of these colors when doing initial mockups.
Interesting how some colors are so close from each other, especially "Chartreuse" and "Lawngreen" (on my middle-end monitors, at least).
Same for me, and the "springgreen"/"mediumspringgreen" are practically the same color on my screen. I'm wondering what was the reason the original spec included those colors. Were CRT monitors of old that much better?
I used to know a lot of digital photographers who clung to their CRTs for a long time after LCDs became common. You could get LCDs with better color reproduction, but they were extremely expensive, especially compared to the fact that you could barely even get rid of CRTs (and all of the photographers I knew were constantly cash-strapped from all the photography kit they compulsively purchased).

It's gotten better, your run-of-the-mill low-end LCD these days isn't that bad, and better ones aren't that much more expensive anymore. But yes, there was a long time when CRTs outperformed LCDs on this one metric.

On my Mac, and on windows on my laptop, every colour is distinct. On Ubuntu on my laptop (with good monitor) many of the colours (the greens around the edge for example) look the same.
This is great! Would be useful if selecting a colour changed the URL so you could link directly to it.
Doesn't work for the latest Safari browser.
(comment deleted)
Seconded. Safari Version 16.0

Fine in Chrome. Thanks for this colour wheel, very handy reference.

Interesting, can you be more specific? Developed in Firefox, reports that Chrome is OK. I don't have a Mac to test with.
As per another comment, this is the problematic line: points += `${s.x} ${s.y}, `;

It has an extra comma at the end. Safari throws when passed to: c.setAttribute('points', points)

Yeah, Chrome don't like either, but apparently Chrome does not throw.
I found and I think fixed the issue.

https://github.com/arantius/web-color-wheel/issues/1

I don't think the real issue is that one. At least in Safari I get this:

    t = document.createElement("template")
    t.innerHTML = `<style id="outside"></style><svg><style id="inside"></style></svg>`
    t.content.querySelector("#outside").sheet // null
    t.content.querySelector("#inside").sheet // undefined
That means that the .sheet property is present on the style element, but not if it is inside an svg element.
This is what I saw too. Safari apparently does not support SVGStyleElement.sheet:

https://developer.mozilla.org/en-US/docs/Web/API/SVGStyleEle...

The compatibility chart shows Safari supporting SVGStyleElement.sheet since v 3 (v1 iOS).

The fix that I suggested does seem to produce a working colour wheel, however.

(comment deleted)
Interesting, the missing SVGStyleElement.sheet must be a Safari bug not captured by MDN’s compatibility chart? Your workaround of finding the sheet in document.styleSheets is clever and seems to work.
For some reason, the style element inside the svg does not have a .sheet property. A workaround is to create the style element in js and append it to the svg, or move it outside the svg and let the styles cascade. A strange bug...
Yep, Safari latest

https://imgur.com/a/Tsx9pEZ

To the surprise of absolutely nobody.

Webkit implementing web standards: https://media.tenor.com/images/7d9d11dacf3d5c4043c1da7cf5f11...

I’ve been developing for the web for 25 years and Safari is my browser of choice.

I use Chrome for its developer tools exclusively.

Well it's not like you get a choice on iOS anyway
WebKit is doing quite well these days: https://wpt.fyi/interop-2022
And yet there is only one browser that 5 people always comment about saying "not working" when there's some kind of web thing posted on HN. Those tests don't seem to reflect reality.

I still recall a time 3 years ago when they didn't even have working webrtc support hah.

I still recall a time 3 years ago when they didn't even have working webrtc support hah.

That’s a long time ago in web years. Things are different now.

For example, Safari supports the oklch and oklab color spaces starting with Safari Technology Preview 137, released December 2021.

It’s November 2022 and Chrome still doesn’t support them yet, though they are expected to be enabled by default in Chrome 110, due next month.

And of course the most anticipated selector probably ever :has() shipped in Safari 15.4 back in March [1]; Chrome didn’t ship it until August and Firefox still doesn’t have enabled by default—it’s behind a flag due to bugs.

The oklab and oklch color spaces solve a bunch of color issues with RGB and HLS [2].

This is not WebKit from 3 years ago.

[1]: https://webkit.org/blog/13096/css-has-pseudo-class/

[2]: https://evilmartians.com/chronicles/oklch-in-css-why-quit-rg...

Same… and I’m running Safari 16.2 on the latest public beta of macOS Ventura.
Feature request: letting the user provide their own data and maybe offering some presets; e.g. I'd like to see the XKCD color survey [1] as the base.

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

Why are they called "web" colours?

I understand that the term "web safe colour" is for colours that was within the space of 216 "safe colour" table, for displays that could only display 256 colours, but I think it's another matter?

If I had to guess, it would be because they're the names you can use in place of RGB values in style/CSS
They are colours that have names in CSS. You can access 16M colours with #RRGGBB syntax but these colours are aliases to specific values and can be specified by name.

https://developer.mozilla.org/en-US/docs/Web/CSS/named-color

Didn't those come from X11 - I'm sure I was using some of those for terminal settings long before the Web (let alone CSS).
> Didn't those come from X11

Almost. See https://en.wikipedia.org/wiki/X11_color_names#Clashes_betwee...

I remember, way back when some of hadn't been born and the web was new and exciting, noticing the difference in greys when using the same colour names in a desktop tool's output and it's HTML documentation.

I actually think I developed a preference for some colours and combinations based on using HyperNeWS, which had a particularly tasteful set of colour combinations (at least for 1990 or so!).
(comment deleted)
always use the emacs list-color-display for that
This is great. I always use the named variables in prototypes when I can (go tomato!) but have never thought about their distribution.
Great little project! It's cool to see the skew towards red/green variants.
Totally irrational, of course, and now set in stone for backwards compatibility. https://arstechnica.com/information-technology/2015/10/tomat...

CSS Color Module Level 4 (draft) admits as much, and states "their use is not encouraged." https://www.w3.org/TR/css-color-4/#named-colors

In 2014, however, an unexpected event cast the color list in a more favorable light: a new shade. “Rebecca purple,” was introduced to honor the life of Rebecca Meyer, the daughter of Eric Meyer, a respected programmer and CSS writer. Rebecca died of brain cancer at the age of six; the hue (#663399) was chosen to reflect her favorite color. (A few developers opposed the addition, maintaining that a set of standards was no place for an emotional tribute. They were dismissed as curmudgeons.)
That colour is right in the top center of the tool we're discussing. I suspect that is not a coincidence.
I do agree that a Web standard is not the place for personal tributes. (Imagine how unusable the colour list would become if all the colours had random personal names in them!) Am I a terrible person for being aligned with the folks who opposed the addition?
No. But if you go on and on that you didn't get your way, you might be.
When I loaded up the link, before viewing the comments in here, the very first thing I did was look for "Rebecca purple", and I was happy to find it. Not really a comment on your remarks, but thought I would share it.

I'm influenced by the having a daughter born around this time, and Rebecca's story sticks with me.

No, I agree. Web standards are not a place for personal tributes and documentations are not a place for political statements.

These days, we have both.

> documentations are not a place for political statements

Our work is a reflection of ourselves. Some of us feel strongly about issues that affect us in a personal way. You are likely referring to social issues you do not agree with, and as a gay man I have this to say: I will not stop asserting my right to exist openly, and that includes in the work I do.

No offense but thank you for demonstrating this issue perfectly.

You instantly assume that I am talking about social issues that I do not agree with or that do not affect me and feel personally attacked.

It's quite the opposite, though. I most often agree with the messages people put in their documentation. Some of them even have a very deep personal meaning for me.

Yet, I stand by my point that a technical documentation or standard is no place for them. You, I or nobody has any right to force someone who is trying to build software to listen to your/my/their personal beliefs and political opinions.

>You, I or nobody has any right to force someone who is trying to build software to listen to your/my/their personal beliefs and political opinions.

I'm going to continue to build, and to make, and to live, and to thrive.

There is never "a place" for inconvenient speech. This is an extremely privileged position.

Don't like it? Don't read my docs. Go consume elsewhere. Thanks!

It sounds like the two of you are talking about different things (personal creations vs. international standards) — perhaps that's a root of the disagreement?
Frankly, I was focusing less on the standards and more on documentation, but I would absolutely include an advocation for my human rights into any standard I was responsible for. There are still many countries I am unable to safely visit, and if they are going to use my work, I want them to at least be cognizant of their cruelty.
This genuinely sounds like satire to me. You don’t know the politics of the person you’re replying to, to say the least.

Additionally, even if I agree on your assertion of “your right to existing openly”, it doesn’t mean that you shouldn’t exercise that right wherever you can get away with it and fuck the haters.

>You don’t know the politics of the person you’re replying to, to say the least.

I said likely, not absolute. After a certain amount of people complaining about your including social issues in your work, you begin to see a pattern :)

>it doesn’t mean that you shouldn’t exercise that right wherever you can get away with it and fuck the haters.

A brief aside of solidarity with my trans brothers and sisters is crucially important. The recent shooting in Colorado only strengthens my resolve.

You don't have to like it. You are free to complain about it. Thanks!

Is rebeccapurple really any worse than dodgerblue, cornflowerblue, greenyellow, or yellowgreen? At least it has "purple" in the name.
I take that to mean they're not discouraged. After all, the <marquee> element still appears to work in 2022. I imagine if named colors are ever removed as a feature from browsers, it won't be until a year like 2057.

We should instead encourage named colors AND recognize `chucknorris` as an actual HTML color value.

If Chuck Norris were a web color it would be #BADA55