class_docstr: Displays legend colorbar on the screen.
code: def paint(self):
      self.setupGLState()
  
      if self._gradient is None:
          self._gradient = self.gradient.getGradient()
  
      barRect = QtCore.QRectF(
          self.pos[0], self.pos[1], self.size[0], self.size[1]
      )
      self._gradient.setStart(barRect.bottomLeft())
      self._gradient.setFinalStop(barRect.topLeft())
  
      painter = QtGui.QPainter(self.view())
      painter.fillRect(barRect, self._gradient)
      painter.setPen(self.fontColor)
      for labelText, labelPosition in self.labels.items():
          ## todo: draw ticks, position text properly
          x = 1.1 * self.size[0] + self.pos[0]
          y = (
              self.size[1]
              - labelPosition * self.size[1]
              + self.pos[1]
              + 8
          )
          ##todo: fonts
          painter.drawText(QtCore.QPointF(x, y), labelText)
      painter.end()
  
file_path: pyqtgraph/pyqtgraph/opengl/items/GLGradientLegendItem.py
imports: from ...None import functions
  from ...colormap import ColorMap
  from ...Qt import QtCore, QtGui
  from ..GLGraphicsItem import GLGraphicsItem
label_desc: Use image node_id 3 for calling the GLGradientLegendItem obj's underlying member method code with example usage: obj.paint() without return types