How to define background color to sprite in legend?

0 votes
asked Oct 15, 2020 in Question / help by cilerler (200 points)

The code at the bottom generates the output below.  How can I set the sprite's background color (white) to the background color (purple)?

@startuml Archimate

skinparam defaultTextAlignment center
skinparam backgroundColor #EEEBDC

skinparam Legend {
    BackgroundColor #EEEBDC
    FontColor #000000
    BorderThickness 0
}

!define ICONURL https://raw.githubusercontent.com/tupadr3/plantuml-icon-font-sprites/v2.2.0
!include ICONURL/common.puml
!include ICONURL/devicons2/docker.puml

skinparam componentStyle rectangle
skinparam ArrowColor #546E7A

!define _dockerbackgroundcolor #7B1FA2
!define _dockercolor #CE93D8
!define _dockercoloralternate #F48FB1
!define _dockertextcolor #FFFFFF

DEV2_DOCKER(app1,<color:_dockertextcolor>FileMonitor,component,_dockercolor) _dockerbackgroundcolor
DEV2_DOCKER(app2,<color:_dockertextcolor>DataAPI,component,_dockercoloralternate) _dockerbackgroundcolor

app1 -down-> app2

legend right
|<_dockerbackgroundcolor><color:_dockercolor><$docker>    | App1 |
|<_dockerbackgroundcolor><color:_dockercoloralternate><$docker> | App2 |
endlegend

@enduml

1 Answer

+1 vote
answered Oct 20, 2020 by plantuml (295,000 points)
selected Oct 21, 2020 by cilerler
 
Best answer

Thanks for the report !

This issue has just been fixed in last beta http://beta.plantuml.net/plantuml.jar and in the online server.

Tell us if it's not working for you.

Regards,

commented Oct 21, 2020 by cilerler (200 points)

Thanks, it is working; however, it doesn't allow me to leave a space from the left side where it does for the right side.

commented Oct 21, 2020 by Serge Wenger Work (15,620 points)

Hello, 

As workaround, you can add spaces with Unicode:


|<_dockerbackgroundcolor><color:_dockercolor><U+0020><U+0020><$docker>    | App1 |

commented Oct 21, 2020 by cilerler (200 points)

Perfect, thank you!

Just so you know, I realized that the issue was where I placed the spaces

This is what I did

|    <_dockerbackgroundcolor><color:_dockercolor><$docker>    | App1 |

This is what I should do based on your example (and it worked as expected)

|<_dockerbackgroundcolor><color:_dockercolor>    <$docker>    | App1 |
...