This is what OS X\'s built in color inversion feature can turn your screen into:
>
The way Mac OS does the color inversion is (probably) by using Quartz Display Services to modify the graphics card's gamma table.
Graphics cards have two of these tables to modify color output after composition into the final frame buffer. One of them can be modified by applications to alter the way the screen shows any RGB value.
Here's code to invert the display:
//ApplicationServices includes CoreGraphics
#import
int main(int argc, const char * argv[])
{
CGGammaValue table[] = {1, 0};
CGSetDisplayTransferByTable(CGMainDisplayID(), sizeof(table) / sizeof(table[0]), table, table, table);
sleep(3);
return 0;
}