def wheelEvent(self, event): if self.selected_color is None: event.ignore() return event.accept() clr = self.selected_color steps = event.delta() / 120.0 if event.modifiers() & QtCore.Qt.ControlModifier: clr = colors.increment_hue(clr, 0.01 * steps) elif event.modifiers() & QtCore.Qt.ShiftModifier: clr = colors.lighter(clr, 0.1 * steps) else: clr = colors.saturate(clr, 0.1 * steps) self.setColor(clr) self.repaint()
def on_swatches_counterclockwise(self): command = ChangeSwatchesColors( self, _("rotating swatches colors counterclockwise"), (lambda clr: colors.increment_hue(clr, 0.03))) self.undoStack.push(command)
def rotate_color(self, x): command = ChangeColor(self, _("rotating color"), lambda c: colors.increment_hue(c, x)) self.command(command)
def on_palette_clockwise(self): command = ChangeColors(self.palette, self.palette.palette, _("rotating palette colors clockwise"), lambda clr: colors.increment_hue(clr, -0.03)) self.undoStack.push(command)