Lighting and material problems

My objects colors doesn’t take affect.

This is my init function (the part of the light and material):


glEnable (GL_LIGHTING);
glEnable (GL_LIGHT0);
GLfloat light_ambient[] = {0.5, 0.5, 0.5, 1.0};
GLfloat light_diffuse[] = {0.0, 0.5, 0.5, 1.0};
GLfloat light_specular[] = {0.0, 0.0, 0.5, 1.0}; 
GLfloat light_position[]={0, -1.0, 0, 0.0};
glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);
glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular);
glLightfv(GL_LIGHT0, GL_POSITION, light_position);

//Tried enabling GL_COLOR_MATERIAL here. Didn't work

Each object has a vector of colors. This is how I draw my objects:


float mat_a[] = {0.0, 0.0, 0.0, 1.0};
float mat_d[] = {0.0, 0.0, 0.0, 1.0};
float mat_s[] = {0.0, 0.0, 0.0, 1.0};
...
colors_vect = some_object->getColor();
glDisable(GL_COLOR_MATERIAL);
mat_a[0] = colors_vect.at(0);
mat_a[1] = colors_vect.at(1);
mat_a[2] = colors_vect.at(2);
mat_d[0] = colors_vect.at(3);     //The values are correct.
mat_d[1] = colors_vect.at(4);
mat_d[2] = colors_vect.at(5);
mat_s[0] = colors_vect.at(6);
mat_s[1] = colors_vect.at(7);
mat_s[2] = colors_vect.at(8);
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, mat_a);
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat_d);
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_s);
glEnable(GL_COLOR_MATERIAL);

glBegin(GL_POLYGON);
...

This code doesn’t work. I tried to give the mat some random values and still nothing changes.
What am I doing wrong? Any help would be appreciated!