Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've been studying color theory a long time, including giving talks about color mixing and indeed HSL space specifically for a decade...

I'm with you, there are ways that I think color mixing should be done but I would never say that mine is "right". That's silly, it's art.

I think color mixing should be done using HSI colorspace (luminosity replaced with intensity defined as the sum of all light power outputs) with HS defined as per HSL/HSV and interpolation between any two colors done by a line drawn between the coordinates. The reason for this is that in my applications I use spotlights so obviously "total brightness" is way more important than "display lightness". It's just physics, and no right or wrong about it, it's a different display kind.

This is "correct", the colorspace is explicitly constructed to be used in this way such that each step is perceptually even. But it also isn't necessarily what people want, to me "fade from red to cyan" automatically goes through white because of course it does... but what people usually mean is they want the hue to spin around at fairly constant saturation (ignoring that the direction of rotation matters) because it looks good. Red to orange to yellow to green looks vastly nicer in a gradient than going a direct path through white.

That all said (mostly because I find it bizarre and fascinating even after a lot of study), the arguments in the OP are not about whether a given gradient is objectively right but rather whether they match the spec. Things should match the spec...



Rainbows, where you sweep around the hue circle, have plenty of room for artistic license. The basic problem is that you can’t make a blue anywhere near as bright as the brightest yellow you can make. If you try to maximize brightness some parts are darker and some brighter in a way that is meaningless, particularly for scientific visualization. If you keep the brightness constant, however, it never gets very bright and is unsatisfying that way.

I like Rainbow Dash’s tail in My little pony because the artist chose to let the brightness vary but did it deliberately so it is meaningful in color and B&W.


I think you're talking about the effect where "secondary colors" made by mixing, say, R and G together have a maximum brightness (or I called it I for intensity) that is twice as high as that of pure R because twice as many LEDs are on.

This is the main reason I like it for my spotlights, it's way weirder if the apparent brightness of the spot changed as it went through a rainbow at fixed saturation (or from unsaturated to fully saturated even). Instead, I make it so that for secondary colors each individual emitter is half as bright by keeping the sum(R,G,B) constant (if it's RGB) as one of the main parameters. It's a tradeoff, it definitely only gets half as bright for the secondary colors. I think this is for the best in practice, otherwise white would be thrice as bright again, the software limit makes more sense to me than bouncing spot brightnesses.

For computer display colors, I don't think I am an expert enough to speak to it. I know about spotlight color schemes because that's what I build =)


But it isn't that simple, isn't it - what about the Helmholtz–Kohlrausch effect, most pronounced in spectral lights, that breaks the color additivity of trichromatic theory ?

http://www.handprint.com/HP/WCL/color2.html#combocolor

But he's just probably talking about how "green-yellow" wavelenghts contribute much more to lightness perception ?

http://www.handprint.com/HP/WCL/color3.html#optimalstimuli

http://www.handprint.com/HP/WCL/color11.html#valchrom


Yes, I agree it is bizarre and fascinating and everything you said about traveling in various colour spaces:)

Also agree "should match spec" is always a valid argument.

To repeat, and be clear, my critique was about what the page says "Physically correct color gradients..". This should have been "according to spec you should compute a gradient this way, and this is what your browser does...".


What's the best way to learn color theory? Like actually, properly learn it? I consider my interest in TV/Movies to cross over into the enthusiast category, and I work with medical images and video (compression mostly). I've spent time with the basics, and have recently started reading about BT 709 etc., but am unsure how best to really dive-in to color theory headfirst


If you give up your RGB sliders for HSV sliders you’ve taken a big step.

Value (bright vs dark) is more important than anything else. If you were picking foreground and background colors for text whether or not it is readable depends on the difference in values, not the hues.

Any image should be meaningful if seen in black and white, not just for color blind individuals but for normal sighted individuals too. The Ansel Adams zone system is good for thinking about this, even for non-photographic images. He identifies 11 major bands of value which are about as many shades as you are going to get in a bad print or viewing environment, say with a thermal printer or newsprint.

In a top quality print and viewing environment however each of those zones except the most extreme is able to show meaningful detail. Of course an image can choose to not use certain zones but generically I’d say the ideal image looks good under bad circumstances but under good circumstances it has something to delight the eye in all the zones. (Reference art from Pokémon often has well-thought out uses of value because it has to play across various media.)


I think a huge first step for me didn't require any textbooks, but simply manually calculating the CIE coordinates based on the actual light spectrum. There are some really good articles online at this point, but I think everyone should probably just do this once. The wikipedia articles on colorspace are pretty darn good, albeit spread over way too many pages...

I feel like if you can do that math you understand a ton. Including why red and blue mixed is purple =) The integrals you need are at the bottom.

https://en.wikipedia.org/wiki/CIE_1931_color_space


Two other super helpful mental experiments --

- Why is there a "white locus"? How much does my hue shift under different color temperatures (ignoring CRI, which I suggest you do for now)

- With what math can I reproduce a color using three other colors in combination?


The other commenters shared some seriously great stuff, but as a Math major, you have my personal thanks for informing me that there were integrals I could solve.


Fair, coming from a physics/chemistry/biology background seeing the connection between the spectrum of light being seen and the color you convert it to was really enlightening. I knew it had to do with phosphors, but the science is fairly understandable.

The chemicals that pick up light respond to different wavelengths differently. However, if they get excited, they are a [1] (as far as I think we understand). So a single phosphor can't tell anything about the wavelength other than a probability distribution.

Then you take three probability distributions and identify a single unique color in our heads for it. And that's why every color-space ultimately has three parameters, it's all just different projections and mappings but physically there's really just a spatially isolated signal that tells you which of three phosphors were hit and how much, and then a ratio to downsample it to a perceptual color.

And then you look at the overlap and see how for wavelengths you see as blue, the "blue" phosphor is only about as active as the "green" phosphor (which are confusing misnomers anyway) but your brain sees both being active equally as "blue". And then that "red" secondary hump gets hit when the wavelength moves from blue towards violet -- activating the "red" phosphor and making vision into a wheel.

It was always one of those "this is obvious until I think about it" moments when I wondered why 400nm and 700nm aren't ends of a spectrum in our vision rather than a wheel, there's no obvious theoretical reason for it I think. It's just a possibly pure coincidence of that "red" phosphor having a second hump.

It's nice to do the conversion for real a few times with example colors or black body radiation. Seeing how this works a little closely makes a bunch of stuff like imaginary colors make sense biologically with saturating certain phosphors.


This is the best free resource that I'm aware of :

http://www.handprint.com/LS/CVS/color.html




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: