openGL Color Gradient with exponential behavior?

Hello people!

I had this doubt while I was drawing a few GL_QUADS with a color gradient. I know that if I use something like the following I get a quad with a linear gradient from white to black.

    glColor3f( 1.0f, 1.0f, 1.0f);  
    glVertex2f(    0,    0);  
    glVertex2f( 100,    0);  
    glColor3f( 0.0f, 0.0f, 0.0f);  
    glVertex2f( 100, 100);  
    glVertex2f(    0, 100);  

What I wanted to know is how can I make the gradient be expontential? The idea being that the 50% grey is NOT in the middle of the QUAD but somewhere else according to a defined formula.
Since openGL does the gradient by itself I had to ask!


I don’t think there is a way to change the way openGL interpolates values across vertices. What you could do though, is add more vertices with varying colors in between the vertices you have right now.

Thanks daanvanhasselt! =D
I’ll have to find another way of doing it then.