by s4i on 12/11/24, 6:31 AM with 133 comments
by latexr on 12/11/24, 12:21 PM
I’ve seen better designed and clearer websites with two colours.
by velcrovan on 12/11/24, 4:09 PM
I have a script [1] grab the local temp and convert that to two hue values, which it stores as CSS variables --base-temp and --accent.
Then in my CSS I set colors of various things using hsl() values based on one or the other, e.g.:
background-color: hsl(var(--base-temp),50%,96%);
[1]: https://joeldueck.com/code/jdcom/file?ci=tip&name=static/res...by mxfh on 12/11/24, 3:57 PM
See the HSL .vs OKLCH plots here; https://evilmartians.com/chronicles/oklch-in-css-why-quit-rg...
That's even before going into accessibility considerations with safeguarding the sets for common types of color vision deficiencies.
Also I only clicked, because I thought it was some kind of demo on the https://en.wikipedia.org/wiki/Four_color_theorem
by drpossum on 12/11/24, 11:59 AM
It makes a statement that you need four colors (as if you couldn't possibly make a usable site with more or less) and then locks you into a 1D slider. That slider gives you four colors without much explanation on that page itself on why this particular algorithm is useful as if this solves some general problem.
by gradstudent on 12/11/24, 12:32 PM
Something something glass houses?
by cluckindan on 12/11/24, 10:56 AM
Imagine operating industrial machinery where the ”self-destruct and kill everyone” buttons are the same color, shape and position as the ”shut down safely” button.
by Vampiero on 12/11/24, 9:41 AM
by Night_Thastus on 12/11/24, 4:52 PM
However, I definitely disagree with at the very least the implementation here.
To me, the background can't be some significantly saturated color. It has to be very muted. Otherwise my brain says something is wrong with it. The only combinations I found more tolerable were those where the background became a near-grey and the color was limited to the elements. It's just too much. I'm not sure why, it is just is.
And even then, the contrast felt low, like the whole page was 'foggy' or out of focus.
by philippta on 12/11/24, 2:59 PM
https://www.refactoringui.com/previews/building-your-color-p...
by eadmund on 12/11/24, 1:33 PM
by barbequeer on 12/11/24, 8:35 PM
by esher on 12/11/24, 12:47 PM
by vunderba on 12/11/24, 3:45 PM
https://tedium.co/2017/06/15/ibm-pc-cga-graphics-cards-legac...
by xwall on 12/11/24, 11:44 AM
by snvzz on 12/11/24, 3:31 PM
Thus workbench was originally 4 color, which did stay as default.
Conveiently, at the default hires (640x horiz resolution) 68k cpu would always be able to access chip ram, as the cpu is only able to use half the cycles, and at 4 color the blitter in Agnus uses most of the other half to stream bitplanes to Denise.
by oneeyedpigeon on 12/11/24, 11:51 AM
by rinzero on 12/11/24, 9:39 PM
The site is a good example of aesthetics taking precedent over accessibility. No matter what slider position I chose, I couldn't get an eye-friendly hue with good contrast.
Then I toggled on DarkReader and immediately got what I needed.
by KTibow on 12/11/24, 7:55 PM
With Material 3 they released Material Color Utilities, a library that can generate more complicated color schemes from a source color. It uses a color space that properly accounts for perceived brightness so there's some contrast guarantees.
by Someone on 12/11/24, 1:37 PM
“You need 4 colors
2 for text and background(primary & secondary colors). 1 accent color to highlight important elements(number 4 & buttons). And an OPTIONAL tertiary color to add a bit of personality(the hue slider).”
So, the article contradicts itself, saying that you need 3 colors.
Also, highlighting can be done by different means than color. You can use bold text, inverted video, a different font, blinking, more subtle animations, etc.
In fact, text and background need not be different colors. Varying brightness can be sufficient.
A nice example of all of that is the original Mac. It used two shades of gray (extremely dark aka ‘black’ and extremely light aka ‘white’), but many other monochrome interfaces also showed that two colors suffice.
by butz on 12/11/24, 3:14 PM
by krsdcbl on 12/11/24, 8:25 PM
The author talking about "4 colors", when really he means 4 "color roles" or "theming swatches".
First of all, 4 don't cut it.
You'll need accents for all of them, to fade sidenotes, visual hierarchy and disabled elements; to differentiate states of interactive; for borders, separators, and other parts of the chrome, and visual distinction of illustrative elements like icons; to give just a few samples ..
But the shortcomings of building a design system on 3 swatches for "text, bg, button" will become obvious much sooner, since defining which of the text/bg colors works for the button text depends on the button color itself, etc.
What most frameworks, complex and simplistic alike, get wrong imho, is that you need TWO "layers" of color definition, not to cram your palette definition into semantic concerns of the ui to be decorated. Those are separate concerns!
Or better said: the purpose of design tokens is not to be an abstraction for css properties of distinctive components.
- One Layer is your brand definition, or the color palettes that will serve to define the GUIs design. These are your design tokens
- The other layer is a semantic abstraction of the requirements in the design context. These are your "text, bg, button text, button bg, ..."
The library of design tokens need to acommodate ANY context the brand design could be applied to, and thus provide a wide range of shades for whatever amount of base colors want to use in the brand design.
These will then be mapped to the second layer of "roles", and populate whatever distinct use cases in the design.
TLDR: there is no "text, bg, highlight" color. There are "primary, secondary, accent, neutral, ..." color palettes, and "copy text, copy bg, button text, button icon, button bg, hovered button, .." swatches to be populated with them.
by red_admiral on 12/11/24, 2:04 PM
by vardump on 12/11/24, 10:23 PM
by agos on 12/11/24, 12:01 PM
by bryanrasmussen on 12/11/24, 6:51 PM
Is there actually a 4 color theorem like rule for text and background colors needed, probably there is a design rule but that isn't a mathematical rule the way the 4 color theorem is. And I guess that the rule is just text and background each need a color - so two colors.
by lovegrenoble on 12/11/24, 11:50 AM
by robertoandred on 12/11/24, 5:18 PM
Where did this crazy sentence construction come from? I'm Ron Burgundy?