title: OpenGL gradient for a rectangle doesn't work
body: <p>I've created an OpenGL app with Qt to visualise a vector field of a magnetic field. The vector field is visualised through arrows with a colour code indicating their value. The problem now is that I want to make a key for the vector field map, indicating what value the highest and lowest colours values, so for example, red is 10 nT, and green is 0.1 nT.</p>
  
  <p>The scaling of colurs is done (through HSV colouring, thanks to Qt, made life easier), but I still need to create a reqtangle on the top right corner with a gradient to use it as a key for the plot I'm doing.</p>
  
  <p>I used the code from:</p>
  
  <p><a href="http://en.wikibooks.org/wiki/OpenGL_Programming/Basics/Color" rel="nofollow">http://en.wikibooks.org/wiki/OpenGL_Programming/Basics/Color</a></p>
  
  <p>as follows:</p>
  
  <pre><code>    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
      glBegin(GL_QUADS);
      glColor3d(simulationSettings-&gt;hotColour.redF(), simulationSettings-&gt;hotColour.greenF(), simulationSettings-&gt;hotColour.blueF());
      glVertex2d(-0.75, 0.75);
      glColor3d(simulationSettings-&gt;coldColour.redF(), simulationSettings-&gt;coldColour.greenF(), simulationSettings-&gt;coldColour.blueF());
      glVertex2d(-0.75, -0.75);
      glColor3d(simulationSettings-&gt;coldColour.redF(), simulationSettings-&gt;coldColour.greenF(), simulationSettings-&gt;coldColour.blueF());
      glVertex2d(0.75, -0.75);
      glColor3d(simulationSettings-&gt;hotColour.redF(), simulationSettings-&gt;hotColour.greenF(), simulationSettings-&gt;hotColour.blueF());
      glVertex2d(0.75, 0.75);
      glEnd();
  </code></pre>
  
  <p>but it didn't work. I even tried to copy the code as it's, and all I get is a yellow square in the middle of the screen.</p>
  
  <p>What do I have to change in my OpenGL configuration to enable colour gradients?</p>