class_docstr: Draws a color gradient rectangle along with text labels denoting the value at specific
  points along the gradient.
class_docstr_tok: ["Draws","a","color","gradient","rectangle","along","with","text","labels","denoting","the","value","at","specific","points","along","the","gradient","."]
code: def __init__(self, size, offset):
      self.size = size
      self.offset = offset
      UIGraphicsItem.__init__(self)
      self.setAcceptedMouseButtons(QtCore.Qt.MouseButton.NoButton)
      self.brush = QtGui.QBrush(
          QtGui.QColor(255, 255, 255, 100)
      )  # background color
      self.pen = QtGui.QPen(QtGui.QColor(0, 0, 0))
      self.textPen = QtGui.QPen(QtGui.QColor(0, 0, 0))
      self.labels = {"max": 1, "min": 0}
      self.gradient = QtGui.QLinearGradient()
      self.gradient.setColorAt(0, QtGui.QColor(0, 0, 0))
      self.gradient.setColorAt(1, QtGui.QColor(255, 0, 0))
      self.setZValue(100)
  
file_path: pyqtgraph/pyqtgraph/graphicsItems/GradientLegend.py
imports: from ..None import functions
  from ..Qt import QtCore, QtGui
  from .UIGraphicsItem import UIGraphicsItem
label_desc: Use image node_id 1 to create a new GradientLegend object from inherited base classes: UIGraphicsItem with example: obj = GradientLegend(size, offset)