docstr: Return an array of colors corresponding to *data*. 
  
  ==============  =================================================================
  **Arguments:**
  data            A numpy record array where the fields in data.dtype match those
                  defined by a prior call to setFields().
  mode            Either 'byte' or 'float'. For 'byte', the method returns an array
                  of dtype ubyte with values scaled 0-255. For 'float', colors are
                  returned as 0.0-1.0 float values.
  ==============  =================================================================
docstr_tok: ["Return","an","array","of","colors","corresponding","to","*","data","*",".","==============","=================================================================","*","*","Arguments",":","*","*","data","A","numpy","record","array","where","the","fields","in","data.dtype","match","those","defined","by","a","prior","call","to","setFields","(",")",".","mode","Either","'byte","'","or","'float","'",".","For","'byte","'",",","the","method","returns","an","array","of","dtype","ubyte","with","values","scaled","0-255",".","For","'float","'",",","colors","are","returned","as","0.0-1.0","float","values",".","==============","================================================================="]
code: def map(self, data, mode="byte"):
      """
      Return an array of colors corresponding to *data*.
  
      ==============  =================================================================
      **Arguments:**
      data            A numpy record array where the fields in data.dtype match those
                      defined by a prior call to setFields().
      mode            Either 'byte' or 'float'. For 'byte', the method returns an array
                      of dtype ubyte with values scaled 0-255. For 'float', colors are
                      returned as 0.0-1.0 float values.
      ==============  =================================================================
      """
      if isinstance(data, dict):
          data = np.array(
              [tuple(data.values())],
              dtype=[(k, float) for k in data.keys()],
          )
  
      colors = np.zeros((len(data), 4))
      for item in self.children():
          if not item["Enabled"]:
              continue
          chans = item.param("Channels..")
          mask = np.empty((len(data), 4), dtype=bool)
          for i, f in enumerate(["Red", "Green", "Blue", "Alpha"]):
              mask[:, i] = chans[f]
  
          colors2 = item.map(data)
  
          op = item["Operation"]
          if op == "Add":
              colors[mask] = colors[mask] + colors2[mask]
          elif op == "Multiply":
              colors[mask] *= colors2[mask]
          elif op == "Overlay":
              a = colors2[:, 3:4]
              c3 = colors * (1 - a) + colors2 * a
              c3[:, 3:4] = colors[:, 3:4] + (1 - colors[:, 3:4]) * a
              colors = c3
          elif op == "Set":
              colors[mask] = colors2[mask]
  
      colors = fn.clip_array(colors, 0.0, 1.0)
      if mode == "byte":
          colors = (colors * 255).astype(np.ubyte)
  
      return colors
  
imports: from collections import OrderedDict
  import numpy
  from ..None import functions
  from ..None import parametertree
  from ..Qt import QtCore
label_desc: Use image node_id 6 for calling the ColorMapParameter obj's underlying member method code with example usage: obj.map(data, mode) and returns: colors