Beispiel #1
0
 def __model_input_flush_cb(self, model):
     # Update the colour usage history whenever the stroke is split, for
     # correctness with splatter brushes which don't depend on pressure.
     brush = self.__brush
     if not brush.is_eraser():
         col = colors.HSVColor(*brush.get_color_hsv())
         self.push_history(col)
Beispiel #2
0
 def __input_stroke_ended_cb(self, doc, event):
     # Update the colour usage history immediately after the user paints
     # with a new colour, for responsiveness.
     brush = self.__brush
     if not brush.is_eraser():
         col = colors.HSVColor(*brush.get_color_hsv())
         self.push_history(col)
Beispiel #3
0
 def __settings_changed_cb(self, settings):
     # When the colour changes by external means, update the adjusters.
     if not settings.intersection(('color_h', 'color_s', 'color_v')):
         return
     brush_color = colors.HSVColor(*self.__brush.get_color_hsv())
     if brush_color == self.get_color():
         return
     self.__in_callback = True
     self.set_color(brush_color)
     self.__in_callback = False
Beispiel #4
0
 def _get_app_brush_color(self):
     app = self._doc.app
     return colors.HSVColor(*app.brush.get_color_hsv())