Repeat: Plus Colour

0 votes
asked Jan 16, 2020 in Bug by CALUM

If you use the Repeat option described here:

https://forum.plantuml.net/5826/please-provide-action-repeat-loop-start-instead-condition?show=5826#q5826

:A;
repeat: #RED:B;
repeat while (C)
:D;

#RED: is not interpreted, whereas

:A;
repeat

#RED:B;
repeat while (C)
:D;

The colour is shown properly but a diamond appears at the start of the repeat loop.

Also - the shape can not be anything except a curved rectangle, so if you do:

:A;
repeat:B]
repeat while (C)
:D;

The shape is a curved rectangle with B] in it not a square rectangle with B in it.

1 Answer

0 votes
answered Jan 17, 2020 by plantuml (294,960 points)

Thanks for your report.

We've made several corrections in last beta http://beta.plantuml.net/plantuml.jar

Aout your first example, the correct syntax is:

@startuml
:A;
#red:repeat :foo;
#blue:D;
repeat while (C)
:D;
@enduml

Tell us if you find other issues!

commented Jan 26, 2020 by Calum

Thanks for this.  I've found an issue!

@startuml

skinparam activity {

  BackgroundColor<<MyGreen>> LightGreen

}

:A;

<<MyGreen>>:repeat :B;

repeat while (C) 

@enduml

Fails.  sad

Using #LightGreen works but I want to be able to set the colour using a script...

Failure message is that repeat can not be found - it obviously doesn't look past the <<

commented Jan 27, 2020 by plantuml (294,960 points)
Thanks for the report.

This is fixed in last beta http://beta.plantuml.net/plantuml.jar

There are probably some other issues, so please go on with your tests! :-)
commented Jan 31, 2020 by anonymous

Not sure this is fixed in the beta.  I have however found a possible workable solution.

@startuml

!$Colour = "Blue"

:A;
#$Colour:repeat :B;
repeat while (C)

@enduml

...