Background color of an svg not setting

0 votes
asked Aug 26, 2016 in Closed question / help by anonymous


Is there a way to set the background color of an svg diagram?

skinparam backgroundColor white

skinparam backgroundColor red

etc still render a transparent background



1 Answer

0 votes
answered Sep 1, 2016 by plantuml (265,020 points)

Which version of PlantUML are you using ?

The following example seems to work fine for us:

skinparam backgroundColor #AAAAAA
Bob -> Alice : hello

In the SVG source, you will find the following attribute:


commented Sep 2, 2016 by anonymous

Thanks for your answer
I am using PlantUML 8047 with graphviz 2.36.0

Yes you are right. The svgs contain the correct background property inside the style attribute and both firefox and chromium display those backgrounds correctly.
The issue is that desktop programs in my pc (image viewers, gimp)  ignore the property and render the background transparent. From a quick search I did it seems that the svg spec does not define a background property (in the standard implementation at least) so I guess your ability to set the background will depend on the software that you are using to open the image.

Anyway the issue does not seem to be with PlantUML.
Thanks for your help,