colors - 0.1
Simple way to grab random colors using a filter string.
jake b
(ninmonkey)
Simple way to grab random colors using a filter string. Uses pygame.THECOLORS dict for colors.
You can call:
random_color('red')
To return a random 'red' color from several reds. See screenshot.
Changes
Code has been uploaded: https://code.google.com/p/ninmonkey/source/browse/#hg%2Fcolors
run colorstest.py , press spacebar.
Links
Releases
Pygame.org account Comments
-
Benanddanm 2011-07-18 13:09
hi
-
Benanddanm 2011-07-18 13:12
it doesnt work
-
hmxela 2011-07-18 20:25
You use random.choice() on the dictionary type THECOLORS in colors.py. It won't work since a dictionary is not a sequence. I found out that this works, however:
c = choice(THECOLORS.values())