title: Color interpolation in Fragment Shader GLSL?
body: <p>I need to map a scalar value to color that ranges 0 to 1. It will go from GREEN to RED (from 0 to 1) Linear Interpolation using the texture co-ordinates (also ranges from 0 to 1)</p>
  
  <p>I'm new to OpenGL and GLSL, so far I have figured out that I need to write color value in </p>
  
  <pre><code>gl_FragColor
  </code></pre>
  
  <p>which is a vector of dimension 4. I'm not sure how I can calculate the R, G and B channels for gl_FragColor just by one scalar value that ranges for 0 to 1.0 (It will from GREEN to RED and at 0.5 it will be WHITE)</p>