parameters: (bits, w, h, colour)
return_statement: return wx.BitmapFromImage(img)
docstring: A utility function that creates a masked bitmap from raw bits (XBM format).
  
      :param string `bits`: the raw bits of the bitmap;
      :param integer `w`: the bitmap width;
      :param integer `h`: the bitmap height;
      :param Colour `colour`: the colour which will replace all white pixels in the
       raw bitmap.
docstring_summary: A utility function that creates a masked bitmap from raw bits (XBM format).
docstring_tokens: A utility function that creates a masked bitmap from raw bits ( XBM format ) .
function: def BitmapFromBits(bits, w, h, colour):
      """
      A utility function that creates a masked bitmap from raw bits (XBM format).
  
      :param string `bits`: the raw bits of the bitmap;
      :param integer `w`: the bitmap width;
      :param integer `h`: the bitmap height;
      :param Colour `colour`: the colour which will replace all white pixels in the
       raw bitmap.
      """
  
      img = wx.BitmapFromBits(bits, w, h).ConvertToImage()
      img.Replace(0, 0, 0, 123, 123, 123)
      img.Replace(255, 255, 255, colour.Red(), colour.Green(), colour.Blue())
      img.SetMaskColour(123, 123, 123)
      return wx.BitmapFromImage(img)
function_tokens: def BitmapFromBits ( bits , w , h , colour ) : img = wx . BitmapFromBits ( bits , w , h ) . ConvertToImage ( ) img . Replace ( 0 , 0 , 0 , 123 , 123 , 123 ) img . Replace ( 255 , 255 , 255 , colour . Red ( ) , colour . Green ( ) , colour . Blue ( ) ) img . SetMaskColour ( 123 , 123 , 123 ) return wx . BitmapFromImage ( img )