SVGExporter.py : fix background color

1) blue and green were swapped
2) %f used for integer rgb components
3) %d used for float opacity component
This commit is contained in:
KIU Shueng Chuan 2021-08-04 08:28:21 +08:00
parent 482b92d700
commit 371facb17f
1 changed files with 1 additions and 1 deletions

View File

@ -119,7 +119,7 @@ def generateSvg(item, options={}):
defsXml += "</defs>\n"
svgAttributes = ' viewBox ="0 0 %f %f"' % (options["width"], options["height"])
c = options['background']
backgroundtag = '<rect width="100%%" height="100%%" style="fill:rgba(%f, %f, %f, %d)" />\n' % (c.red(), c.blue(), c.green(), c.alpha()/255.0)
backgroundtag = '<rect width="100%%" height="100%%" style="fill:rgba(%d, %d, %d, %f)" />\n' % (c.red(), c.green(), c.blue(), c.alphaF())
return (xmlHeader % svgAttributes) + backgroundtag + defsXml + node.toprettyxml(indent=' ') + "\n</svg>\n"