1. cheery
  2. vectorboobs

Commits

cheery  committed e1119be

scramble colors

  • Participants
  • Parent commits 5260e64
  • Branches default

Comments (0)

Files changed (1)

File color.py

View file
  • Ignore whitespace
 from halogen import Canvas, Column, Button, Row, Slider
 from pyglet.gl import *
 from colorsys import hsv_to_rgb
+from random import random
 
 colors = dict(
     outline = (0.0, 0.0, 0.0),
     col = Column()
     colortheme = Panel("colortheme", col, removable=False, expanded=False)
     dump = Button("dump colors to stdout").append_to(col)
+    roulette = Button("scramble colors").append_to(col)
 
     for key in colors:
         change_color_button(colortheme, key).append_to(col)
             print "%s = %r," % item
         print ')'
 
+    @roulette.event
+    def on_click():
+        for key in colors:
+            colors[key] = random(), random(), random()
+
     return colortheme