Farbwahl ausgelagert
authorJoachim Breitner <mail@joachim-breitner.de>
Tue, 1 May 2007 09:53:43 +0000 (09:53 +0000)
committerJoachim Breitner <mail@joachim-breitner.de>
Tue, 1 May 2007 09:53:43 +0000 (09:53 +0000)
cairoboard.py

index be2e078..3d9a13e 100644 (file)
@@ -490,16 +490,18 @@ class GrassBoard(CairoBoard):
         cr.stroke()
         cr.set_matrix(matrix)
             
+    def choose_flower_color(self):
+        return (random.random(),
+                random.random(),
+                random.random() )
+
+
     #Eine Blume malen
     def draw_flower(self, card,cr):
         cr.rotate(random.uniform(0,2*math.pi))
         matrix=cr.get_matrix()
         cr.scale(0.25, 0.25)
-        color = ( 
-                    random.random(),
-                    random.random(),
-                    random.random() )
-
+        color = self.choose_flower_color()
         for n in range(5):
             cr.set_source_rgb(*color)
             cr.move_to(0,0)