Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Completely Painless Programmer's Guide to XYZ, RGB, ICC, XyY, and TRCs (ninedegreesbelow.com)
68 points by nkurz on Sept 19, 2015 | hide | past | favorite | 13 comments


For the merely curious, my recommendation is that you carefully not learn about this stuff unless you need it for something.

I built an automated lighting system for my house using Hue bulbs. I wanted to have more "natural" light throughout the day. Ignoring a warning from a friend ("It's as bad as knowing about kerning," he said), I learned a fair bit about color, including the very mutable and slippery concept of "white".

I like my automated lighting system just fine, but the downside is that I now notice color temperature of lightbulbs. It's as annoying; things that were previously fine are now the sources of enduring irritation. So now I'm the apparently crazy person at work who unscrews lightbulbs and moves them around my work area because somebody has randomly scattered very-warm-white and very-cool-white bulbs around the place with no attention to aesthetics or utility.

I was honestly happier not knowing. There are some things you can't unsee, and color temperature is one of them. I'm glad I could stop before I understood how bad the color representation is on my various screens.


Funny, but completely irrelevant if you are serious. Do you know the adage: the less you know, the better you sleep? Sure you do. Do you use it? I don't.


I'm mostly kidding here, but I think there are plenty of things that people are generally better off not knowing the details of. As the Internet explains, some things cannot be unseen:

http://knowyourmeme.com/memes/what-has-been-seen-cannot-be-u...

The benefit of blissful ignorance is what is purposefully ruined by the various shock sites:

http://knowyourmeme.com/memes/shock-sites

And I think it applies more than just images; I think it's true for facts as well. Imagine that you visit your parents for a week and every day at breakfast they tell you in detail about their previous night's sexual activities. Are you happier knowing? Will you chime in with tips?

Or for me, as someone living in California, I have a number of friends and acquaintances with various religious and spiritual beliefs. I generally don't want to know the details. At best, I'm going to be deeply uncomfortable as I struggle very seriously to keep a polite and neutral face. At worst, I will say what I really think, deeply offend them, and lose a friend. I'd just rather not know.

Returning to the office light bulbs, I think my sensitivity to details and my irritability about things being "wrong" is part of what makes me good at what I do. But I can't just switch it off for particular domains; when things are "wrong", I want to fix them. For years I was totally ignorant of the color temperature of lighting and my life was fine that way. I can't unsee it now.


I also stuck my nose down this rabbits hole about a year ago, while writing a blog post about TextMate color themes [1] (TL;DR: Some older TextMate color themes were made on the Mac when it was using Generic RGB and a gamma value of 1.8, and converting those themes directly to other editors can result in slightly off colors, because they likely assume RGB values to be sRGB with a gamma close to 2.2).

It is fascinating to learn about, but it feels a bit like you could always go deeper. I stopped when I got to the different methods for gamut mapping.

[1] http://www.hardtoc.com/archives/310


You should try f.lux [1], it will drive you up a wall.

[1]: https://justgetflux.com/


Redshift does the same thing (supports Windows and X11), no idea what the difference is. Apparently at the time redshift was created 6 years ago f.lux didn't work properly on GNU/Linux. http://jonls.dk/redshift/


Redshift is free (libre) software and fl.ux is "patent pending".


Heh. I'm actually a happy Redshift user on my laptops; ditto Twilight on my Android devices. I suppose because I'm more obsessive about good sleep than screen color representation. Indeed, my automated lighting system is basically f.lux for one's house:

https://github.com/wpietri/sunrise


This description is not painless. It gets into the technical weeds before giving a good big-picture overview, which in my experience trying to teach the basics of human vision and color science usually makes people fall asleep or start walking away before they learn much. In this particular case, the technical pieces are also a very narrow and decontextualized, which as curriculum always results in severe misconceptions. This is a subject that desperately needs to be taught with many diagrams and pictures, and absolutely must begin with a basic explanation of how eyes work. Just linking to Wikipedia doesn’t cut it, as unfortunately the relevant articles on Wikipedia aren’t very good.

Unfortunately there aren’t any especially good concise explanations of color science on the internet to link to.

These SIGGRAPH 2001 notes are okay but leave a lot out and don’t include enough pictures: https://graphics.stanford.edu/courses/cs448b-02-spring/04cdr...

The best online resource I know is http://www.handprint.com/LS/CVS/color.html but it’s very long and kind of rambling.

Some layman-friendly answers to various color science questions can be found at https://www.rit.edu/cos/colorscience/rc_faq_all.php

But really, books are better. There are a number of decent ones, e.g. http://amzn.com/047119459X or http://amzn.com/0470024259 or http://amzn.com/1118173848 or http://amzn.com/1568811616/ or the first half of http://amzn.com/1119967031


I agree wholeheartedly. It goes from 'wavelength' to 'chromaticity and intensity' to 'three dimensional cartesian coordinates' without explanation. The 'color in one paragraph' paragraph would be incomprehensible if you didn't already know all the missing steps, I felt.

And the need for diagrams: amen.


There’s always the classic “Color space FAQ”:

http://www.poynton.com/ColorFAQ.html


Relatedly: HSL and HSV's concept of brightness does not match that of the human eye. HSL blue at 0.5 lightness is darker than HSL red at 0.5


Well, now I need to recalibrate my monitors, except this time I will know what I am doing. Thanks for the great article.




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: