''
'' Theme based off of the colors used by Amazon Web Services
''
'' Author: Brett Schwarz
''
!$PUML_THEME = "aws-orange"
''
'' User can specify the BGCOLOR via command line or set this variable before
'' loading this theme file. BGCOLOR is the background color of the image that is 
'' generated by plantuml
''
!if %not(%variable_exists("$BGCOLOR"))
!$BGCOLOR = "transparent"
!endif
''
'' User can specify the PUML_MODE via command line or set this variable before
'' loading this theme file. PUML_MODE is either 'light' PUML_MODE or 'dark' PUML_MODE.
''
!if %not(%variable_exists("$PUML_MODE"))
!$PUML_MODE = "light"
!endif
''
'' User can specify the PUML_OUTLINE via command line or set this variable before
'' loading this theme file. PUML_OUTLINE is either 'true' or 'false'.
''
!if %not(%variable_exists("$PUML_OUTLINE"))
!$PUML_OUTLINE = "false"
!endif
''
skinparam BackgroundColor $BGCOLOR
skinparam useBetaStyle false
''
'' Colors taken from CSS
''
!$WHITE = "#FFF"
!$GRAY_LIGHT = "#222"
!$GRAY = "#868e96"
!$PRIMARY = "#EC7211"
!$WARNING = "#EC7211"
!$LIGHT = "#abb6c2"
!$DARK = "#4E5D6C"
''
'' different colors based on PUML_MODE
''
!if ($PUML_MODE == "light")
    !$SECONDARY = "#eeeeee"
    !$SECONDARY_DARK = "#bebebe"
    !$SECONDARY_LIGHT = "#ffffff"
    !$SUCCESS = "#1D8102"
    !$SUCCESS_DARK = "#176702"
    !$SUCCESS_LIGHT = "#4a9a35"
    !$INFO = "#0073bb"
    !$INFO_DARK = "#005c96"
    !$INFO_LIGHT = "#338fc9"
    !$DANGER = "#d13212"
    !$DANGER_DARK = "#a7280e"
    !$DANGER_LIGHT = "#da5b41"
    !$SECONDARY_TEXT = $DARK
    !$FGCOLOR = $DARK
	!$DIAMOND_BD = $SECONDARY_DARK
!else
    !$SECONDARY = "#2a2e33"
    !$SECONDARY_DARK = "#222529"
    !$SECONDARY_LIGHT = "#55585c"
    !$SUCCESS = "#6aaf35"
    !$SUCCESS_DARK = "#558c2a"
    !$SUCCESS_LIGHT = "#88bf5d"
    !$INFO = "#44b9d6"
    !$INFO_DARK = "#3694ab"
    !$INFO_LIGHT = "#69c7de"
    !$DANGER = "#ff5d64"
    !$DANGER_DARK = "#cc4a50"
    !$DANGER_LIGHT = "#ff7d83"
    !$SECONDARY_TEXT = $WHITE
    !$FGCOLOR = $WHITE
	!$DIAMOND_BD = $SECONDARY_LIGHT
!endif
''
'' *_DARK = tint (lighter) of the main color of 
'' *_LIGHT = shade (darker) of the main color of 80%
''
!$PRIMARY_DARK = "#bd5b0e"
!$PRIMARY_LIGHT = "#f08e41"

!$INFO_TEXT = $WHITE
!$SUCCESS_TEXT = $WHITE
!$WARNING_DARK = "#bd5b0e"
!$WARNING_LIGHT = "#f08e41"
!$WARNING_TEXT = $WHITE
!$DANGER_TEXT = $WHITE
!$DARK_DARK = "#717d89"
!$DARK_LIGHT = "#3e4a56"
!$LIGHT_DARK = "#bcc5ce"
!$LIGHT_LIGHT = "#89929b"
''
'' Called to make the text in the color of SUCCESS
''
!procedure $success($msg)
  <font color=$SUCCESS><b>$msg
!endprocedure
''
'' Called to make the text in the color of DANGER
''
!procedure $failure($msg)
  <font color=$DANGER><b>$msg
!endprocedure
''
'' Called to make the text in the color of WARNING
''
!procedure $warning($msg)
  <font color=$WARNING><b>$msg
!endprocedure
''
'' Called to use the primary color scheme
'' Different colors based on if PUML_OUTLINE
'' is true or not
''
!procedure $primary_scheme()
	!if ($PUML_OUTLINE == "true")
		FontColor $PRIMARY
		BorderColor $PRIMARY
		BackgroundColor $BGCOLOR
	!else
		FontColor $PRIMARY_TEXT
		BorderColor $PRIMARY
		BackgroundColor $PRIMARY_LIGHT-$PRIMARY
	!endif
