Hacker News new | ask | show | jobs
by boronine 4449 days ago
Does the algorithm use HSL as its color space? I've seen many online palette tools that use HSL color wheels for picking colors. It never made sense to me why they wouldn't use a perceptually uniform color space like CIELUV. I actually made a color space derived from CIELUV specifically for the task of picking colors [1]. I never wrote a 'proper' palette generator using it, but I did make a demo that works pretty well [2]. Considering that you're actually studying this, I would be curious to know what you think.

[1] http://www.boronine.com/husl/

[2] http://www.boronine.com/husl/syntax/

4 comments

Thank you for creating HUSL! I discovered it as I was midway through my project. I am very glad that this exists! I agree, CIELUV or CIELAB would probably be a better fit. As I mention in my comment above, it wasn't immediately clear to me how I would generate a palette using the space given the holes, especially since I allow the user to choose any color they want.

I am curious, how would you approach generating a palette using these color spaces?

Thanks :)

> how would you approach generating a palette using these color spaces?

This is exactly the problem I was trying to solve in creating HUSL.

You can think of HUSL as a version of CIELUV (Or, more specifically CIELCHuv, the cylindrical transformation of CIELUV) that is stretched vertically to fill in the 'holes'. HUSLp, the pastel version, is similar, but instead of stretching, it cuts the saturated colors off. (You can switch between them in the demo).

In fact, those stretching and cutting functions are the only thing that HUSL really does, the rest is all CIE math :P

I just checked out HUSL, that's amazing. The syntax demo is really cool. The colour schemes it generates are much more visible and pleasant to the eye (my eye, at least) than Solarized.

Disclaimer: I'm slightly colour-blind - take with a pinch of salt :-)

HUSL is awesome. Wrote a library last year that uses it: https://github.com/nluqo/autumn
I like it but isn't blue under represented?
It could be. The only new component that HUSL defines is saturation (it's a distorted version of CIELCHuv's chroma). Both hue and lightness are exactly like CIE defined them after doing actual empirical research on color vision.

So while the hue component isn't perfectly perceptually uniform, there is no way I could improve it without doing an actual study.