It returns an int that represents a color. See http://www.programmingsimplified.com/c/graphics.h/colors for more info. Also google getColor for more explanation.
You could use the actual color numbers in your code, or you could add something like
#define RED 4
#define YELLOW 14
at the top of your program (and remove the quotes in the if tests).
HOWEVER, what happens depends on where you got the getColor function. I went back and tried to implement something like what you are doing to see exactly what was happening because it dawned on me that I was SETting colors with strings just like you are trying to get them. It didn't make sense. I did some digging and found another naming inconsistency in the Stanford Public Library that we are using. I couldn't find getColor in the SPL, so I dug deeper.
It turns out that the function does exist, with a different name:
If you change the function name to this, and switch to strcmp() it should work, with the color name in double quotes.
if ( strcmp(getColorGObject(object),"RED") == 0)
btw, I like the concept of points based on color. Nice job.
If this answers your question, please accept this answer to remove the question from the unanswered question pool. Let's keep up on forum housekeeping. ;-)