!endprocedure
''
'' Called to use the secondary color scheme
''
!procedure $secondary_scheme()
	!if ($PUML_OUTLINE == "true")
		FontColor $SECONDARY_DARK
		BorderColor $SECONDARY_DARK
		BackgroundColor $BGCOLOR
	!else
		FontColor $SECONDARY_TEXT
		BorderColor $SECONDARY_DARK
		BackgroundColor $SECONDARY_LIGHT-$SECONDARY
	!endif
!endprocedure
''
!if ($PUML_OUTLINE == "true")
	!$HEADER_TEXT = $PRIMARY_TEXT
	!$PRIMARY_TEXT = $PRIMARY_LIGHT
	!$INFO_TEXT = $INFO_LIGHT
	!$WARNING_TEXT = $WARNING_LIGHT
	!$DARK_BG = $BGCOLOR
	!$INFO_BG = $BGCOLOR
	!$DANGER_BG = $BGCOLOR
	!$WARNING_BG = $BGCOLOR
	!$SECONDARY_BG = $BGCOLOR
!else
	!$DARK_BG = $DARK
	!$INFO_BG = $INFO
	!$DANGER_BG = $DANGER
	!$WARNING_BG = $WARNING
	!$SECONDARY_BG = $SECONDARY
!endif
''
!_POST = "<color #007a3e>POST</color>"
!_PUT = "<color #ea7400>PUT</color>"
!_DELETE = "<color #cf2a2a>DELETE</color>"
!_GET = "<color #009fdb>GET</color>"
!_PATCH = "<color #b5bd00>PATCH</color>"
!_HEAD = "<color #9012fe>HEAD</color>"
''
'' Global Default Values
''
skinparam defaultFontName       "Verdana"
skinparam defaultFontSize       12
skinparam dpi                   100
skinparam shadowing             false
skinparam roundcorner           8
skinparam ParticipantPadding    40
skinparam BoxPadding            40
skinparam Padding               5
skinparam ArrowColor            $DARK
skinparam stereotype {
    CBackgroundColor $SECONDARY_LIGHT
    CBorderColor $SECONDARY_DARK
    ABackgroundColor $SUCCESS_LIGHT
    ABorderColor $SUCCESS_DARK
    IBackgroundColor $DANGER_LIGHT
    IBorderColor $DANGER_DARK
    EBackgroundColor $WARNING_LIGHT
    EBorderColor $WARNING_DARK
    NBackgroundColor $INFO_LIGHT
    NBorderColor $INFO_DARK
}
skinparam title {
	FontSize	    	         20
	BorderRoundCorner            8
	BorderThickness 	         1
	BackgroundColor  $SECONDARY_LIGHT-$SECONDARY
	FontColor $PRIMARY
	BorderColor $SECONDARY
}

skinparam legend {
    $secondary_scheme()
    BackgroundColor transparent
}

!startsub swimlane
skinparam swimlane {
	BorderColor $INFO
	BorderThickness 2
	TitleBackgroundColor  $SECONDARY_LIGHT-$SECONDARY
	TitleFontColor $PRIMARY
}
!endsub

' <style> 
' mindmapDiagram {
' 	Padding 15
' 	Margin 10
' 	FontSize 12
' 	FontName Verdana
' 	Shadowing 0.0
' 	LineThickness 1.5
' 	FontColor $PRIMARY_TEXT
' 	LineColor $PRIMARY_DARK
'     node {
' 	    LineColor $PRIMARY
' 	    BackGroundColor $PRIMARY_LIGHT-$PRIMARY
'     }
' }
' </style>

!startsub activity
skinparam activity {
	$primary_scheme()
	BarColor $SUCCESS
	StartColor $INFO
	EndColor $INFO
	''
	DiamondBackgroundColor $SECONDARY_BG
  	DiamondBorderColor $DIAMOND_BD
  	DiamondFontColor $SECONDARY_TEXT
}
!endsub

!startsub participant
skinparam participant {
	$primary_scheme()
	ParticipantBorderThickness 2
}
!endsub

!startsub actor
skinparam actor {
	$primary_scheme()
	FontColor $FGCOLOR
}
!endsub

!startsub arrow
skinparam arrow {
	Thickness 3
	Color $PRIMARY
	FontColor $FGCOLOR
}
!endsub

!startsub sequence
skinparam sequence {
	ArrowThickness 3
	BorderColor $PRIMARY
	' For some reason sequence title font color does not pick up from global
	TitleFontColor $PRIMARY
	BackgroundColor $BGCOLOR
	StartColor $PRIMARY
	EndColor $PRIMARY
	''
	BoxBackgroundColor $BGCOLOR
	BoxBorderColor $DARK
	BoxFontColor $DARK
	''
	LifeLineBorderColor $LIGHT
	LifeLineBorderThickness 2
	LifeLineBackgroundColor $LIGHT_DARK
	''
	GroupBorderColor $DARK
	GroupFontColor $DARK
	GroupHeaderFontColor $INFO
	GroupBackgroundColor $SECONDARY
	GroupBodyBackgroundColor $BGCOLOR
	GroupHeaderBackgroundColor $BGCOLOR
	''
	DividerBackgroundColor $DARK
    DividerBorderColor $DARK
    DividerBorderThickness 2
    DividerFontColor $LIGHT
	''
	ReferenceBackgroundColor $BGCOLOR
	ReferenceBorderColor $DARK
	ReferenceFontColor $DARK
	ReferenceHeaderFontColor $INFO
	ReferenceHeaderBackgroundColor $SECONDARY
	''
	StereotypeFontColor $PRIMARY_TEXT
	StereotypeFontSize 12
}
!endsub

