title: gtk3+ and python rgba convert to hex
body: <p>i using gtk3 i found that it use rgba for representing color, but the <strong>(red,green,blue,alpha)</strong> are not integer between <strong>0-255</strong> but floating point number between <strong>0-1.0</strong>, so i don't know how to convert from rgba to hex and vice-versa</p>
  
  <p>i have tried this code but its seem to not work :</p>
  
  <pre><code>def convert_to_hex(rgba_color) :
  red = str(hex(int(rgba_color.red*255)))[2:].capitalize()
  green = str(hex(int(rgba_color.green*255)))[2:].capitalize()
  blue = str(hex(int(rgba_color.blue*255)))[2:].capitalize()
  
  return '0x' + red + green + blue
  </code></pre>