stereotype specific skinparam "ArrowFontColor" cannot be changed

0 votes
asked Feb 26, 2021 in Question / help by kirchsth (2,880 points)

 How can I change the arrow font color debending on a stereotyp? Following version is not working

skinparam arrow<<v1.0>> {
    FontColor Red
}

 I tried it with 

skinparam arrow<<v1.0>> {
    Color  Text:Red
}

but then I cannot combine it with another stereotype, sample see below

@startuml
' init with default values
skinparam arrow {
    FontColor Gray
    Color Gray
}

skinparam component {
    FontColor #Gray
    BorderColor #Gray
    BackgroundColor #White
}

' component color can be changed individual (and combined)
skinparam component<<v1.0>> {
    FontColor Red
}
skinparam component<<v1.1>> {
    BorderColor Red
}

' font arrow color cannot be changed individual
skinparam arrow<<v1.0>> {
    FontColor Red
}
' arrow color can be changed individual
skinparam arrow<<v1.1>> {
    Color Red
}

' simulate expected combination
skinparam arrow<<v1.0&v1.1>> {
    Color  Red;Text:Red
}

[oldClient]
[newClient]
[oldComponent]<<v1.0>>
[newComponent]<<v1.1>>

[mixedComponent]<<v1.0>><<v1.1>>
[mixedClient]

oldClient --> oldComponent <<v1.0>>: "use v1.0 interface\ntext should be red"
newClient --> newComponent <<v1.1>>: "use v1.1 interface"
mixedClient --> mixedComponent <<v1.0>><<v1.1>>: "use v1.0 and\nv1.1 interfaces"

mixedClient --> mixedComponent <<v1.0&v1.1>>: "it should look\nlike this"
@enduml

 

1 Answer

0 votes
answered Jun 17, 2021 by noltem (140 points)
I did not get the stereotype dependent coloring of arrow text to work.

As a workaround, I set the arrow text individual by setting HTML styles

a --> b  : "<color:red>Red text"
a -> c  : "<color:green>Green text"
commented Jun 17, 2021 by kirchsth (2,880 points)

Thank you but it didn't help for me (I want to handle everything via stereotypes that I can combine multiple styles, ...).

Your solution has problems with line breaks, ... Maybe following format is better for your problem that you don't have to mix labels with text format

```

@startuml
[mixedClient] --> [mixedComponent] : "<color:red>only first\nline is red"
[mixedClient] --> [mixedComponent] #line:green;line.dotted;text:red : "first and\nsecond line red"
@enduml

```

BR Helmut

...