Lighting with OpenGL

I am working with some lighting programming in OpenGL. I have a red sphere. Now when I make the diffuse light green, the sphere should look black, but I find the sphere looks still red. How can that be fixed? Please provide some suggestion.

In old OpenGL, there is a setting called GL_LIGHT_MODEL_AMBIENT which is by default 0.2, 0.2, 0.2, 1.0.
You can set it to zero if you want with glLightModel.

I have done it by setting the diffuse material component to green and diffuse color to red. The object looks black. Is it ok?