Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

outline themes don't seem to be transparent #11

Open
xenoterracide opened this issue Mar 8, 2021 · 8 comments
Open

outline themes don't seem to be transparent #11

xenoterracide opened this issue Mar 8, 2021 · 8 comments

Comments

@xenoterracide
Copy link

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.

@bschwarz
Copy link
Owner

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

@xenoterracide
Copy link
Author

xenoterracide commented Mar 16, 2021 via email

@bschwarz
Copy link
Owner

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

@xenoterracide
Copy link
Author

xenoterracide commented Mar 16, 2021 via email

@bschwarz
Copy link
Owner

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.

@bschwarz
Copy link
Owner

It defaults to transparent now for dark themes.

@xenoterracide
Copy link
Author

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.

@bschwarz
Copy link
Owner

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:

  1. It's consistent with the light themes
  2. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants