Skip to main content

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

Home Page
http://code.google.com/p/ninmonkey/
Source
https://code.google.com/p/ninmonkey/source/browse/#hg%2Fcolors

Releases

colors 0.1 — 17 Jul, 2011

colors 0.1 — 16 Jul, 2011

Pygame.org account Comments

  • Jake b 2011-07-17 23:06

    Yes. having trouble uploading to google.

    Jake b 2011-07-18 02:21

    Fixed.

  • 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())

    Puhalenthi 2020-07-15 15:17

    yeah. thx

    Jake b 2011-07-19 13:35

    thanks. fixed.