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

时间:2016-07-19 07:22:55

标签: plantuml

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

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

植物UML代码

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

结果图

enter image description here

1 个答案:

答案 0 :(得分:9)

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

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

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

结果:

enter image description here