diff --git a/src/painter.py b/src/painter.py index 71fffa4..e116bd4 100644 --- a/src/painter.py +++ b/src/painter.py @@ -38,6 +38,9 @@ class Painter(Widget): # shape of particle to add next self.shape=Cross + # color of particle to add next + self.color=(0,0,1) + # underlying lattice self.lattice=None @@ -232,7 +235,7 @@ class Painter(Widget): # create new particle if touch.button=="right": - new=self.shape(touchx,touchy) + new=self.shape(touchx,touchy,color=self.color) # snap to lattice if self.lattice!=None: new.move(self.lattice.nearest_delta(new.elements[0].pos)) @@ -440,6 +443,9 @@ class Painter(Widget): # set color of selected particles def set_color(self,color): + # set color for next particles + self.color=color + # set color of selected particles for particle in self.selected: particle.color=color # redraw