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;
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.)
Nice. Check out https://github.com/meodai/color-names for a rather large (29888!) collection of hand picked colors in case you want to expand your project.
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.
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.
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.
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?
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.
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.
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
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.
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.
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...
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].
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?
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.
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!).
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.)
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?
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.
> 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.
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!
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.
183 comments
[ 2.7 ms ] story [ 248 ms ] threadHow did you decide on the coordinates for each block of color? KNN on a traditional color wheel?
I often use them when I'm working on new designs and want to experiment on responsive layouts with colourful test elements.
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".
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
(Mentioned here: https://youtu.be/Jbn8IRmSq8M)
My number one recommendation for people who want to get into programming. Daniel is wonderfully quirky, enthusiastic and warm.
https://colornames.org/
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?
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.
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
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.
Time to resurface the most human side to CSS. She's in this color picker, too.
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.
Thanks for sharing.
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.
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.
Fine in Chrome. Thanks for this colour wheel, very handy reference.
It has an extra comma at the end. Safari throws when passed to: c.setAttribute('points', points)
https://github.com/arantius/web-color-wheel/issues/1
https://developer.mozilla.org/en-US/docs/Web/API/SVGStyleEle...
The fix that I suggested does seem to produce a working colour wheel, however.
https://imgur.com/a/Tsx9pEZ
Webkit implementing web standards: https://media.tenor.com/images/7d9d11dacf3d5c4043c1da7cf5f11...
I use Chrome for its developer tools exclusively.
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...
Turned out pretty well
[1]: https://xkcd.com/color/rgb/ ; context: https://blog.xkcd.com/2010/05/03/color-survey-results/ .
[1] https://www.luminoso.com/post/the-color-cloud
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?
https://developer.mozilla.org/en-US/docs/Web/CSS/named-color
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.
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
I'm influenced by the having a daughter born around this time, and Rebecca's story sticks with me.
These days, we have both.
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.
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.
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!
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.
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!
We should instead encourage named colors AND recognize `chucknorris` as an actual HTML color value.