2009-05-23

Colorful Epiphany

I always thought that the RGB macro (Win32 GDI) which takes three arguments - red, green and blue - will create a 0xRRGGBB value.

I was wrong! Win32 GDI uses BGR colors! d'oh

Here is another assertion on the path of assertiveness (germ. Durchsetzungsvermögen)

#include <windows.h>
#include <assert.h>

int main()
{
     COLORREF color_rgb = 0xBBAADD;
    
     assert(color_rgb == RGB(0xBB, 0xAA, 0xDD));
}

Cheers!
Post a Comment