Is it possible to color split in an Activity Diagram (new)?

0 votes
asked Oct 27, 2022 in Question / help by cheng13231 (120 points)

I'd like to color split in an Activity Diagram. Is it possible? I know that I can use ActivityBarColor to color a fork, is there a similar way for split?

@startuml
skinparam ConditionEndStyle hline
start
  -[#DeepSkyBlue]->
  split
    -[#DeepSkyBlue]->
    :1;
    -[#DeepSkyBlue]->
  split again
    -[#DeepSkyBlue]->
    :3;
    -[#Orange]->
    :4;
    -[#DeepSkyBlue]->
  endsplit
  -[#DeepSkyBlue]->
end
@enduml

https://www.plantuml.com/plantuml/uml/SoWkIImgAStDuIhEpimhI2nAp5LmpizBoIp9pCzppKi9BgdCILN8oCdCI-K2A-LIKD2DLdP9JIq8pgvqoYbDZTMr0ueL5-HaWkImoWA1bQ4raCQZLo4nFJ4p3vy9nd0J_8iIyz8H4YQuZKxDIu6v35CQACdb02I0lWS0

1 Answer

0 votes
answered Oct 28, 2022 by plantuml (295,000 points)
selected Oct 29, 2022 by cheng13231
 
Best answer

This may be not very logical, but splits use default arrow color, so you can have:

@startuml
<style>
activityDiagram {
  arrow {
    LineColor red;
  }
}
</style>

start
  -[#DeepSkyBlue]->
  split
    -[#DeepSkyBlue]->
    :1;
    -[#DeepSkyBlue]->
  split again
    -[#DeepSkyBlue]->
    :3;
    -[#Orange]->
    :4;
    -[#DeepSkyBlue]->
  endsplit
  -[#DeepSkyBlue]->
end
@enduml

Is this what you are looking for? 

Or do you want to change the color of some individual split? (which is not possible yet...)

commented Oct 29, 2022 by cheng13231 (120 points)

In my real use case, some arrows should be kept as the color black. But your demo is definitely a workaround for me, I can live with it (see example below). Thanks.

@startuml
skinparam ConditionEndStyle hline

<style>
activityDiagram {
  arrow {
    LineColor Red;
  }
}
</style>

start
  -[#DeepSkyBlue]->
  split
    -[#DeepSkyBlue]->
    :1;
    -[#DeepSkyBlue]->
    if (exists?) then (yes)
      -[#DeepSkyBlue]->
      :2;
      -[#DeepSkyBlue]->
    else (no)
      -[#Black]->
    endif
    -[#DeepSkyBlue]->
  split again
    -[#DeepSkyBlue]->
    :3;
    -[#Orange]->
    :4;
    -[#DeepSkyBlue]->
  endsplit
  -[#DeepSkyBlue]->
end
@enduml

https://www.plantuml.com/plantuml/uml/VP1FIyD04CNl-oa6lAI78luvcL9BMs-2O8_YOMYcwP39RDZTg47wtPqKhO9DBili-ysRuSqY9WofhSN5YhN1W3Mil1QSsEk35flK2S5UMCcvMUn_SuVRn6-SkZLZsHi-7G26uD-F5S2ZTQ-y-03FLEGc7Tp1pIw_tUwuqjJfoyMQgDbKtL9QUftEJOkDSC_EKu2xgto4yWuo-k2Oulq4qfuKiexYnDYmnsPUvwCT994WK_zdpb9mMvsudMjdrKWYm19PntBTd78z1TJo5zmE1xR5F_VwZmswXJrjBLy0

...