我试着把植物的一部分放在有if else条件的地方,换成不同的颜色。我知道下面这样的块可以用来给结束状态着色,但我正在尝试给plantUml中的决策部分(if plantUml )着色。这有可能吗?
@startuml
if (color it) then (yes)
#Orange: Colored;
else (no)
: Not Colored;
endif;
@enduml
发布于 2018-08-07 07:45:12
问题不是100%清楚的,一张你想要的图片可能会更好。根据我所看到的解决方案:
@startuml
if (color it) then (yes)
#Orange: Colored;
else (no)
#Transparent : Not Colored;
endif;
@enduml
编辑:在重新讨论这个问题后,我认为它有点清楚了。可能是你想使用像skinparam ActivityDiamondBackgroundColor green
这样的skinparamer
,所以得到:
@startuml
skinparam ActivityDiamondBackgroundColor green
if (color it) then (yes)
#Orange: Colored;
else (no)
#Transparent : Not Colored;
endif;
@enduml
结果是:
发布于 2020-02-11 10:23:16
正如艾伯特所建议的,皮肤参数ActivityDiamondBackgroundColor可以作为一种解决方案,但它有一个缺点,它会更新图中的所有if元素:
@startuml
skinparam ActivityDiamondBackgroundColor green
if (color it) then (yes)
#Orange: Colored;
else (no)
#Transparent : Not Colored;
endif;
if (default color) then (yea)
:Ok;
endif
@enduml
还有另一种方法可以仅在if菱形中的文本下更新背景颜色:
@startuml
if (<back:green>color it) then (yes)
#Orange: Colored;
else (no)
#Transparent : Not Colored;
endif;
if (default color) then (yea)
:Ok;
endif
@enduml
对我来说,这看起来很草率。但据我所知,这是唯一能给单个if钻石上色的方法。
https://stackoverflow.com/questions/51716775
复制相似问题