code: def alpha_cmap(color, name=""):
      """Return a colormap with the given color, and alpha going from
      zero to 1.
  
      Parameters
      ----------
      color: (r, g, b), or a string
          A triplet of floats ranging from 0 to 1, or a matplotlib
          color string
      """
      red, green, blue = _colors.colorConverter.to_rgb(color)
      if name == "" and hasattr(color, "startswith"):
          name = color
      cmapspec = [
          (red, green, blue, 0.0),
          (red, green, blue, 1.0),
      ]
      cmap = _colors.LinearSegmentedColormap.from_list(
          f"{name}_transparent", cmapspec, _rc["image.lut"]
      )
      cmap._init()
      cmap._lut[:, -1] = _np.linspace(0.5, 1.0, cmap._lut.shape[0])
      cmap._lut[-1, -1] = 0
      return cmap
  
file_path: nipy/nipy/labs/viz_tools/cm.py
imports: import numpy
  from matplotlib import cm
  from matplotlib import colors
  from matplotlib import rcParams
label_desc: Use image node_id 4 for calling a global function with example usage: alpha_cmap(color, name) and returns: cmap