The color of the shadow does not depend on the color of the object casting the shadow, but rather is determined by the surface the shadow falls on. The shadow's contrast depends primarily on the ambient light in the scene.
To draw the shadow we typically disable lighting calculations and set the color with a command like glColor4f(0.0,0.0,0.0,0.5) where the alpha value is some number less than 1.
Blending must be enabled with glEnable(GL_BLEND) and a common setting for the blending parameter is done with glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA).