ArrowColor for stereotype not working

+2 votes
asked Aug 30, 2017 in Bug by nikhil (520 points)
skinparam not working with ArrowColor stereotype.

for exampe :

skinparam class {

ArrowColor<<greenColor>> Green

}

is not working. But,

skinparam class {

ArrowColor Green

}

is working.

Is this supported or a bug? Or am I doing anything wrong here?
commented Jan 31, 2025 by frustrated
At the time of writing, you CAN assign stereotypes to relationships in class diagrams (in the same way as labels) but styling them still doesn't work.

This thread was posted EIGHT YEARS ago, and yet even today, class diagrams are the only type of diagram where there is no way of defining formatting of relations other than globally, or by copy-and-pasting the style you want into every single relation you need to use it for. And that's despite the change to the <style>-based syntax that was intended to eliminate this kind of inconsistency between diagram types.
commented Feb 3, 2025 by The-Lu (89,200 points)
commented Apr 20 by The-Lu (89,200 points)

FYI:

This is now fixed (on next v1.2026.3) by:

By using:
@startuml
<style>
.a {
  LineColor green
}
</style>

class A
class B
A -> B <<a>>
@enduml
Enjoy,
Regards,
Th.

1 Answer

0 votes
answered Aug 30, 2017 by plantuml (298,780 points)
selected Sep 7, 2017 by nikhil
 
Best answer

The real issue is that stereotypes apply to classes only and not to arrows.

So something like "ArrowColor<<greenColor>> Green" should apply to arrows that are stereotyped to <<greenColor>>, and right now you cannot define stereotype arrows.

We could imagine that "ArrowColor<<greenColor>> Green" would apply if one of the classes connected by the arrow would have <<greenColor>> stereotype.

Is this what you are expecting ?

Putting it differently, in the following example, are you expecting the arrow to be drawn in red ?

@startuml
skinparam class {
    ArrowColor Green
    ArrowColor<<stereo1>> Red
}
class foo1 <<stereo1>>
class foo2 <<stereo1>>
foo1 --> foo2
@enduml

commented Sep 7, 2017 by nikhil (520 points)
Thanks for your reply.

Yes I am expecting the arrow to be in Red color but that is not possible with stereotype.

However, for now I have got the alternative -
foo1 -[#Red]-> foo2

But it would be great if stereotype support for Arrows can also be added. :)
commented Sep 23, 2018 by dmf19 (380 points)
You can improve on this by using a macro.

!define MY_CUSTOM_ARROW -[#Red]->

foo1 MY_CUSTOM_ARROW foo2
...