class_docstr: **Bases:** :class:`PlotItem <pyqtgraph.PlotItem>`
  
  :class:`ColorBarItem` controls the application of a 
  :ref:`color map <apiref_colormap>` to one (or more) 
  :class:`~pyqtgraph.ImageItem`. It is a simpler, compact alternative to 
  :class:`~pyqtgraph.HistogramLUTItem`, without histogram or the 
  option to adjust the colors of the look-up table.
  
  A labeled axis is displayed directly next to the gradient to help identify values.
  Handles included in the color bar allow for interactive adjustment.
  
  A ColorBarItem can be assigned one or more :class:`~pyqtgraph.ImageItem` s 
  that will be displayed according to the selected color map and levels. The
  ColorBarItem can be used as a separate element in a 
  :class:`~pyqtgraph.GraphicsLayout` or added to the layout of a 
  :class:`~pyqtgraph.PlotItem` used to display image data with coordinate axes.
  
  =============================  =============================================
  **Signals:**
  sigLevelsChanged(self)         Emitted when the range sliders are moved
  sigLevelsChangeFinished(self)  Emitted when the range sliders are released
  =============================  =============================================
class_docstr_tok: ["*","*","Bases",":","*","*",":","class",":","`","PlotItem","<","pyqtgraph.PlotItem",">","`",":","class",":","`","ColorBarItem","`","controls","the","application","of","a",":","ref",":","`","color","map","<","apiref_colormap",">","`","to","one","(","or","more",")",":","class",":","`","~pyqtgraph.ImageItem","`",".","It","is","a","simpler",",","compact","alternative","to",":","class",":","`","~pyqtgraph.HistogramLUTItem","`",",","without","histogram","or","the","option","to","adjust","the","colors","of","the","look-up","table",".","A","labeled","axis","is","displayed","directly","next","to","the","gradient","to","help","identify","values",".","Handles","included","in","the","color","bar","allow","for","interactive","adjustment",".","A","ColorBarItem","can","be","assigned","one","or","more",":","class",":","`","~pyqtgraph.ImageItem","`","s","that","will","be","displayed","according","to","the","selected","color","map","and","levels",".","The","ColorBarItem","can","be","used","as","a","separate","element","in","a",":","class",":","`","~pyqtgraph.GraphicsLayout","`","or","added","to","the","layout","of","a",":","class",":","`","~pyqtgraph.PlotItem","`","used","to","display","image","data","with","coordinate","axes",".","=============================","=============================================","*","*","Signals",":","*","*","sigLevelsChanged","(","self",")","Emitted","when","the","range","sliders","are","moved","sigLevelsChangeFinished","(","self",")","Emitted","when","the","range","sliders","are","released","=============================","============================================="]
docstr: internal: update color maps for bar and assigned ImageItems 
docstr_tok: ["internal",":","update","color","maps","for","bar","and","assigned","ImageItems"]
code: def _update_items(self, update_cmap=False):
      """internal: update color maps for bar and assigned ImageItems"""
      # update color bar:
      self.axis.setRange(self.values[0], self.values[1])
      if update_cmap and self._colorMap is not None:
          lut = self._colorMap.getLookupTable(nPts=256, alpha=True)
          lut = np.expand_dims(lut, axis=0 if self.horizontal else 1)
          qimg = fn.ndarray_to_qimage(
              lut, QtGui.QImage.Format.Format_RGBA8888
          )
          self.bar.setPixmap(QtGui.QPixmap.fromImage(qimg))
      # update assigned ImageItems, too:
      for img_weakref in self.img_list:
          img = img_weakref()
          if img is None:
              continue  # dereference weakref
          img.setLevels(self.values)  # (min,max) tuple
          if update_cmap and self._colorMap is not None:
              img.setColorMap(self._colorMap)
  
file_path: pyqtgraph/pyqtgraph/graphicsItems/ColorBarItem.py
imports: import math
  import weakref
  import numpy
  from ..None import colormap
  from ..None import functions
  from ..Qt import QtCore, QtGui, QtWidgets
  from .LinearRegionItem import LinearRegionItem
  from .PlotItem import PlotItem
label_desc: Use image node_id 7 for calling the ColorBarItem obj's underlying member method code with example usage: obj._update_items(update_cmap) without return types