Tuesday 28 November 2023

Add colors to the component in PlantUML

Using #color notation, we can add colors to the component.

Example

component "Balance Enquiry" as BE #Yellow
[Cash Withdrawl] as CE #PaleGreen

componentColors.txt

@startuml

[User]

package "ATM Machine" {
	component "Balance Enquiry" as BE #Yellow
	[Cash Withdrawl] as CE #PaleGreen
	component [Amount Deposit] #Aqua
	[Request Loan] #Gold
	[Transfer Amount] #Silver
}

package "Bank Server"{
	cloud {
		[Account Manager] #red
	}
}

package "Loan Server"{
	cloud {
		[Loan management system] #LightBlue
	}
}

[User] --> [BE]
[User] --> [CE]
[User] --> [Amount Deposit]
[User] --> [Request Loan]
[User] --> [Transfer Amount]

[BE] --> [Account Manager]
[CE] --> [Account Manager]
[Amount Deposit] --> [Account Manager]
[Transfer Amount] --> [Account Manager]

[Request Loan] --> [Loan management system]

[Loan management system] --> [Account Manager]

@enduml

Above snippet generate below diagram.


 

Previous                                                    Next                                                    Home

No comments:

Post a Comment