Please provide a way to change background and border color of connectors in activity diagrams

0 votes
asked Apr 14 in Wanted features by Marcelo

Hi there! I was trying to set the background color and border color of connectors in activity diagrams. Apparently, there is not a "skinparam connector". I also tried with HTML styling, but no success.

Still, it is possible to change the background color inline, like this:

' #white:(A)

but it is not possible to set its border color. I tried several things and couldn't make it work. Would it be possible?

This is similar to https://forum.plantuml.net/5340/please-provide-a-way-to-inline-style-use-cases-border-color

commented Apr 17 by Marcelo

An example (I appreciate feedback if something is/seems/is wrong):

@startuml
' Activity diagram definitions BEGIN

skinparam style strictuml
skinparam nodesep 800 'pixels

skinparam arrow {
  Thickness 1.2
  Color #000000
}

skinparam conditionStyle diamond

skinparam activity {
  BackgroundColor #FFFFFF
  BorderColor #000000
  BorderThickness 1.2
}

skinparam activityDiamond {
  BackgroundColor #FFFFFF
  BorderColor #000000
  BorderThickness 1.2
}

skinparam rectangle {
  BackgroundColor #FFFFFF
  BorderColor #000000
  BorderThickness 1.2
}

' To change connector background color, I had to use:
'#white:(A)
' But I couldn't change the line color inline.

' I could style the circle...
<style>
activityDiagram {
  circle {
    Backgroundcolor lightblue /' ...but it also changes the background of start and stop of activities. '/
    LineColor red
    LineThickness 2
  } 
}
</style>

start
  :Check request;
  if () then ([unfeasible]\n)
    #white:(A)  /' Inline color works. '/
  else (\n[feasible])
    ' Continue
  endif
  :Analyze impact;
  :Impact analysis\n       report;<<task>> /' An object, actually. '/
  if () then ([prohibitive]\n)
    (A)
  else (\n[non-prohibitive])
    ' Continue
  endif
  repeat
    :Implement modification;
    :Test modification;
  repeatwhile ([failed]\n)
  ->[approved];
stop

(A)
:Reject request;
stop
@enduml

1 Answer

0 votes
answered Apr 14 by The-Lu (83,700 points)

Hello M.,

For that, you can use style and style the circle element as:

@startuml
<style>
circle {
  Backgroundcolor palegreen
  LineColor green
  LineThickness 2
}
</style>

(1)
:a;
(A)
@enduml

Enjoy,
Regards,
Th.

commented Apr 17 by Marcelo

Hello, thanks for the reply.

This sets the background for ALL circle shapes, including start and stop.
I tried to use the following available skinparam to overwrite this behavior (not ideal, but they were my attempts to a workaround):

  • ActivityStart
  • ActivityEnd
  • ActivityStop

They indeed change the circle style, but the ActivityStop BackgroundColor doesn't change, so it is currently unfeasible to choose a general style for connectors.

...