code: def addNew(self, name):
      fieldSpec = self.fields[name]
  
      mode = fieldSpec.get("mode", "range")
      if mode == "range":
          item = RangeColorMapItem(name, self.fields[name])
      elif mode == "enum":
          item = EnumColorMapItem(name, self.fields[name])
  
      defaults = fieldSpec.get("defaults", {})
      for k, v in defaults.items():
          if k == "colormap":
              if mode == "range":
                  item.setValue(v)
              elif mode == "enum":
                  children = item.param("Values").children()
                  for i, child in enumerate(children):
                      try:
                          child.setValue(v[i])
                      except IndexError:
                          continue
          else:
              item[k] = v
  
      self.addChild(item)
      return item
  
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 3 for calling the ColorMapParameter obj's underlying member method code with example usage: obj.addNew(name) and returns: item