Live data from Hacker News

New alternatives to HSL and HSV that better match color perception

bottosson.github.io

71–80 of 80 posts

Re: New alternatives to HSL and HSV that better match color perception

#71

Good related reading: https://raphlinus.github.io/color/2021/01/18/oklab-critique.... , with some analysis of various colour spaces of different types, focusing especially on their behaviour in gradients, to do with interpolation. My biggest complaint about perceptual colour spaces has been that they make working with colours near gamut boundaries really hard. For example, with #ff0 (yellow) in LCH, you can’t tweak a…

> you can’t tweak any of the three parameters in either direction without going out of gamut

This is a good thing: it teaches you the shape of the gamut, and gets you working with colors consistently.

#FFFF0O does not have “plenty of practical value”. It is a very niche tool with an extremely small range of uses, and should be avoided almost all of the time.

> For colour pickers especially, perceptual colour spaces have just been no good,

Just the opposite: for color pickers especially, using anything else makes it much much harder to get good results.

Re: New alternatives to HSL and HSV that better match color perception

#73
post #6

Looking at the author's explanation for HSV and HSL, it sounds like they are designed for hypothetical programmable wavelength lights and paints. Hue would be wavelength, Saturation is either output filter bandwidth or conversion element efficiency, Value/Lightness is either output current or amount of ink. RGB is likewise for fixed wavelength three-color lights/filters, and CMYK is for prints. I think it's the same…

HSV/L are conceptually close to the way artists have been thinking about color for centuries, since the days when everyone ground their own pigments.

Hue is the angle on the color wheel. Which somewhat translates to wavelength if you ignore the fact that we see chords of high blue + low red as the colors we give names like purple, indigo, violet, and magenta.

Saturation is how intense the color is. Lower the saturation and it turns grey, or pastel. We have a few special names here; "pink" is a low-saturation red, for instance.

Value/lightness how dark/light a color is. Lower the value on that "pink" and you might get something you'd label "brick red": it's darker, it's still definitely reddish, but it's not the most intense red you can get while still being kinda dark.

Saturation collapses as you go to the extremes of value/lightness, it's just pitch black at one end and pure white light at the other.

Re: New alternatives to HSL and HSV that better match color perception

#74

These days I would want a color picker that considers the lighting and surrounding colors. I have an office which has huge windows facing (mostly) away from the sun so I have bright light from either clouds or blue sky. Reproductions of renaissance paintings and photographs on ‘bright white’ paper look great, but at home the color temps are in the high 2000s usually and I need coated papers for the images to be compe…

FTA: OKLab et al specifically excludes consideration of illumination environment for simplicity: "Should assume normal well lit viewing conditions"

https://bottosson.github.io/posts/oklab/

Re: New alternatives to HSL and HSV that better match color perception

#75

Good related reading: https://raphlinus.github.io/color/2021/01/18/oklab-critique.... , with some analysis of various colour spaces of different types, focusing especially on their behaviour in gradients, to do with interpolation. My biggest complaint about perceptual colour spaces has been that they make working with colours near gamut boundaries really hard. For example, with #ff0 (yellow) in LCH, you can’t tweak a…

IMO perceptual uniformity isn't even necessarily desirable in all (or even most) cases. The only time I think it's really necessary is making color palettes for data visualizations. Otherwise, if you're e.g. designing a color palette for a webpage, you probably do want some variation in perceived brightness. Heck, I could think of plenty of valid data visualization scenarios where you'd want this.

I worked on software that had the ability to change the hue of an object. If you had a bright blue car and wanted it to be yellow, changing the hue to yellow worked perfectly. Then the perceptually correct zealots took over and mandated that all color manipulations would take place in the Lab color space. Now the intense blue 0,0,255 didn't turn into an intense yellow 255,255,0, it turned into what was considered a yellow of the same lightness - 31,31,0. This was too dark to be useful to anybody, and there was no way to compensate. Worse yet it wasn't even correct, because the lightness isn't accurate for intense saturated colors - if you look at 0,0,255 and 31,31,0 side by side you'll see what I mean, they're not even close to the same perceptual lightness.

Re: New alternatives to HSL and HSV that better match color perception

#76

Earlier quoted context omitted.

Just out of curiosity, what if you go to a significantly darker brown, say 30/100/20 h/s/v. Unfortunately these subjective tests will vary from monitor to monitor, but assuming that's still clearly brown rather than black to you (to me it's a more archetypal brown than the brighter version you initially named, which I might call orange-brown) -- what do you perceive when you keep the saturation and value fixed, and v…

> Would you agree that many or most of the other hues give you a colour more obviously 'dark X' Hmm not really. But we're not going to resolve what seems like a subjective question!

Oh don't worry, I wasn't planning on trying to argue the point! Just genuinely curious about the extent to which our difference is perceptual/conceptual/other. If we disagree on the 'dark X' thing, it makes me think there's a real perceptual difference and/or a pretty deep conceptual one (in terms of how we divide up the colour spectrum), though of course it doesn't prove anything.

Re: New alternatives to HSL and HSV that better match color perception

#77

Good related reading: https://raphlinus.github.io/color/2021/01/18/oklab-critique.... , with some analysis of various colour spaces of different types, focusing especially on their behaviour in gradients, to do with interpolation. My biggest complaint about perceptual colour spaces has been that they make working with colours near gamut boundaries really hard. For example, with #ff0 (yellow) in LCH, you can’t tweak a…

My biggest complaint about perceptual colour spaces has been that they make working with colours near gamut boundaries really hard. I agree, this can be awkward. I like using perceptual spaces because they are self-evidently a “neater” starting point for colour work than something artificially distorted like HSL or (horror!) RGB, but it’s important to recognise that they offer an incremental improvement and don’t mag…

I created a tool that could help you on creating this type of palettes. It's based on CIELAB and you can see where all the colors are placed in the lightness, chroma and hue space. You can also see they boundaries for any family color so you know how much you can stretch chroma without shifting lightness or hue.

Tailwind.ink

Re: New alternatives to HSL and HSV that better match color perception

#78
post #14

My phone and laptop, and browsers support DCI-P3. Is there a color picker for wider gamuts? Because the article keeps talking about sRGB and picking in that color space, but I feel like is limiting the capabilities of current technology.

I had the same question looking into HSLuv recently. Came across this https://github.com/hsluv/hsluv/issues/73 but it didn't really gain much traction. Maybe it'll be more popular once Chrome finishes CSS Color Module Level 4 color space support.

Well, I gave it a +1 and a subscribe. Hopefully we can break the chains of sRGB soon.

Re: New alternatives to HSL and HSV that better match color perception

#79
post #78

Earlier quoted context omitted.

I had the same question looking into HSLuv recently. Came across this https://github.com/hsluv/hsluv/issues/73 but it didn't really gain much traction. Maybe it'll be more popular once Chrome finishes CSS Color Module Level 4 color space support.

Well, I gave it a +1 and a subscribe. Hopefully we can break the chains of sRGB soon.

There's value in having a lowest common denominator. sRGB isn't going anywhere for quite some time.

Re: New alternatives to HSL and HSV that better match color perception

#80
Art teacher speaking. Hope the author is reading.

The figures directly under the sentence ‘Here is the sRGB gamut plotted for set of hues…’ have real utility which the author may have missed. They clearly show that the peak saturation value has a different lightness value for each hue. For example, a peak saturated yellow is required to be brighter than a peak saturated blue.

Explaining this to designers can be a real grind. These figures would make the task a lot easier.

I really wish for a color picker that did not normalize the color space (as in the figures that follow).

Post reply on HN