Multiline Participant Color

0 votes
asked Mar 8 in Question / help by anonymous
Hi, I'm defining multiline participants like this one:

```
participant Consumer [
  =Consumer
  ----
  ""N amount of consumers""
]

```

The participant box is taking a default color it is a way to change it?

1 Answer

0 votes
answered Mar 9 by dickmaley (4,120 points)

Here is an example

image

@startuml

<style>
  participant {
    BackGroundColor: #white/aqua;
    FontColor: black;
    FontSize: 14;
    FontStyle: bold;
    HorizontalAlignment: right;
    LineColor: blue;
    LineThickness: 3;
  }

</style>

participant Consumer [
  =Consumer
  ----
  ""N amount of consumers""
]

participant Participant as Foo
actor Actor as Foo1
boundary Boundary as Foo2
control Control as Foo3
entity Entity as Foo4
database Database as Foo5
collections Collections as Foo6
queue Queue as Foo7
Foo -> Foo1 : To actor
Foo -> Foo2 : To boundary
Foo -> Foo3 : To control
Foo -> Foo4 : To entity
Foo -> Foo5 : To database
Foo -> Foo6 : To collections
Foo -> Foo7: To queue
@enduml

commented Mar 10 by anonymous
Hi, awesome! Thank you, do you know if it is possible to apply the styles to an specific participant? I have a few of them that I don't want to change.
commented Mar 10 by The-Lu (79,040 points)

Hello A.,

For that, you can use local style by stereotype, as:

@startuml

hide stereotype

<style>
  .a {
    BackGroundColor: #white/aqua;
    FontColor: black;
    FontSize: 14;
    FontStyle: bold;
    HorizontalAlignment: right;
    LineColor: blue;
    LineThickness: 3;
  }
  .b {
    BackGroundColor: #pink/red;
    FontColor: black;
    HorizontalAlignment: left;
    LineColor: red;
    LineThickness: 1;
  }
</style>

participant C1 <<a>> [
  =Consumer
  ----
  ""N amount of consumers""
]

participant C2 <<b>> [
  =Consumer
  ----
  ""N amount of consumers""
]

participant C3  [
  =Consumer
  ----
  ""N amount of consumers""
]

participant Participant as P

C1 -> C2
C2 -> C3
C3 -> P

@enduml

Enjoy,
Regards,
Th.

...