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