   My almost good idea (SDL)
  I was starting work on a 2d strategy game, it would be my first SDL project. The first thing I decided to do was make sprites for the game. I decided that I would make a sprite grey and then allow the user to choose the color. when the user chooses a color the program would then put a transparent box of that color over the image there by changing the image's color. I thought it was a good idea at the time but there was a small flaw in my plan. I thought that after I put the transparent box over the image the two would blend and the whitespace in the original sprite would be purely the transparent color. then I could filter out the whitespace. (for instance if the color chosen was green, whitespace would be 0,255,0 while the rest would be a mix between green and grey Then i could use SDL_SetColorKey() to get rid of the pure green.) The problem was that SDL_SetColorKey didnt get rid of just the whitespace color, it got rid of all the green leaving me with the grey image only. I figure this happened because the image and the color box never truly combined. Is there another way to do what im trieng to do or will I have to color the sprites myself?   
  Are you sure you're blitting the transparent image properly? Post some code, that might help us out.I think your idea may be a bit flawed, anyway. I don't think a transparent green overlay will make solid green when combined with the whitespace in your sprite. You'll probably have to get the color from a pixel that you know is white space and use that value for your color key.   ;  Since memory is so large (with respect to a sprite's size) why can't you just create a copy of the sprite that replaces the grey with the chosen color manually (loop over every pixel and replace as needed)? Then just use colorkey for the actual transparent aspects of the sprite.   ;  This can easily be done in opengl with blending and it's autmomatically done for you, not so simple in sdl.You'll have to manually scan the image and add the transparancy yourself.  This isn't really that hard though.    Draw your guy to a surface, use a getpixel function to get the value for the colour and then just draw directly over that with the calculated final colour with an alpha green value overlay with putpixel if it's not a background image.  Take care to test to make sure it's not a background pixel when you do this.  Then store the surface as your finished sprite.  I don't want to hazard a guess at the exact method of doing transparancy overlays without somehow to test and be 100%, but it's not hard, I've done it before without reference.Just keep in mind some sort of alpha value.Now, all of this said, someone else might have a better solution.  If not, then this should work.good luck.*Edit: Getpixel/Putpixel functions;  I did a similar thing on a DirectX game I was working on. My process was (i think, it was a while):Have a surface containg your uncoloured main sprite imageCreate another surface that is just the new colour you want to colour your original withSet the colour key of the first image to be that of the area you want to change (in my program different areas of the image had different colours so I could colour them differently)Blt the main image onto your new surface. The new surface should now contain the original image except for the area that is the same as the colour key which should now have the new colour.You can repeat this for each different area of your image you want to colour.I think this process is slightly different to yours in that in mine you blt the main onto the new, where as yours seems to be the other way round.I believe this method is quicker than manually changing the pixels. Plus it avoids all the issues with different colour formats and varying pitches of the surface, amongst other things.   