Merge pull request #6 from rokuz/fixed-color-distortion

Fixed color distortion
This commit is contained in:
Konstantin Shalnev 2015-11-30 19:11:02 +03:00
commit c3f780597e

View file

@ -34,8 +34,7 @@ def mwm_encode_color(colors, st, prefix='', default='black'):
if prefix:
prefix += "-"
opacity = hex(255 - int(255 * float(st.get(prefix + "opacity", 1))))
color = whatever_to_hex(st.get(prefix + 'color', default))
color = color[1] + color[1] + color[3] + color[3] + color[5] + color[5]
color = whatever_to_hex(st.get(prefix + 'color', default))[1:]
result = int(opacity + color, 16)
colors.add(result)
return result