plantuml / plantuml

Generate diagrams from textual description
https://plantuml.com
Other
9.73k stars 881 forks source link

[Style] How to color the activated lifeline with the css style? #1109

Open gotson opened 1 year ago

gotson commented 1 year ago

Hi,

i am trying to use the new CSS Style, and it's working quite well so far.

However I can't style the activated lifeline of a participant using a stereotype.

Here is a sample:

@startuml
hide stereotype
<style>
.alice {
    actor {
        FontColor: Black;
    }
    participant {
        FontColor: White;
    }
    BackGroundColor: #29284F;
    lifeline {
        LineColor: #29284F;
    }
}

.bob {
    actor {
        FontColor: Black;
    }
    participant {
        FontColor: White;
    }
    BackGroundColor: #EE0351;
    lifeline {
        LineColor: #EE0351;
    }
}
</style>

participant Alice <<alice>>
participant Bob <<bob>>

Alice -> Bob++: Hello
Alice <- Bob--: Hi

@enduml

And the result:

Screenshot 2022-08-31 at 18 07 02

How can i get the activated lifeline of Bob to be of the same color as Bob's background color?

demideus commented 1 month ago

Alice -> Bob: Hello activate Bob #EE0351 Alice <- Bob--: Hi

image

gotson commented 1 month ago

Thanks @demideus however this doesn't work with the style sheet

The-Lum commented 1 month ago

Hi all,

Yes there is a bug... Currently that is only possible for global purpose, nether locally, nether with stereotype...

Here is an example:

@startuml
hide stereotype
<style>
.alice {
    actor {
        FontColor: Black;
    }
    participant {
        FontColor: White;
    }
    BackGroundColor: #29284F;
    lifeLine {
        LineColor: #29284F;
        BackGroundColor: #29284F;
    }
}

.bob {
    actor {
        FontColor: Black;
    }
    participant {
        FontColor: White;
    }
    BackGroundColor: #EE0351;
    lifeline {
        LineColor: #EE0351;
        BackGroundColor: #EE0351;
    }
}
lifeLine {
    BackGroundColor: #EE0351;
}

</style>

participant Alice <<alice>>
participant Bob <<bob>>

Alice -> Bob++: Hello
Alice <- Bob--: Hi

<style>
lifeLine {
    BackGroundColor #29284F;
}
</style>
Bob -> Alice++: How are you?
Bob <- Alice--: Fine

<style>
lifeLine {
    BackGroundColor #EE0351;
}
</style>
Alice -> Bob++: Hello
Alice <- Bob--: Hi
@enduml

Regards, Th.