Background color of an svg not setting

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

 

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

 

Thanks.

1 Answer

0 votes
answered Sep 1, 2016 by plantuml (294,960 points)

Which version of PlantUML are you using ?

The following example seems to work fine for us:

@startuml
skinparam backgroundColor #AAAAAA
Bob -> Alice : hello
@enduml


http://plantuml.com/plantuml/svg/AyxEp2j8B4hCLKXAJCvEByelpKjnpi_9Br9GTWG3BgVy90LTEmN7dCpaL0KhXOpKd9ny0000

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

style="width:119px;height:125px;background:#AAAAAA;"
 

commented Sep 2, 2016 by anonymous
Hi,

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,
Cheers
...