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_lighter(self): command = ChangeSwatchesColors(self, _("making color swatches lighter"), (lambda clr: colors.lighter(clr, 0.1))) self.undoStack.push(command)
def lighter(self, x): command = ChangeColor(self, _("changing color lightness"), lambda c: colors.lighter(c, x)) self.command(command)
def on_palette_lighter(self): command = ChangeColors(self.palette, self.palette.palette, _("making palette colors lighter"), lambda clr: colors.lighter(clr, 0.1)) self.undoStack.push(command)