Handle empty color

Fix #1602
This commit is contained in:
Julien Duponchelle
2016-10-24 17:01:35 +02:00
parent 4e58df60ea
commit e404716f88

View File

@@ -23,7 +23,9 @@ def colorFromSvg(value):
Transform a color coming from a SVG file to a Qcolor
"""
value = value.strip('#')
if len(value) == 6: # If alpha channel is missing
if value == "":
value = "000000"
if len(value) == 6: # If alpha channel is missing
value = "ff" + value
value = int(value, base=16)
return QtGui.QColor.fromRgba(value)