From 148a3c4cf7feae6fd7a19a0088e578885971d031 Mon Sep 17 00:00:00 2001 From: Alexander Sage Date: Tue, 30 Jul 2019 22:24:48 -0700 Subject: [PATCH] chore: Documentation for rect --- docs/sequenceDiagram.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/docs/sequenceDiagram.md b/docs/sequenceDiagram.md index fa9128479..83d7615fd 100755 --- a/docs/sequenceDiagram.md +++ b/docs/sequenceDiagram.md @@ -235,6 +235,43 @@ sequenceDiagram end ``` +## Background Highlighting +It is possible to highlight flows by providing colored background rects. This is done by the notation + +The colors are defined using rgb and rgba syntax. +``` +rect rgb(0, 255, 0) +... content ... +end +``` +``` +rect rgba(0, 0, 255, .1) +... content ... +end +``` + +See the examples below: + +```mermaid +sequenceDiagram + participant Alice + participant John + + rect rgb(191, 223, 255) + note right of Alice: Alice calls John. + Alice->>+John: Hello John, how are you? + rect rgb(200, 150, 255) + Alice->>+John: John, can you hear me? + John-->>-Alice: Hi Alice, I can hear you! + end + John-->>-Alice: I feel great! + end + Alice ->>+ John: Did you want to go to the game tonight? + John -->>- Alice: Yeah! See you there. + +``` + + ## Styling