Comparing colors

I just started making a game with SDL and now I have various problems:

Here’s the story:

I have a screen-surface that containes an image. (flags SWSURFACE, DOUBLEBUF)

I load a 32bit-Targa-image into another surface. This surface is not blittet,
thus not shown on my screen. When clicking into the picture in my running
SDLapp window I need to get the RGB-values from the pixel at the position I
clicked at - in the “invisible” surface. These RGB-values must be compared to
RGB-values that are stored inside a class object to switch a bool to either
true or false.

The click-event and the surfaces work well. But I just don’t get the colors
compared. I loaded a gray .tga into my “invisible” surface (values: 128, 128,
128). The class contains the Uint8 values, each set to 128. I want to read the
RGB-values from the pixel with SDL_GetRGB but comparing the r,g,b-values
doesn’t work. I even tried storing the values from either the pixel and the
class object inside a SDL_Color and comparing these two colors but that won’t
work neither.

Any help is appreciated.

Thanks in advance.

OS is Windows XP, Tool used is Visual Studio C++ Express