_hex_colors = re.compile(r'\^x([\dA-Fa-f])([\dA-Fa-f])([\dA-Fa-f])')
# On a light scale of 0 (black) to 255 (white)
-_contrash_threshold = 128
+_contrast_threshold = 128
def qfont_decode(qstr=''):
g = match.group(2) * 2
b = match.group(3) * 2
hue, light, satur = rgb_to_hls(int(r, 16), int(g, 16), int(b, 16))
- if light < _contrash_threshold:
- light = _contrash_threshold
+ if light < _contrast_threshold:
+ light = _contrast_threshold
r, g, b = hls_to_rgb(hue, light, satur)
- return '<span style="rgb({0},{1},{2})">'.format(r, g, b)
+ return '<span style="color:rgb({0},{1},{2})">'.format(r, g, b)
def html_colors(qstr=''):