How to use different colors for two rectangle and how toset distance between thes two rectangles to zero?

0 votes
asked May 19, 2022 in Question / help by newNoob (140 points)
I tried to give each rectangle  different color but unfortunately it did not work, and i want the horizontal distance between those two rectangles to be zero, Any Idea?

http://www.plantuml.com/plantuml/uml/rP9FIyD04CNl-ocMUXEAIMn198PYeE1PZu9iacawT3CRPgSjMlpkhfiISoXuyEISNjuly-V1hhmObdrdbTyXzOPDfviUzI999exVciOTaLgzCTR3X5IcthNizjJKpZhMmePyG42YrEG_XbeCjHRqIUbGiQLqJC0wNKRhMO31oNiFQqTInd5NbGqB8hveFexhpsWTQs2E6-2pdoJBzAvKwZDSzNFBBFVu0VTPLhoWXEyql_asYbSQG5hacx1MnsmFnoqA54W7z5XPc1-01MjZvo5mZTIEpM-X_ZZYMZy9T3eTLJQgszdfjnpPlyWngiK5jHnIhe2Qy3g_0000

I tried to add

<style>
document {
  Margin 0
}
</style>

but it did not work and margin was removed just bottom and right from the document, and how can i remove here top and left,

Thanks alot

1 Answer

0 votes
answered May 19, 2022 by The-Lu (63,920 points)
selected May 19, 2022 by newNoob
 
Best answer

Hello N.,

Here is a proposal, with `skinparam nodesep 1` and `#gold`/`#MediumBlue` colours, as:

@startuml
skinparam backgroundcolor transparent
skinparam nodesep 1

skinparam rectangle {
    roundCorner 15
    StereotypeFontColor #black
    FontColor #black
    BackgroundColor #FFFFFF
    BorderColor #00518C
}

rectangle "<size:22>Title 1</size>\n\n____\n\n* Item 1\n* Item 2\n* Item 3" #gold

rectangle "<size:22>Title 2</size>\n\n____\n\n* Item 1\n* Item 2\n* Item 3\n* Item 4\n* Item 4\n* Item 5" #MediumBlue
@enduml

If that can help,
Regards,
Th.

commented May 19, 2022 by newNoob (140 points)
edited May 19, 2022 by newNoob

@The-Lu Thanks alot it is very helpful, but for color i meant rectangl's border color, is there way to change it like inline style or better approach

commented May 19, 2022 by The-Lu (63,920 points)

Hello N,

For rectangle's boder color, you can use:

  • inline style with:
@startuml
skinparam backgroundcolor transparent
skinparam nodesep 1

skinparam rectangle {
    roundCorner 15
    StereotypeFontColor #black
    FontColor #black
    BackgroundColor #FFFFFF
    BorderColor #00518C
}

rectangle "<size:22>Title 1</size>\n\n____\n\n* Item 1\n* Item 2\n* Item 3" #line:green;line.bold

rectangle "<size:22>Title 2</size>\n\n____\n\n* Item 1\n* Item 2\n* Item 3\n* Item 4\n* Item 4\n* Item 5" #line:red;line.bold
@enduml
  • or style with:
@startuml
skinparam backgroundcolor transparent
skinparam nodesep 1

<style>
rectangle {
    roundCorner 15
    StereotypeFontColor #black
    FontColor #black
    BackgroundColor #FFFFFF
    BorderColor #00518C
  .myrec1 {
    Linecolor green
    LineThickness 2
  }
  .myrec2 {
    Linecolor red
    LineThickness 2
  }
}

</style>
rectangle "<size:22>Title 1</size>\n\n____\n\n* Item 1\n* Item 2\n* Item 3" <<myrec1>>

rectangle "<size:22>Title 2</size>\n\n____\n\n* Item 1\n* Item 2\n* Item 3\n* Item 4\n* Item 4\n* Item 5" <<myrec2>>
@enduml

See doc. here:

Enjoy,
Regards.

commented May 19, 2022 by newNoob (140 points)
Top, thanks for your help
...