0dde5f3f11d4b2b705a3ef68e977b2495f75dbae
1 # -*- coding: utf-8 -*-
3 constantes globales partagées par plusieurs modules.
8 from colorsys
import hls_to_rgb
14 PLAYING_MODES
= (('EASY' , u
'Facile'),
15 ('NORMAL' , u
'Normal'),
16 ('ADVANCED', u
'Avancé'),
17 ('EXPERT' , u
'Expert'))
21 PLAYING_MODES_DICT
= dict([(v
[0], i
) for i
, v
in enumerate(PLAYING_MODES
)])
23 def hls_to_rgba_8bits(h
, l
, s
, a
=1) :
24 #convert to rgb ranging from 0 to 255
25 rgba
= [floor(255 * i
) for i
in hls_to_rgb(h
, l
, s
) + (a
,)]