aboutsummaryrefslogtreecommitdiff
path: root/behaviors/RandomSetBrightColorBehavior.py
diff options
context:
space:
mode:
authorGravatar rcoh <rcoh@mit.edu>2011-01-29 21:05:59 -0500
committerGravatar rcoh <rcoh@mit.edu>2011-01-29 21:05:59 -0500
commit9f69f7a2e174da12e6b2554c4270b5cadc52ff23 (patch)
tree503f63959459fd91cd1c170a390e916b85499a01 /behaviors/RandomSetBrightColorBehavior.py
parentb42cab93f90760eaf3f8aac01c2ab41c1a5b1176 (diff)
parentda934a838305bab72bd12dcd2b83e689f7c1cc3f (diff)
Merge branch 'fridaydemo' of https://github.com/smootlight2/SmootLight into smootlight2-fridaydemo
Diffstat (limited to 'behaviors/RandomSetBrightColorBehavior.py')
-rw-r--r--behaviors/RandomSetBrightColorBehavior.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/behaviors/RandomSetBrightColorBehavior.py b/behaviors/RandomSetBrightColorBehavior.py
new file mode 100644
index 0000000..f278858
--- /dev/null
+++ b/behaviors/RandomSetBrightColorBehavior.py
@@ -0,0 +1,14 @@
+from operationscore.Behavior import *
+import util.ColorOps as color
+import pdb
+import colorsys
+import random
+class RandomSetBrightColorBehavior(Behavior):
+ """Sets a random color that is bright."""
+ def processResponse(self, sensorInputs, recursiveInputs):
+ ret = []
+ for sensory in sensorInputs:
+ newDict = dict(sensory)
+ newDict['Color'] = color.randomBrightColor()
+ ret.append(newDict)
+ return (ret, [])