change color for group in sequence diagrams

0 votes
asked Jan 23 in Question / help by andreas.kagedal (300 points)

As far as I understand, the way to change colors for elements (like for instance a note box) in a sequence diagram is described like this:

* #[color|back:color];header:color;line:color;line.[bold|dashed|dotted];text:color

But this does not work for group/alt/opt/break boxes where it is only possible to control the background color. not the colors of the lines (and not dashed lines or gradients).

Is this planned to be supported in the future?

This works:

@startuml
group #pink MyGroup
Bob -> Alice : hello
end group
@enduml

But this does not work:

@startuml
group #pink;line:pink MyGroup
Bob -> Alice : hello
end group
@enduml

1 Answer

0 votes
answered Jan 23 by The-Lu (64,760 points)

Hello A., and all,

For that you can use style, as:

@startuml
group #palegreen MyGroup
Bob -> Alice : hello
end group
<style>
group {
  LineColor pink
  BackgroundColor pink
}
</style>
group MyPinkGroup
Bob -> Alice : hello
end group
@enduml

See also:

Enjoy,
Regards,
Th.

commented Jan 23 by andreas.kagedal (300 points)
Ah, That works. Thanks!

If I understand correctly, if you want to change the style for only one specific group you will have to have a <style>...</style> both before and after the group.
...