The unbearable brightness of color

Have you been using color more, and enjoying it less?

Maybe your colors are too bright, or maybe you just need more contrast. Or maybe you have the problem that I had, which was to programmatically decide whether foreground text should be white or black, based on the background color.

From the Ndb-tech link above, here is a way to calculate the perceived brightness of an RGB color value:

Perceived brightness as a function of Red, Green, and Blue values

It would be interesting to compare this to the relative luminance Y:

Relative luminance as a function of Red, Green, and Blue values