Beispiel #1
0
 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()
Beispiel #2
0
 def on_swatches_counterclockwise(self):
     command = ChangeSwatchesColors(
         self, _("rotating swatches colors counterclockwise"),
         (lambda clr: colors.increment_hue(clr, 0.03)))
     self.undoStack.push(command)
Beispiel #3
0
 def rotate_color(self, x):
     command = ChangeColor(self, _("rotating color"),
                           lambda c: colors.increment_hue(c, x))
     self.command(command)
Beispiel #4
0
 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)