'Create a new GradientEditorItem.
All arguments are passed to :func:`TickSliderItem.__init__ <pyqtgraph.TickSliderItem.__init__>`
**Arguments:**
orientation      Set the orientation of the gradient. Options are: \'left\', \'right\'
\'top\', and \'bottom\'.
allowAdd         Default is True. Specifies whether ticks can be added to the item.
tickPen          Default is white. Specifies the color of the outline of the ticks.
Can be any of the valid arguments for :func:`mkPen <pyqtgraph.mkPen>`'

def __init__(self, *args, **kargs):

    self.currentTick = None
    self.currentTickColor = None
    self.rectSize = 15
    self.gradRect = QtGui.QGraphicsRectItem(QtCore.QRectF(0, self.rectSize, 100, self.rectSize))
    self.backgroundRect = QtGui.QGraphicsRectItem(QtCore.QRectF(0, (- self.rectSize), 100, self.rectSize))
    self.backgroundRect.setBrush(QtGui.QBrush(QtCore.Qt.DiagCrossPattern))
    self.colorMode = 'rgb'
    TickSliderItem.__init__(self, *args, **kargs)
    self.colorDialog = QtGui.QColorDialog()
    self.colorDialog.setOption(QtGui.QColorDialog.ShowAlphaChannel, True)
    self.colorDialog.setOption(QtGui.QColorDialog.DontUseNativeDialog, True)
    self.colorDialog.currentColorChanged.connect(self.currentColorChanged)
    self.colorDialog.rejected.connect(self.currentColorRejected)
    self.colorDialog.accepted.connect(self.currentColorAccepted)
    self.backgroundRect.setParentItem(self)
    self.gradRect.setParentItem(self)
    self.setMaxDim((self.rectSize + self.tickSize))
    self.rgbAction = QtGui.QAction('RGB', self)
    self.rgbAction.setCheckable(True)
    self.rgbAction.triggered.connect((lambda : self.setColorMode('rgb')))
    self.hsvAction = QtGui.QAction('HSV', self)
    self.hsvAction.setCheckable(True)
    self.hsvAction.triggered.connect((lambda : self.setColorMode('hsv')))
    self.menu = QtGui.QMenu()
    l = self.length
    self.length = 100
    global Gradients
    for g in Gradients:
        px = QtGui.QPixmap(100, 15)
        p = QtGui.QPainter(px)
        self.restoreState(Gradients[g])
        grad = self.getGradient()
        brush = QtGui.QBrush(grad)
        p.fillRect(QtCore.QRect(0, 0, 100, 15), brush)
        p.end()
        label = QtGui.QLabel()
        label.setPixmap(px)
        label.setContentsMargins(1, 1, 1, 1)
        act = QtGui.QWidgetAction(self)
        act.setDefaultWidget(label)
        act.triggered.connect(self.contextMenuClicked)
        act.name = g
        self.menu.addAction(act)
    self.length = l
    self.menu.addSeparator()
    self.menu.addAction(self.rgbAction)
    self.menu.addAction(self.hsvAction)
    for t in list(self.ticks.keys()):
        self.removeTick(t)
    self.addTick(0, QtGui.QColor(0, 0, 0), True)
    self.addTick(1, QtGui.QColor(255, 0, 0), True)
    self.setColorMode('rgb')
    self.updateGradient()
