projects
/
minwii.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remplacement de la flûte.
[minwii.git]
/
src
/
app
/
globals.py
diff --git
a/src/app/globals.py
b/src/app/globals.py
index
8261eda
..
ef51d78
100755
(executable)
--- a/
src/app/globals.py
+++ b/
src/app/globals.py
@@
-5,6
+5,8
@@
constantes globales partagées par plusieurs modules.
$Id$
$URL$
"""
$Id$
$URL$
"""
+from colorsys import hls_to_rgb
+from math import floor
BACKGROUND_LAYER = 0
FOREGROUND_LAYER = 1
BACKGROUND_LAYER = 0
FOREGROUND_LAYER = 1
@@
-13,3
+15,9
@@
PLAYING_MODES = {'EASY':0
,'NORMAL':1
,'ADVANCED':2
,'EXPERT':3}
,'NORMAL':1
,'ADVANCED':2
,'EXPERT':3}
+
+def hls_to_rgba_8bits(h, l, s, a=1) :
+ #convert to rgb ranging from 0 to 255
+ rgba = [floor(255 * i) for i in hls_to_rgb(h, l, s) + (a,)]
+ return tuple(rgba)
+