'Restore the gradient specified in state.
**Arguments:**
state           A dictionary with same structure as those returned by
:func:`saveState <pyqtgraph.GradientEditorItem.saveState>`
Keys must include:
- \'mode\': hsv or rgb
- \'ticks\': a list of tuples (pos, (r,g,b,a))'

def restoreState(self, state):

    self.setColorMode(state['mode'])
    for t in list(self.ticks.keys()):
        self.removeTick(t, finish=False)
    for t in state['ticks']:
        c = QtGui.QColor(*t[1])
        self.addTick(t[0], c, finish=False)
    self.updateGradient()
    self.sigGradientChangeFinished.emit(self)
