Is it possible to change the foreground color of a Box element?

0 votes
asked Feb 4 in Question / help by gbrusella (220 points)

On this Scenario, can I change the foreground color of the "New box"?

@startuml Demo Scenario

!pragma teoz true

box "Product boundary" #PaleVioletRed
    participant P1 [
        Participant 1
        ....
        Subtitle
    ]
    participant "Participant A" as DemoA
endbox
box "New Box" #Orange
    participant "Participant B" as DemoB
endbox

P1 -> DemoA
    DemoA <-> DemoB: Do something
DemoA -> P1
@enduml

Thanks!

3 Answers

0 votes
answered Feb 5 by The-Lu (79,040 points)

Hello G.,

Currently only the background and not the foreground!

  • What is your precisely your request?

Regards,
Th.

commented Feb 5 by gbrusella (220 points)

In the ideal universe, I can also control the foreground color of individual boxes. The color today is auto-selected, An example could be:

@startuml Demo Scenario

!pragma teoz true

box "Product boundary" #PaleVioletRed
    participant P1 [
        Participant 1
        ....
        Subtitle
    ]
    participant "Participant A" as DemoA
endbox
box "New Box" #Red/Orange #White
    participant "Participant B" as DemoB
endbox

P1 -> DemoA
    DemoA <-> DemoB: Do something
DemoA -> P1
@enduml

commented Feb 5 by The-Lu (79,040 points)

Hello G.,

I still have a little trouble understanding.

  • What do you want that will be white?

Regards,
Th.

commented Feb 6 by anonymous
Is this what you are looking for?

@startuml
<style>
  participant {
    BackGroundColor white
    FontColor blue
    FontSize:: var(--default-FontSize);
    FontStyle bold
    LineColor black
  }   

</style>
!pragma teoz true
title Demo Scenario

box "Product boundary" #PaleVioletRed
    participant P1 [
        Participant 1
        ....
        Subtitle
    ]
    participant "Participant A" as DemoA
endbox
box "New Box" #Red/Orange
    participant "Participant B" as DemoB
endbox

P1 -> DemoA
    DemoA <-> DemoB: Do something
DemoA -> P1
@enduml
commented Feb 6 by gbrusella (220 points)

I finally found the way:

Look:

 

www.plantuml.com/plantuml/png/VP11IyD048Nl-ol6zApIQocbZSMZ1WjUnCCq6UBItPqwcSMg-D-T9YKj2BvBoFlWsySiEqNH78FhTZxjKJ32XjupfPfAFipd3_HXtyK2lXsKMEzQuPoQEmuiC7aKJ2tTFb5ZaAKX6S0napNAhYVtdFJS6ob39lVZtDLUi8q8Ilm5AbPk-G159TpaMc5xV0dbiu19XO6UFGVItcYngUfhlyUaK4tXnS4frGMOZksDPVpPvArw3TGNhtzqnQLYLG1siAR8AqUfiO5kM6c70RjC0USR_MygHrCvccpvzMAmps2L06lrd8wUeOJv2PSpM3Dq74dVV6hTG0rMKxSqMuxX5m00

0 votes
answered Feb 6 by anonymous
@startuml
<style>
  participant {
    BackGroundColor white
    FontColor blue
    FontSize:: var(--default-FontSize);
    FontStyle bold
    LineColor black
  }   

</style>
!pragma teoz true
title Demo Scenario

box "Product boundary" #PaleVioletRed
    participant P1 [
        Participant 1
        ....
        Subtitle
    ]
    participant "Participant A" as DemoA
endbox
box "New Box" #Red/Orange
    participant "Participant B" as DemoB
endbox

P1 -> DemoA
    DemoA <-> DemoB: Do something
DemoA -> P1
@enduml
0 votes
answered Feb 9 by The-Lu (79,040 points)

Hello G.,

Then, adapted from your answer:

Here is a version with new style:

@startuml
<style>
.NewBox {
  Box {
    BackgroundColor #Orange/Red
    LineColor       #DarkRed
    FontColor       #Blue
  }
}
</style>

!pragma teoz true
box "Product boundary" #PaleVioletRed
    participant P1 [
        Participant 1
        ....
        Subtitle
    ]
    participant "Participant A" as DemoA
endbox

box "New Box" <<NewBox>>
    participant "Participant B" as DemoB
endbox

P1 -> DemoA: An action
    DemoA <-> DemoB: Do something
DemoA -> P1
@enduml

Enjoy,
Regards,
TH.

...