How to change color of single switch diamond in activity diagram

0 votes
asked Mar 22, 2022 in Closed feature request by kark

Hi all, fantastic tool!

I encountered a small hiccup, I cannot seem to be able to find the syntax for changing the background color for a single diamond in a switch case in the activity diagram (new/beta).

I can change all of them through 

skinparam activityDiamondBackgroundColor White/Yellow

but I can't seem to get a style syntax or a # syntax to work to change the color of a single diamond in the switch.

Thanks!

1 Answer

0 votes
answered Mar 22, 2022 by The-Lu (64,340 points)

Hello K.,

For that you can use style, but it concerns the two diamonds (the first of the test, and the last of the 'endswitch'), you can not change colour separately, but sequentially, as:

@startuml
<style>
diamond {
  BackgroundColor White/Yellow
}
</style>

start
switch (test?)
case ( condition A )
  :Text 1;
case ( condition B ) 
  :Text 2;

<style>
diamond {
  BackgroundColor palegreen
}
</style>

endswitch

switch (test2?)
case ( condition A2 )
  :Text 12;
case ( condition B2 ) 
  :Text 22;

<style>
diamond {
  BackgroundColor red
}
</style>

endswitch
stop
@enduml

Enjoy,
Regards.

...