title: Render Points in HSV color space instead of RGB with OpenGL
body: <p>I'm currently trying to render my points with the HSV color space. To do this, I use a function in my fragment shader, with produces the correct conversion vector.
  Now my question is how to tell OpenGL that it should interpret this vector as an HSV color instead of an RGB color.</p>
  
  <p>My fragment shader looks like this:</p>
  
  <pre><code> const GLchar *fragment_shader2 =
   "#version 330\n"
   ""
   "/* Output Variables */"
   "out vec4 out_color;"
   ""
   "/* Function Prototypes */"
   "vec3 convertRGBtoHSV(vec3 rgbColorVector);"
   ""
   "void main()"
   "{"
   "  vec3 rgbColor = vec3(1.0, 0.0, 0.55);"
   "  "
   "  out_color = vec4(convertRGBtoHSV(rgbColor), 1.0);"
   "}"
   ""
   "vec3 convertRGBtoHSV(vec3 rgbColorVector)"
   "{"
   "  vec3 hsvColorVector = vec3(0.0, 0.0, 0.0);"
   "  float maxValue = max(rgbColorVector.r, max(rgbColorVector.g, rgbColorVector.b));"
   "  float minValue = min(rgbColorVector.r, min(rgbColorVector.g, rgbColorVector.b));"
   "  "
   "  /* Set Value */"
   "  hsvColorVector[2] = maxValue;"
   "  "
   "  /* Set Saturation */"
   "  if(maxValue != 0.0)"
   "  {"
   "      hsvColorVector[1] = (maxValue - minValue) / maxValue;"
   "  }"
   "  "
   "  /* Set Hue */"
   "  float hue = 0.0;"
   "  if(maxValue == rgbColorVector.r)"
   "  {"
   "      hue = (0.0 + (rgbColorVector.g - rgbColorVector.b) / (maxValue - minValue)) * 60.0;"
   "  }"
   "  else if(maxValue == rgbColorVector.g)"
   "  {"
   "      hue = (2.0 + (rgbColorVector.b - rgbColorVector.r) / (maxValue - minValue)) * 60.0;"
   "  }"
   "  else if(maxValue == rgbColorVector.b)"
   "  {"
   "      hue = (4.0 + (rgbColorVector.r - rgbColorVector.g) / (maxValue - minValue)) * 60.0;"
   "  }"
   "  "
   "  if(hue &lt; 0.0)"
   "  {"
   "      hue = hue + 360.0;"
   "  }"
   "  "
   "  hsvColorVector[0] = hue / 360.0;"
   "  "
   "  /* Return converted color vector */"
   "  return hsvColorVector;"
   "}"
   "\0";
  </code></pre>
  
  <p>In this example, the output is vec3(0.908, 1.0, 1.0) which is displayed as white instead of pink.</p>