如何为工厂 UML 组件图中的单个箭头着色

How do I color a single arrow in a plant UML component diagram

从文档中可以清楚地了解如何使用 skinparam 为所有箭头着色,我可以使用颜色更改组件的整体颜色。我只是不清楚如何只给箭头上色。

例如在下面的示例中,如何使从 component1 到 component3 的箭头具有不同的颜色

Plant UML 代码

@startuml
  [Component1] as 1
  [Component2] as 2
  [Component3] as 3
  1 --> 2
  1 --> 3
@enduml

结果图

在要着色的箭头内的括号内添加颜色:1 -[#blue]-> 3

您也可以使用十六进制颜色代码:例如 #0000FF 而不是 #blue

@startuml
  [Component1] as 1
  [Component2] as 2
  [Component3] as 3
  1 --> 2
  1 -[#blue]-> 3
@enduml

结果: