-
Notifications
You must be signed in to change notification settings - Fork 159
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
Support theming: (Example: Border color is hardcoded to gray) #63
Comments
Good catch, previously we had For built-in theming, I updated color palette to align with AWS branding and to support toggling between light and dark mode, which uses the same What kind of color theming where you thinking about? Would you mind creating a sample diagram and posting the source / image as an example? You might be able to just add your own
|
So... the way I do this right now is using the following on a theme file: !$AWS_DARK = false
!$PUML_MODE = 'dark'
!$CUSTOM_COLOR_BLUE_DARK = '#240E89'
!$CUSTOM_COLOR_ORANGE_LIGHTEST = '#FAE2D2'
!$CUSTOM_COLOR_ORANGE_LIGHT = '#F1B66A'
!$CUSTOM_COLOR_ORANGE_DARK = '#E18815'
!$CUSTOM_COLOR_PURPLE_LIGHT = '#DCDEEB'
!$CUSTOM_COLOR_PURPLE_DARK = '#903AA9'
!define AWSPuml https://raw.githubusercontent.com/awslabs/aws-icons-for-plantuml/v16.0/dist
!include AWSPuml/AWSCommon.puml
skinparam Default {
TextAlignment center
}
skinparam Database {
ArrowColor $CUSTOM_COLOR_BLUE_DARK
ArrowFontColor $CUSTOM_COLOR_BLUE_DARK
BackgroundColor $CUSTOM_COLOR_PURPLE_LIGHT
BorderColor $CUSTOM_COLOR_PURPLE_DARK
BorderThickness 2
FontColor $INFO
}
skinparam frame {
ArrowColor $CUSTOM_COLOR_BLUE_DARK
ArrowFontColor $CUSTOM_COLOR_BLUE_DARK
BackgroundColor $CUSTOM_COLOR_PURPLE_LIGHT
BorderColor $CUSTOM_COLOR_PURPLE_DARK
BorderThickness 2
FontColor $INFO
FrameFontColor $INFO
}
skinparam rectangle {
ArrowColor $CUSTOM_COLOR_BLUE_DARK
ArrowFontColor $CUSTOM_COLOR_BLUE_DARK
BorderColor $CUSTOM_COLOR_PURPLE_DARK
BackgroundColor $CUSTOM_COLOR_PURPLE_LIGHT
FontColor $DARK_DARK
}
skinparam component {
ArrowColor $CUSTOM_COLOR_BLUE_DARK
ArrowFontColor $CUSTOM_COLOR_BLUE_DARK
BackgroundColor $CUSTOM_COLOR_ORANGE_LIGHTEST
BorderColor $CUSTOM_COLOR_ORANGE_DARK
FontColor $DARK_DARK
}
skinparam legend {
ArrowColor $CUSTOM_COLOR_BLUE_DARK
ArrowFontColor $CUSTOM_COLOR_BLUE_DARK
BackgroundColor $CUSTOM_COLOR_ORANGE_LIGHT
BorderColor $CUSTOM_COLOR_ORANGE_DARK
FontColor $CUSTOM_COLOR_BLUE_DARK
BorderThickness 3
}
left to right direction
!definelong AWSEntityColoring(stereo)
skinparam rectangle<<stereo>> {
$AWS_common_skinparam()
BackgroundColor $CUSTOM_COLOR_ORANGE_LIGHTEST
BorderColor $CUSTOM_COLOR_ORANGE_DARK
BorderThickness 2
FontColor $DARK_DARK
}
!enddefinelong
!procedure $AWSGroupColoring($stereo, $border_color=$AWS_FG_COLOR, $border_style="plain")
skinparam rectangle<<$stereo>> {
ArrowColor $CUSTOM_COLOR_BLUE_DARK
BackgroundColor $CUSTOM_COLOR_PURPLE_LIGHT
BorderColor $CUSTOM_COLOR_PURPLE_DARK
BorderStyle $border_style
BorderThickness 2
FontColor $AWS_FG_COLOR
FontSize 25
Shadowing false
StereotypeFontSize 0
}
!endprocedure
!include all_the_puml_files_I_need It's very extensible, but there's a risk of it becoming difficult to maintain (for instance, migrating from v14 to v16 was a bit tougher than I expected). It would be fantastic if we could have some sort of alias for colors that are reused among all of the components. for instance: !$AWS_DARK = false
!$PUML_MODE = 'dark'
!$CUSTOM_COLOR_BLUE_DARK = '#240E89'
!$CUSTOM_COLOR_ORANGE_LIGHTEST = '#FAE2D2'
!$CUSTOM_COLOR_ORANGE_LIGHT = '#F1B66A'
!$CUSTOM_COLOR_ORANGE_DARK = '#E18815'
!$CUSTOM_COLOR_PURPLE_LIGHT = '#DCDEEB'
!$CUSTOM_COLOR_PURPLE_DARK = '#903AA9'
!$AWS_FG_COLOR = $DARK_DARK
!$AWS_BG_COLOR = $CUSTOM_COLOR_PURPLE_LIGHT
!$AWS_ARROW_COLOR = $CUSTOM_COLOR_BLUE_DARK
!define AWSPuml https://raw.githubusercontent.com/awslabs/aws-icons-for-plantuml/v16.0/dist
!include AWSPuml/AWSCommon.puml
!include all_the_puml_files_I_need This way we can fully color ALL the components thanks to etc... |
Yes, it would be nice to color the borders of certain components such that they could be implicitly grouped according to some common characteristic (AWS account, for example) while still being arranged and laid out according to another (say, proximity to client request, for example). |
Hi! It seems that AWSCommon.puml now has a procedure defined as:
It seems $AWS_BORDER_COLOR is no longer used, except for a few examples. Shouldn't we still reference $AWS_BORDER_COLOR where needed, or remove this variable?
This, by itself is not really a problem, except for a name that is kind of confusing.
It would be awesome if the project could support some degree of theming, at least with colors.
Something like this:
could become
Is this something that could be implemented?
This would certainly be faster than adding
after importing AWSCommon...
Thanks a lot!
The text was updated successfully, but these errors were encountered: