Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HSLuv seems to have too much cyan to me/hues don't seem subjectively equally spread #41

Open
calebegg opened this issue Nov 9, 2017 · 4 comments

Comments

@calebegg
Copy link

calebegg commented Nov 9, 2017

Looking at this example from the site:

screen shot 2017-11-08 at 10 41 54 pm

If I were going to name these colors, I'd probably go: red, orange, yellow, green/chartreuse, green/cyan, cyan, cyan, blue, violet/lavender, magenta.

In other words, the 5th, 6th, and 7th all look very similar to me. Staring at them, I almost have trouble distinguishing their bars. This isn't the case for the other colors in the spectrum. Especially for the last three, I can see sharp, clearly distinguished colors.

This isn't just on the example page either; I've used HSLuv in projects, and noticed that it's harder to distinguish values in that range before.

Is this something subjective and I'm just observing it differently? Is this an artifact of CIELUV? An artifact of monitor color limitations? Or a problem with HSLuv?

Sorry if this is naive; I know very little about color theory besides what I've read about online over the years. But it's always bothered me.

Thanks!

@boronine
Copy link
Member

Hi Caleb. Thanks for using HSLuv in projects 👍 I've noticed this too. I don't believe this is a problem with HSLuv's reproduction of CIELUV or an issue with monitors.

My hypothesis is the following. Notice how for L < 75%, cyan has the lowest maximum chroma. Now, consider that the perceptual distance between colors is greatest at high saturation and is lowered as saturation is lowered (blue and yellow are identical with saturation = 0%). This dip in saturation lowers the perceptual distance between colors around cyan. If you move the lightness slider to around 85%, you'll notice the same issue with pink/salmon, for the same reason.

This is one of many artifacts that is created by HSLuv's imperfect saturation component. I think getting rid of these artifacts entirely is impossible due to the nature of human color vision (as you must know by now, colors are not created equal), however, it may be possible to ameliorate them. I welcome any attempts to do so!

@calebegg
Copy link
Author

calebegg commented Dec 6, 2017

Aha, that makes a lot of sense now that I play with the color picker on the site some. Around a lightness of 40%, there are sharp divisions in the blue area, corresponding with its high chroma.

It almost feels like the right thing to do is not to map hue by angle, but by perimeter of the max-chroma quadrilateral.

@meta-meta
Copy link

meta-meta commented Feb 27, 2023

but by perimeter of the max-chroma quadrilateral

Is there a way to do that with the current API?

@unphased
Copy link

unphased commented Mar 22, 2024

This is the biggest problem I see with this otherwise great color space.

  • It looks like mapping by perimeter would be an improvement in this but there may be difficult to foresee issues with the same hue value no longer staying put perceptually since it seems like the quadrilateral does some kind of complex wibbly wobble through lightness. Would be really cool to try but I have doubts. I will note, even if this may cause hue not to stay constant, many users such as myself may never care about hue in this way and just want even hue spacing...
  • I had a question I wonder if anyone knows the answer to. In the interactive picker on the site an inscribed inner circle is shown. I want to say that limiting the saturation max to the limit of this inscribed circle is what the HPLuv does but I am not sure since it does not say. this might improve the problem but by trading it for another which is a very hard limit on perceived saturation. That tradeoff does not seem like it would ever be worthwhile.

I'm tempted to just try to define some sort of warping adjustments to hue under various combination values of lightness and tweak until the changes seem right, but this seems highly unprincipled.

Edit: I have found that browsers already implement OKLCH color space. I have more experimentation to do esp around finding if there are similar problems with this one, but it certainly does look like the future to me, and this palette maker looks useful too: https://huetone.ardov.me

I will note that OKLCH while providing an HSL-like interface much like HSLuv does, it does NOT guarantee workable colors for your given display out of all possible inputs in the space, which is a big difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants