Color individual conditional in activity diagram

0 votes
asked Dec 7, 2023 in Question / help by anonymous
https://stackoverflow.com/a/60166689/ suggests that the only way to color it is to change all the conditional colors using a skin param or changing the background of the text. Is there a way to change the color of the conditional on an individual basis?

1 Answer

0 votes
answered Dec 8, 2023 by The-Lu (64,760 points)

Hello A., and all,

For that you can use local style, as:

@startuml
<style>
activityDiagram {
  diamond {
    BackgroundColor palegreen
    FontColor blue
}
</style>
skin debug
:A;
if (decision) then (yes)
    :B;
else (no)
endif
<style>
activityDiagram {
  diamond {
    BackgroundColor pink
    FontColor red
}
</style>
:C;
if (decision) then (yes)
    :D;
else (no)
endif
@enduml

FYI, that is:

  • OK for BackgroundColor
  • but KO for FontColor --> There is on issue on `FontColor`, which seems to be global not local! wink

Enjoy,
Regards,
Th.

commented Dec 8, 2023 by anonymous
Is there a way to reference this Style across multiple elements without pasting the same style everywhere?
...