puml-themes
puml-themes copied to clipboard
Collections won't display text
Collections inside a package won't display text in it.
Code to reproduce:
@startuml
!include https://raw.githubusercontent.com/bschwarz/puml-themes/master/themes/cerulean/puml-theme-cerulean.puml
package World {
collections Hellos as "Hellos"
}
@enduml
Expected: "Hellos" text within the collections Actual:

For some reason, the background color is not getting properly set, and the FontColor is white, so you won't see the text on a white background. I think there is a bug in plantuml. If you just do collections on its own:
@startuml
!include https://raw.githubusercontent.com/bschwarz/puml-themes/master/themes/cerulean/puml-theme-cerulean.puml
collections Hellos as "Hellos"
@enduml
it works. But as soon as you introduce "package", it doesn't work. I tried to add a skinparam and
The only thing that seemed to help, is if you change the background color of the package, so that the white text shows up in the collections:
@startuml
!include https://raw.githubusercontent.com/bschwarz/puml-themes/master/themes/cerulean/puml-theme-cerulean.puml
skinparam package {
BackgroundColor lightgray
}
package World {
collections Hellos as "Hellos"
}
@enduml
Sorry I couldn't help more. Cheers, Brett
Thanks Brett,
Other themes (as given below) seems to work somehow. Probably it is not plantUML then?
@startuml
!include https://raw.githubusercontent.com/bschwarz/puml-themes/master/themes/cerulean-outline/puml-theme-cerulean-outline.puml
package World {
collections Hellos as "Hellos"
}
@enduml
Best, Shrey
On a similar note - even rectangle (as given below) doesn't seem to work:
@startuml
!include https://raw.githubusercontent.com/bschwarz/puml-themes/master/themes/cerulean/puml-theme-cerulean.puml
rectangle Hello as "Hello!"
@enduml
The reason those other themes work is because of the font color for those themes. The "collections" are really meant for sequence diagrams. So, if you look at the puml-themes example for sequence diagrams, the collections are rendered properly (look at "Foo6" in the sequence diagram here ). Notice the background is blue in for the collections in the sequence diagram, and the font is white. However, when the collections are used outside of sequence diagrams, for some reason the background does not get set properly, so you have a background (white) as the same color as the font color (white).
So, I think that is a problem with plantuml. Or maybe collections are allowed outside of sequence diagrams, I'm not sure.
For the rectangle, yes I think that is a bug in puml-themes...the font color is getting set incorrectly. I will fix that. If you need a fix right now for "rectangle", you can add a skinparam after the !include https:// .... line at the top. So, it would look like this:
@startuml
!include https://raw.githubusercontent.com/bschwarz/puml-themes/master/themes/cerulean/puml-theme-cerulean.puml
skinparam rectangle {
FontColor $PRIMARY
}
rectangle Hello as "Hello!"
@enduml
I should have a fix for rectangle this weekend.
Cheers, Brett