projects
/
naja.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Oh yeah, we're using a AttrDict thing, aren't we?
[naja.git]
/
naja
/
utils.py
1
import pygame
2
3
4
def convert_colour(colour):
5
if isinstance(colour, pygame.Color):
6
return colour
7
if isinstance(colour, tuple):
8
return pygame.Color(*colour)
9
if isinstance(colour, basestring):
10
return pygame.Color(colour)
11
raise ValueError()