code: def make_filled_array(shp, dtype, order, r, g, b, a):
      
      # TODO: can we make this more efficient?
      maxv = np.iinfo(dtype).max
      bgval = dict(A=int(maxv * a), R=int(maxv * r), G=int(maxv * g),
                   B=int(maxv * b))
      bgtup = tuple([bgval[order[i]] for i in range(len(order))])
      if dtype is np.uint8 and len(bgtup) == 4:
          # optimiztion when dealing with 32-bit RGBA arrays
          fill_val = np.array(bgtup, dtype=dtype).view(np.uint32)
          rgba = np.zeros(shp, dtype=dtype)
          rgba_i = rgba.view(np.uint32)
          rgba_i[:] = fill_val
          return rgba
      return np.full(shp, bgtup, dtype=dtype)
docs: Return a filled array with a color value. order defines the color
      planes in the array.  (r, g, b, a) are expected to be in the range
      0..1 and are scaled to the appropriate values.
  
      shp can define a 2D or 3D array.