Change color of sprite?

0 votes
asked Jan 9, 2019 in Question / help by SJrX (120 points)

I was wondering if it was possible to change the color of a sprite inline or in a macro, similar to how the colors look for different access types (e.g., red square for private fields, yellow diamond for protected), but with arbitrary sprites). It seems like it's supported, but I want to use them at certain points, and then declare them in the legend with the color.

Something like the following, or 

!include <tupadr3/common>
!include <tupadr3/font-awesome/star>
class Foo {
 <&x{scale=0.25,color=#FF0000}> someBadField
 <$star{scale=0.25,color=#AAAA00} something else }

2 Answers

+1 vote
answered Jan 9, 2019 by Serge Wenger Work (14,160 points)

A possible solution is:

sprite Netw jar:archimate/network
!include <tupadr3/font-awesome/star>
class Foo {
 <color:#FF0000><&x></color> someBadField
 <color:#AAAA00><$star*0.25></color> something else

0 votes
answered Jan 9, 2019 by plantuml (257,860 points)

The current syntax is indeed not very convenient.

With last beta you can have :

 <&x{scale=2.25,color=#FF0000}> someBadField
 <$star{scale=0.50,color=#FF0000}> other
 <&x*2.25,color=green> someBadField
 <$star*0.50,color=blue> other

Does it sound better this way ?

commented Jan 10, 2019 by SJrX (120 points)
Yes thank you very much!