'Set the color mode for the gradient. Options are: \'hsv\', \'rgb\''

def setColorMode(self, cm):

    if (cm not in ['rgb', 'hsv']):
        raise Exception(("Unknown    color    mode    %s.    Options    are    'rgb'    and    'hsv'." % str(cm)))
    try:
        self.rgbAction.blockSignals(True)
        self.hsvAction.blockSignals(True)
        self.rgbAction.setChecked((cm == 'rgb'))
        self.hsvAction.setChecked((cm == 'hsv'))
    finally:
        self.rgbAction.blockSignals(False)
        self.hsvAction.blockSignals(False)
    self.colorMode = cm
    self.updateGradient()
