class_docstr: ColorMap(pos, color, mapping=ColorMap.CLIP)
  
  ColorMap stores a mapping of specific data values to colors, for example:
  
      | 0.0 → black
      | 0.2 → red
      | 0.6 → yellow
      | 1.0 → white
  
  The colors for intermediate values are determined by interpolating between
  the two nearest colors in RGB color space.
  
  A ColorMap object provides access to the interpolated colors by indexing with a float value:
  ``cm[0.5]`` returns a QColor corresponding to the center of ColorMap `cm`.
docstr: Sets the way that values outside of the range 0 to 1 are mapped to colors.
  
  Parameters
  ----------
  mapping: int or str
      Sets mapping mode to
  
      - `ColorMap.CLIP` or 'clip': Values are clipped to the range 0 to 1. ColorMap defaults to this.
      - `ColorMap.REPEAT` or 'repeat': Colors repeat cyclically, i.e. range 1 to 2 repeats the colors for 0 to 1.
      - `ColorMap.MIRROR` or 'mirror': The range 0 to -1 uses same colors (in reverse order) as 0 to 1.
      - `ColorMap.DIVERGING` or 'diverging': Colors are mapped to -1 to 1 such that the central value appears at 0.
docstr_tok: ["Sets","the","way","that","values","outside","of","the","range","0","to","1","are","mapped","to","colors",".","Parameters","--","--","--","--","--","mapping",":","int","or","str","Sets","mapping","mode","to","-","`","ColorMap.CLIP","`","or","'clip","'",":","Values","are","clipped","to","the","range","0","to","1",".","ColorMap","defaults","to","this",".","-","`","ColorMap.REPEAT","`","or","'repeat","'",":","Colors","repeat","cyclically",",","i.e",".","range","1","to","2","repeats","the","colors","for","0","to","1",".","-","`","ColorMap.MIRROR","`","or","'mirror","'",":","The","range","0","to","-1","uses","same","colors","(","in","reverse","order",")","as","0","to","1",".","-","`","ColorMap.DIVERGING","`","or","'diverging","'",":","Colors","are","mapped","to","-1","to","1","such","that","the","central","value","appears","at","0","."]
code: def setMappingMode(self, mapping):
      """
      Sets the way that values outside of the range 0 to 1 are mapped to colors.
  
      Parameters
      ----------
      mapping: int or str
          Sets mapping mode to
  
          - `ColorMap.CLIP` or 'clip': Values are clipped to the range 0 to 1. ColorMap defaults to this.
          - `ColorMap.REPEAT` or 'repeat': Colors repeat cyclically, i.e. range 1 to 2 repeats the colors for 0 to 1.
          - `ColorMap.MIRROR` or 'mirror': The range 0 to -1 uses same colors (in reverse order) as 0 to 1.
          - `ColorMap.DIVERGING` or 'diverging': Colors are mapped to -1 to 1 such that the central value appears at 0.
      """
      if isinstance(mapping, str):
          mapping = self.enumMap[mapping.lower()]
      if mapping in [
          self.CLIP,
          self.REPEAT,
          self.DIVERGING,
          self.MIRROR,
      ]:
          self.mapping_mode = mapping  # only allow defined values
      else:
          raise ValueError(f"Undefined mapping type '{mapping}'")
      self.stopsCache = {}
  
imports: from collections.abc import Callable, Sequence
  from os import listdir, path
  import numpy
  from .functions import clip_array, clip_scalar, colorDistance, eq, mkColor
  from .Qt import QtCore, QtGui
label_desc: Use image node_id 2 for calling the ColorMap obj's underlying member method code with example usage: obj.setMappingMode(mapping) without return types