!startsub partition
skinparam partition {
	BorderColor $PRIMARY
	FontColor $PRIMARY
	BackgroundColor $BGCOLOR
}
!endsub

!startsub collections
skinparam collections {
	$primary_scheme()
}
!endsub

!startsub control
skinparam control {
	$primary_scheme()
	FontColor $DARK
}
!endsub

!startsub entity
skinparam entity {
	$primary_scheme()
	FontColor $DARK
}
!endsub

!startsub boundary
skinparam boundary {
	$primary_scheme()
	FontColor $DARK
}
!endsub

!startsub agent
skinparam agent {
	BackgroundColor $WARNING
	BorderColor $WARNING_LIGHT
	FontColor $DARK
}
!endsub

!startsub note
skinparam note {
	BorderThickness 1
	BackgroundColor $INFO_BG
	BorderColor $INFO_DARK
	FontColor $INFO_TEXT
}
!endsub

!startsub artifact
skinparam artifact {
	BackgroundColor $DARK_BG
	BorderColor $DARK_DARK
	FontColor $LIGHT
}
!endsub

!startsub component
skinparam component {
	$primary_scheme()
}
!endsub

!startsub interface
skinparam interface {
	BackgroundColor  $DANGER_DARK
	BorderColor  $DANGER
	FontColor $DARK
}
!endsub

!startsub storage
skinparam storage {
	BackgroundColor $WARNING_BG
  	BorderColor $WARNING_DARK
	FontColor $WARNING_TEXT
}
!endsub

!startsub node
skinparam node {
	BackgroundColor  $BGCOLOR
	BorderColor $LIGHT
	FontColor $LIGHT
}
!endsub

!startsub cloud
skinparam cloud {
	BackgroundColor transparent
	BorderColor $DARK
	FontColor $FGCOLOR
}
!endsub

!startsub database
skinparam database {
	$primary_scheme()
	FontColor $FGCOLOR
	StereotypeFontColor $FGCOLOR
}
!endsub

!startsub class
skinparam class {
	$primary_scheme()
	FontColor $HEADER_TEXT
	HeaderBackgroundColor $PRIMARY_LIGHT-$PRIMARY
	StereotypeFontColor $DARK
	BorderThickness 1
	AttributeFontColor $PRIMARY_TEXT
	AttributeFontSize 11
}
!endsub

!startsub object
skinparam object {
	$primary_scheme()
	StereotypeFontColor $DARK
	BorderThickness 1
	AttributeFontColor $PRIMARY_TEXT
	AttributeFontSize 11
}
!endsub

!startsub usecase
skinparam usecase {
	$primary_scheme()
	BorderThickness 2
	StereotypeFontColor $PRIMARY
}
!endsub

!startsub rectangle
skinparam rectangle {
	BackgroundColor $BGCOLOR
	FontColor $SECONDARY_TEXT
	BorderColor $SECONDARY_TEXT
	BorderThickness 2
	StereotypeFontColor $PRIMARY
}
!endsub

!startsub package
skinparam package {
	BackgroundColor $BGCOLOR
  	BorderColor $SECONDARY_TEXT
	FontColor $SECONDARY_TEXT
	BorderThickness 2
}
!endsub

!startsub folder
skinparam folder {
	BackgroundColor $SECONDARY_BG
  	BorderColor $WARNING
	FontColor $WARNING
	BorderThickness 2
}
!endsub

!startsub frame
skinparam frame {
	BackgroundColor $SECONDARY_BG
  	BorderColor $INFO
	FontColor $INFO
	BorderThickness 2
}
!endsub

!startsub state
skinparam state {
	$primary_scheme()
	StartColor $INFO
	EndColor $INFO
	AttributeFontColor $SECONDARY_TEXT
	AttributeFontSize 11
}
!endsub

!startsub queue
skinparam queue {
	$primary_scheme()
}
!endsub

!startsub card
skinparam card {
	BackgroundColor $INFO_BG
	BorderColor $INFO_DARK
	FontColor $INFO_TEXT
}
!endsub

!startsub file
skinparam file {
	BackgroundColor $SECONDARY_BG
	BorderColor $LIGHT
	FontColor $FGCOLOR
}
!endsub

!startsub stack

skinparam stack {
	$primary_scheme()
}

!endsub
