title: Draw with custom color without allocation with Xlib
body: <p>I wrote an X "screen driver" for a graphics toolkit project I am working on. My toolkit, as the last step, calls Xlib functions that draw relevant data to screen. </p>
  
  <p>The problem is that, in my toolkit, colors are represented and passed around as 32bit long integers. All the documentation I have read about Xlib resorts to using XAllocColor to define each color in a Colormap. </p>
  
  <p>The problem is, XAllocColor is fairly <em>slow</em> compared to my graphics routine and I'd like to avoid alloc'ing each single color used (also because I do not have a list upfront).</p>
  
  <p>How can I draw something in arbitrary colors in Xlib without alloc'ing each and everyone of them?</p>