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_saturate(self): command = ChangeSwatchesColors(self, _("saturating color swatches"), (lambda clr: colors.saturate(clr, 0.1))) self.undoStack.push(command)
def saturate(self, x): command = ChangeColor(self, _("changing color saturation"), lambda c: colors.saturate(c, x)) self.command(command)
def on_palette_saturate(self): command = ChangeColors(self.palette, self.palette.palette, _("saturating palette colors"), lambda clr: colors.saturate(clr, 0.1)) self.undoStack.push(command)