title: Converting RGB to HLS and back
body: <p>I'm using python's colorsys library to convert RGB color values to HLS. Just to verify, I tried converting back to RGB and got a different value back. I can understand minor differences because of precision issues, but these values are significantly different.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>import colorsys
  r=192
  g=64
  b=1
  
  hlsval = colorsys.rgb_to_hls(r,g,b)
  rgbval=colorsys.hls_to_rgb(hlsval[0],hlsval[1],hlsval[2])
  
  print hlsval, rgbval
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>(0.16666666666666666, 96.5, -1.0) (191.99999999999994, 192.0, 1.0)
  </code></pre>
  
  <p>The green value is off by over 200%</p>
  
  <p>I tried some other values, and every time one of the components is off by a significant amount. Am I missing something?</p>