title: HSV to RGB paint
body: <p>I want to paint that: </p>
  
  <p>hsv</p>
  
  <p><img src="https://i.stack.imgur.com/x7EEq.png" alt=""></p>
  
  <p>I already wrote that code. I used that site to write hsvtorgb method: <a href="http://www.rapidtables.com/convert/color/hsv-to-rgb.htm" rel="nofollow noreferrer">http://www.rapidtables.com/convert/color/hsv-to-rgb.htm</a> Unfortunatelly my code doesn't show what i want. Can you tell me why? Thanks a lot!
  I am waiting for answers</p>
  
  <pre><code>void Widget::hsvtorgb(int h, float s, float v)
  {
  float C, X, m;
  float r, g, b;
  C = v * s;
  X = C*(1 - abs(((h/60) % 2) - 1));
  m = v - C;
  if(h&gt;=0 &amp;&amp; h&lt;60){r = C; g = X; b = 0;}
  if(h&gt;=60 &amp;&amp; h&lt;120){r = X; g = C; b = 0;}
  if(h&gt;=120 &amp;&amp; h&lt;180){r = 0; g = C; b = X;}
  if(h&gt;=180 &amp;&amp; h&lt;240){r = 0; g = X; b = C;}
  if(h&gt;=240 &amp;&amp; h&lt;300){r = X; g = 0; b = C;}
  if(h&gt;=300 &amp;&amp; h&lt;360){r = C; g = 0; b = X;}
  
  R = (r + m) * 255;
  G = (g + m) * 255;
  B = (b + m) * 255;
  }
  
  void Widget::on_H_slider_valueChanged(int value)
  {
  h=value;
  for(int i=0; i&lt;600; i++)
  {
      for(int j=0; j&lt;600; j++)
      {
          hsvtorgb(1.0*j/600, 1.0*i/600, v);
          bits[600*4*i+4*j] = B;
          bits[600*4*i+4*j+1] = G;
          bits[600*4*i+4*j+2] = R;
      }
  }
  update();
  }
  
  void Widget::on_S_slider_valueChanged(int value)
  {
  s=value/100;
  for(int i=0; i&lt;600; i++)
  {
      for(int j=0; j&lt;600; j++)
      {
          hsvtorgb(h, s, v);
          bits[600*4*i+4*j] = B;
          bits[600*4*i+4*j+1] = G;
          bits[600*4*i+4*j+2] = R;
      }
  }
  update();
  }
  
  void Widget::on_V_slider_valueChanged(int value)
  {
  v=value/100;
  for(int i=0; i&lt;600; i++)
  {
      for(int j=0; j&lt;600; j++)
      {
          hsvtorgb(h, s, v);
          bits[600*4*i+4*j] = B;
          bits[600*4*i+4*j+1] = G;
          bits[600*4*i+4*j+2] = R;
      }
  }
  update();
  }
  </code></pre>