== Skinparam command
You can change colors and font of the drawing using the `+skinparam+` command.
+++Example+++:
----
skinparam backgroundColor transparent
----
== Usage
You can use this command :
* In the diagram definition, like any other commands,
* In an link::preprocessing[included file],
* In a configuration file, provided in the link::command-line[command line] or the link::ant-task[ANT task].
== Nested
To avoid repetition, it is possible to nest definition. So the following definition :
----
skinparam xxxxParam1 value1
skinparam xxxxParam2 value2
skinparam xxxxParam3 value3
skinparam xxxxParam4 value4
----
is strictly equivalent to:
----
skinparam xxxx {
Param1 value1
Param2 value2
Param3 value3
Param4 value4
}
----
== Black and White
You can force the use of a black&white output using `+skinparam monochrome true+` command.
@startuml
skinparam monochrome true
actor User
participant "First Class" as A
participant "Second Class" as B
participant "Last Class" as C
User -> A: DoWork
activate A
A -> B: Create Request
activate B
B -> C: DoWork
activate C
C --> B: WorkDone
destroy C
B --> A: Request Created
deactivate B
A --> User: Done
deactivate A
@enduml
== Shadowing
You can disable the shadowing using the `+skinparam shadowing false+` command.
@startuml
left to right direction
skinparam shadowing<> false
skinparam shadowing<> true
actor User
(Glowing use case) <> as guc
(Flat use case) <> as fuc
User -- guc
User -- fuc
@enduml
== Reverse colors
You can force the use of a black&white output using `+skinparam monochrome reverse+` command.
This can be useful for black background environment.
@startuml
skinparam monochrome reverse
actor User
participant "First Class" as A
participant "Second Class" as B
participant "Last Class" as C
User -> A: DoWork
activate A
A -> B: Create Request
activate B
B -> C: DoWork
activate C
C --> B: WorkDone
destroy C
B --> A: Request Created
deactivate B
A --> User: Done
deactivate A
@enduml
== Colors
You can use either link::color[standard color name] or RGB code.
@startuml
colors
@enduml
`+transparent+` can only be used for background of the image.
== Font color, name and size
You can change the font for the drawing using `+xxxFontColor+`,
`+xxxFontSize+` and `+xxxFontName+` parameters.
+++Example:+++
----
skinparam classFontColor red
skinparam classFontSize 10
skinparam classFontName Aapex
----
You can also change the default font for all fonts using `+skinparam defaultFontName+`.
+++Example:+++
----
skinparam defaultFontName Aapex
----
Please note the fontname is highly system dependent, so do not
over use it, if you look for portability. `+Helvetica+` and `+Courier+`
should be available on all system.
A lot of parameters are available. You can list them using the following command:
----
java -jar plantuml.jar -language
----
== Text Alignment
Text alignment can be set up to `+left+`, `+right+` or `+center+`.
You can also use `+direction+` or `+reverseDirection+` values for `+sequenceMessageAlign+`
which align text depending on arrow direction.
|===
| Param name | Default value | Comment
| sequenceMessageAlign
| left
| Used for messages in sequence diagrams
| sequenceReferenceAlign
| center
| Used for `+ref over+` in sequence diagrams
|===
@startuml
skinparam sequenceMessageAlign center
Alice -> Bob : Hi
Alice -> Bob : This is very long
@enduml
== Examples
@startuml
skinparam backgroundColor #EEEBDC
skinparam handwritten true
skinparam sequence {
ArrowColor DeepSkyBlue
ActorBorderColor DeepSkyBlue
LifeLineBorderColor blue
LifeLineBackgroundColor #A9DCDF
ParticipantBorderColor DeepSkyBlue
ParticipantBackgroundColor DodgerBlue
ParticipantFontName Impact
ParticipantFontSize 17
ParticipantFontColor #A9DCDF
ActorBackgroundColor aqua
ActorFontColor DeepSkyBlue
ActorFontSize 17
ActorFontName Aapex
}
actor User
participant "First Class" as A
participant "Second Class" as B
participant "Last Class" as C
User -> A: DoWork
activate A
A -> B: Create Request
activate B
B -> C: DoWork
activate C
C --> B: WorkDone
destroy C
B --> A: Request Created
deactivate B
A --> User: Done
deactivate A
@enduml
@startuml
skinparam handwritten true
skinparam actor {
BorderColor black
FontName Courier
BackgroundColor<< Human >> Gold
}
skinparam usecase {
BackgroundColor DarkSeaGreen
BorderColor DarkSlateGray
BackgroundColor<< Main >> YellowGreen
BorderColor<< Main >> YellowGreen
ArrowColor Olive
}
User << Human >>
:Main Database: as MySql << Application >>
(Start) << One Shot >>
(Use the application) as (Use) << Main >>
User -> (Start)
User --> (Use)
MySql --> (Use)
@enduml
@startuml
skinparam roundcorner 20
skinparam class {
BackgroundColor PaleGreen
ArrowColor SeaGreen
BorderColor SpringGreen
}
skinparam stereotypeCBackgroundColor YellowGreen
Class01 "1" *-- "many" Class02 : contains
Class03 o-- Class04 : aggregation
@enduml
@startuml
skinparam interface {
backgroundColor RosyBrown
borderColor orange
}
skinparam component {
FontSize 13
BackgroundColor<> LightCoral
BorderColor<> #FF6655
FontName Courier
BorderColor black
BackgroundColor gold
ArrowFontName Impact
ArrowColor #FF6655
ArrowFontColor #777777
}
() "Data Access" as DA
[Web Server] << Apache >>
DA - [First Component]
[First Component] ..> () HTTP : use
HTTP - [Web Server]
@enduml
@startuml
[AA] <>
[BB] <>
[CC] <>
node node1
node node2 <>
database Production
skinparam component {
backgroundColor<> DarkKhaki
backgroundColor<> Green
}
skinparam node {
borderColor Green
backgroundColor Yellow
backgroundColor<> Magenta
}
skinparam databaseBackgroundColor Aqua
@enduml
== List of all skinparam parameters
Since the documentation is not always up to date, you can have the complete list of parameters using this command:
----
java -jar plantuml.jar -language
----
Or you can generate a "diagram" with a list of all the skinparam parameters using `+help skinparams+`.
That will give you the following result, from this page __(code of this command)__:
* https://github.com/plantuml/plantuml/blob/master/src/net/sourceforge/plantuml/help/CommandHelpSkinparam.java[CommandHelpSkinparam.java]
@startuml
help skinparams
@enduml
You can also view each skinparam parameters with its results displayed at the page https://plantuml-documentation.readthedocs.io/en/latest/formatting/all-skin-params.html[`+All Skin Parameters+`] of https://plantuml-documentation.readthedocs.io/en/latest/index.html#[`+Ashley's PlantUML Doc+`]:
* https://plantuml-documentation.readthedocs.io/en/latest/formatting/all-skin-params.html[https://plantuml-documentation.readthedocs.io/en/latest/formatting/all-skin-params.html].