code: def to_rgba(colors, dtype=np.uint8):
      
      if not util.is_sequence(colors):
          return
  
      # colors as numpy array
      colors = np.asanyarray(colors)
  
      # integer value for opaque alpha given our datatype
      opaque = np.iinfo(dtype).max
  
      if (colors.dtype.kind == 'f' and colors.max() < (1.0 + 1e-8)):
          colors = (colors * opaque).astype(dtype)
      elif (colors.max() <= opaque):
          colors = colors.astype(dtype)
      else:
          raise ValueError('colors non- convertible!')
  
      if util.is_shape(colors, (-1, 3)):
          # add an opaque alpha for RGB colors
          colors = np.column_stack((
              colors,
              opaque * np.ones(len(colors)))).astype(dtype)
      elif util.is_shape(colors, (3,)):
          # if passed a single RGB color add an alpha
          colors = np.append(colors, opaque)
  
      if not (util.is_shape(colors, (4,)) or
              util.is_shape(colors, (-1, 4))):
          raise ValueError('Colors not of appropriate shape!')
  
      return colors
docs: Convert a single or multiple RGB colors to RGBA colors.
  
      Parameters
      ----------
      colors: (n,[3|4]) list of RGB or RGBA colors
  
      Returns
      ----------
      colors: (n,4) list of RGBA colors
              (4,)  single RGBA color