code: def alpha_cmap(color, name="", alpha_min=0.5, alpha_max=1.0):
      """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.
  
      name : string, default=''
          Name of the colormap.
  
      alpha_min : Float, default=0.5
          Minimum value for alpha.
  
      alpha_max : Float, default=1.0
          Maximum value for alpha.
  
      """
      red, green, blue = _colors.colorConverter.to_rgb(color)
      if name == "" and hasattr(color, "startswith"):
          name = color
      cmapspec = [(red, green, blue, 1.0), (red, green, blue, 1.0)]
      cmap = _colors.LinearSegmentedColormap.from_list(
          f"{name}_transparent", cmapspec, _rcParams["image.lut"]
      )
      cmap._init()
      cmap._lut[:, -1] = _np.linspace(
          alpha_min, alpha_max, cmap._lut.shape[0]
      )
      cmap._lut[-1, -1] = 0
      return cmap
  
file_path: nilearn/nilearn/plotting/cm.py
imports: import numpy
  from matplotlib import cm, colors, rcParams
label_desc: Use image node_id 5 for calling a global function with example usage: alpha_cmap(color, name, alpha_min, alpha_max) and returns: cmap