State and sub states background

0 votes
asked Oct 14, 2022 in Question / help by Vincent

Hello,

How can I set the background of "MainState" so it is blue like the title ?

@startuml

state MainState #lightblue{
  state SubA #LightGreen
}

@enduml

Thanks !

1 Answer

0 votes
answered Oct 14, 2022 by plantuml (295,800 points)

It's not really possible this way. You should probably use stereotype instead:

@startuml
<style>
.foo {
  state,stateBody {
    BackGroundColor lightblue;
  }
}
</style>

state MainState <<foo>> {
  state SubA
}
@enduml

Hope this helps!

PS: Edited as the example was not correct

commented Oct 14, 2022 by Vincent
Thanks, it worked !
...