Replies: 3 comments 10 replies
-
| 
         The example you've provided doesn't really provide information on the seed hue or how they post-process the color after, but I can give you a rough idea as to what is likely happening. 
 In short, it would be important to know exactly what approach they are using to get those colors back into gamut. Some approaches do much better than others.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Keep in mind that I am making a number of assumptions right now as I don't know exactly what they are doing. I'm only sharing what I think they may be doing. 
 Like I showed in the diagrams. Monitors and such have a range of colors they can display (a gamut). If a color is outside that range, it is out of gamut. Some popular gamuts for monitors are sRGB and Display P3. 
 I would assume so. To display the color on your screen, they would have to be getting the colors back into gamut, or the browser will do it if it isn't using whatever approach they choose. Right now, browsers clip as a final gamut mapping approach has not been decided. And if so, which one, sRGB? Again, I don't know, but I would assume sRGB as it would be the safest gamut to target, as most screens support this; otherwise, they are letting the browser clip or gamut map the colors. 
 Again, I don't know exactly, as I haven't dug into what they are doing, but I would assume the easiest way is to start with a seed color and modify the lightness to different levels. Once the new color is created, gamut map it back to the your display gamut. Similar to what I demonstrated.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Ah, the holy grail of dynamically producing color tints. I've been working on this on and off for at least two years and still haven't cracked it. Caution fellow travelers, I nearly lost my mind trying to figure this out. First, gamut mapping is an area of active work in the CSS WG right now. Here are the most recent updates: w3c/csswg-drafts#10579 But the topic of generating tints from a single key color with aesthetics comparable to tints hand-tweaked by a designer goes way beyond gamut mapping. It's one of those things where getting close is easy, but beyond a certain point, getting closer is exponentially harder. You can see some of my research data here: https://palettes.colorjs.io/ My hope was to find a color space with sufficient regularity that creating tints would be a simple matter of tweaking a coordinate (or at least where the math would be straightforward). So far, I have not succeeded in finding such a space. OkLCh seems to be the best color space for this work, but the math is still far from straightforward. We were sold the idea that perceptual color spaces will solve all our color scale problems and finally realize the promise of dynamic color scales. After studying designer-created color palettes, I have come to the conclusion that color scale generation is fundamentally an activity involving multiple perceptual color components. It's not that the color spaces are problematic, it's that we don't really want perceptual uniformity. When designers see what only tweaking lightness does, it doesn't look good, even after gamut mapping.  
Gamut mapping is usually sufficient for darker tints, but not lighter tints. The drop varies depending on what tint your key color sits at, and what your key color chroma is, but I have not found a good formula for predicting it. It even varies by hue. Gamut mapping does bring you a lot closer, but not close enough. Some people use  Even hue is not constant! Certain hues involve hue shifts, with dark yellows having the strongest shifts, to make them warmer and avoid the diarrhea aesthetics that cooler dark yellow can have:  
Blues often have some degree of shift, to avoid purpling (yes, even in OkLCh, whose main premise was to avoid this kind of purpling). The thing is, aesthetics != perceptual uniformity. An idea I've heard from time to time is what if we could create a color space optimized for this work. But there are certain colors you pretty much never want in a color scale because they just …look ugly. Cool dark yellow being the poster child. So the gamut of such a color space would be very weird. At this point, I think what we need is a) more data and b) someone with a background in numerical analysis just producing a model…  | 
  
Beta Was this translation helpful? Give feedback.








Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to ask, in your opinion, what is the right way of generating UI color scales from a single, custom hue?
I mean similar to the 12 levels offered by Radix Colors, Open Color, Tailwind, Open Props, etc.
Radix has a custom palette generator, looks nice on the surface, but doesn't generate nice colors for some hues.
I'm storing the colors in oklch, and I've seen that Open Props does simple L and C manipulation like this:
But then I read that oklch is actually not "symmetric" in this way, you cannot just change the hue and keep the rest as it'd get out of gamut.
The other interesting phenomena I've noticed is that the hue values skew slightly both in Tailwind and in Radix Colors, when converted from p3 -> oklch.
For example this is Radix's slate color converted from p3 -> oklch:
Does this skewing mean that the hue model used in oklch is not reflecting the human visual "hue" perception?
Beta Was this translation helpful? Give feedback.
All reactions