code: def paintColorMap(self, painter, rect):
      painter.save()
      image = self.getImage()
      painter.drawImage(rect, image)
  
      if not self.horizontal:
          painter.translate(rect.center())
          painter.rotate(-90)
          painter.translate(-rect.center())
  
      text = self.colorMap().name
      wpen = QtGui.QPen(QtCore.Qt.GlobalColor.white)
      bpen = QtGui.QPen(QtCore.Qt.GlobalColor.black)
      # get an estimate of the lightness of the colormap
      # from its center element
      lightness = image.pixelColor(image.rect().center()).lightnessF()
      if lightness >= 0.5:
          # light: draw text with dark pen
          pens = [wpen, bpen]
      else:
          # dark: draw text with light pen
          pens = [bpen, wpen]
  
      AF = QtCore.Qt.AlignmentFlag
      trect = painter.boundingRect(rect, AF.AlignCenter, text)
      # draw a background shadow
      painter.setPen(pens[0])
      painter.drawText(trect, 0, text)
      # draw the foreground text
      painter.setPen(pens[1])
      painter.drawText(trect.adjusted(1, 0, 1, 0), 0, text)
  
      painter.restore()
  
imports: import importlib.util
  import re
  import numpy
  from ..None import colormap
  from ..None import functions
  from ..graphicsItems.GradientPresets import Gradients
  from ..Qt import QtCore, QtGui, QtWidgets
label_desc: Use image node_id 9 for calling the ColorMapDisplayMixin obj's underlying member method code with example usage: obj.paintColorMap(painter, rect) without return types