puml-themes
puml-themes copied to clipboard
outline themes don't seem to be transparent
I tried to use a couple of the outline themes, cyborg, superhero, with the latest version of plantuml, and they rendered but the background wasn't transparent.
I'm starting to use dark mode on github, which is now available as a setting in under your user settings, my end goal is an svg that works well with both light and dark.
Hi,
Sorry for the late response. Which version of plantuml are you using? Do you still have the issue when you use http://www.plantuml.com/plantuml?
Thanks, Brett
I'm not 100% because I wasn't originally logging the version. I started working on plantuml about 8 days ago. Looks like my most recent build 5 days ago used 2021.2, do the first may have been 2021.1 not sure. But I have it fetching the most recent version. You're theme actually broke on 2020 circa may (I think).
On Mon, Mar 15, 2021, 8:17 PM bschwarz @.***> wrote:
Hi,
Sorry for the late response. Which version of plantuml are you using? Do you still have the issue when you use http://www.plantuml.com/plantuml?
Thanks, Brett
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bschwarz/puml-themes/issues/11#issuecomment-799869790, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABLDMN6TWTCUU6DR3M7W3TD2WRLANCNFSM4YYWKL7Q .
Ok, sorry. I forgot that what I did for the dark themes was to default the background color to "black". The white themes I default to "transparent". Not sure why I decided on that, seems asymmetrical to me...I need to think if I should change that or not.
However, you can get around this easily, by defining $BGCOLOR before you include the theme. Something like this:
@startuml
!$BGCOLOR="transparent"
!include https://raw.githubusercontent.com/bschwarz/puml-themes/master/themes/cyborg-outline/puml-theme-cyborg-outline.puml
Bob -> Alice : hello
@enduml
You can see how it looks here
Sorry for the confusion, I will document this better...
Hope that helps, Brett
yeah, but it's listed on the site as transparent. I had figured that piece out. I want to include by -I. or -config though.
By the way you may be interested in this issue. I have been modifying this theme to be a bit better working on both light and dark, but no real perfection. I've considered simply generating svg's twice and then using html in the markdown to switch (if it's possible)
https://github.com/plantuml/plantuml/issues/484
On Tue, Mar 16, 2021 at 11:54 AM bschwarz @.***> wrote:
Ok, sorry. I forgot that what I did for the dark themes was to default the background color to "black". The white themes I default to "transparent". Not sure why I decided on that, seems asymmetrical to me...I need to think if I should change that or not.
However, you can get around this easily, by defining $BGCOLOR before you include the theme. Something like this:
@startuml !$BGCOLOR="transparent"
!include https://raw.githubusercontent.com/bschwarz/puml-themes/master/themes/cyborg-outline/puml-theme-cyborg-outline.puml
Bob -> Alice : hello @enduml
You can see how it looks here http://www.plantuml.com/plantuml/png/LSh1YiCW483XkqzXmbwDzy0ksVJGIo7GDr0pH477C3CIsgTl2psqnv_ldrWSIIjPTJ_p-RHSbkjlB-IGTqU0qYlL9GovhQ2ZoCwZjUIEOKiIcsyC52eAe0oX5kivnCFHtUwjP2CH2h0jZWN8lYlSVANDr2Ov8NoCvbk6boYbvkgr-TF_EGNGeuwGSrKJuFha1m00
Sorry for the confusion, I will document this better...
Hope that helps, Brett
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bschwarz/puml-themes/issues/11#issuecomment-800435233, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABLDNFI5EMFXQR4UQWSSDTD6ELNANCNFSM4YYWKL7Q .
-- Caleb Cushing
https://xenoterracide.com
Ok, yeah. I probably will change the default to "transparent". The problem I had in general was to structure a config such that it works well with all configurations, but this turned out to be troublesome.
I don't know if this helps in the meantime, but if you want to generate from the command line, you can create another config file, with just the background definition, like so:
!$BGCOLOR="transparent"
And then on the command line:
java -jar -plantuml /path/to/diagram.puml -config /path/to/background-file -config /path/to/theme-file
Note: background-file should come before theme-file
I know that is a hack, but something to use for the time being. There is an option to pass a variable with the -D option on the command line, but that doesn't work for me.
It defaults to transparent now for dark themes.
but then won't you end up with an issue for the non-transparent dark theme file if it's on a white background? idk, up to you, I just thought I'd raise the flag.
Yeah, there is no ideal solution, until plantuml supports some sort of dynamic color generation.
I decided to make them transparent for dark themes by default for 2 reasons:
- It's consistent with the light themes
- It's easier to adapt the background for transparent images. For example, on a webpage I can set the background to whatever I want (e.g. black, dark gray, etc).
Cheers, Brett