aboutsummaryrefslogtreecommitdiff
path: root/behaviors/ColorChangerBehavior.py
diff options
context:
space:
mode:
Diffstat (limited to 'behaviors/ColorChangerBehavior.py')
-rw-r--r--behaviors/ColorChangerBehavior.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/behaviors/ColorChangerBehavior.py b/behaviors/ColorChangerBehavior.py
index 8ecc5f2..ca80eb4 100644
--- a/behaviors/ColorChangerBehavior.py
+++ b/behaviors/ColorChangerBehavior.py
@@ -6,7 +6,9 @@ class ColorChangerBehavior(Behavior):
ret = []
for sensory in sensorInputs:
newDict = dict(sensory) #don't run into shallow copy issues
- #TODO: support for PixelEvents
- newDict['Color'] = Util.randomColor()
+ if self['ColorList'] != None:
+ newDict['Color'] = Util.randomColor(self['ColorList'])
+ else:
+ newDict['Color'] = Util.chooseRandomColor()
ret.append(newDict)
return ret