SDL_SetSurfaceColorMod() and transparency issues


I’m having an issue trying to figure out how to apply SDL_SetSurfaceColorMod() when blitting transparent surfaces. Here’s what I’m doing:

SDL_Surface* backgroundSurface = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000);
SDL_SetSurfaceBlendMode(backgroundSurface, SDL_BLENDMODE_NONE);
SDL_Surface* baseSurface = IMG_Load(“base.png”);
SDL_Surface* hairSurface = IMG_Load(“hair.png”);
SDL_SetSurfaceColorMod(hairSurface, 100, 100, 100);
SDL_BlitSurface(baseSurface, NULL, backgroundSurface, NULL);
SDL_BlitSurface(hairSurface, NULL, backgroundSurface, NULL);
IMG_SavePNG(backgroundSurface, “pic.png”);

[Image: ]

The first image is how the surface is being saved without SDL_SetSurfaceColorMod() being called.
The second image is how the surface is being saved after SDL_SetSurfaceColorMod() has been called.
The third image is how the surface is then converted to a Texture and being rendered on screen.

If I omit the SDL_SetSurfaceBlendMode() even the rendered texture looks the same as the second saved image.

Any ideas what am I doing wrong?

Thank you for your help!------------------------
ePic Character Generator - endless character stream in your games using SDL 2.0: