From e607396e47fa101a019f31b28d323a8e77c312c6 Mon Sep 17 00:00:00 2001 From: KIRCHSTH Date: Sat, 5 Mar 2022 21:47:38 +0100 Subject: [PATCH] #186 LAYOUT_AS_SKETCH() styles can be set via SET_SKETCH_STYLE() (2 - border and arrow color changed too) --- C4.puml | 18 +++++++++++++++++- percy/TestSketchStyle.puml | 28 ++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 percy/TestSketchStyle.puml diff --git a/C4.puml b/C4.puml index 7cea3c9..c81f5dd 100644 --- a/C4.puml +++ b/C4.puml @@ -928,7 +928,23 @@ hide stereotype skinparam backgroundColor $SKETCH_BG_COLOR !endif !if $SKETCH_FONT_COLOR > "" - skinparam defaultFontColor $SKETCH_FONT_COLOR + skinparam footer { + FontColor $SKETCH_FONT_COLOR + } + !if $ARROW_COLOR == "#666666" + !global $ARROW_COLOR = $SKETCH_FONT_COLOR + skinparam arrow { + Color $ARROW_COLOR + FontColor $ARROW_COLOR + } + !endif + !if $BOUNDARY_COLOR == "#444444" + !global $BOUNDARY_COLOR = $SKETCH_FONT_COLOR + skinparam rectangle<> { + FontColor $BOUNDARY_COLOR + BorderColor $BOUNDARY_COLOR + } + !endif !endif !if $SKETCH_FONT_NAMES > "" skinparam defaultFontName $SKETCH_FONT_NAME diff --git a/percy/TestSketchStyle.puml b/percy/TestSketchStyle.puml new file mode 100644 index 0000000..6d3222c --- /dev/null +++ b/percy/TestSketchStyle.puml @@ -0,0 +1,28 @@ +@startuml LAYOUT_AS_SKETCH Sample +!if %variable_exists("RELATIVE_INCLUDE") + !include ./../C4_Container.puml +!else + !include https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/C4_Container.puml +!endif + +SET_SKETCH_STYLE($bgColor="lightblue", $fontColor="darkblue", $warningColor="darkred", $footerWarning="Sketch", $footerText="Created for discussion") + +' PNG with font jlm_cmmi10 (typically another font is used) +' SET_SKETCH_STYLE($fontName="jlm_cmmi10") + +' SVG with fallback fonts MS Gothic,Comic Sans MS, Comic Sans, Chalkboard SE, Comic Neue, cursive, sans-serif (typically without "MS Gothic") +SET_SKETCH_STYLE($fontName="MS Gothic,Comic Sans MS,Comic Sans,Chalkboard SE,Comic Neue,cursive,sans-serif") + +LAYOUT_AS_SKETCH() + +Person(admin, "Administrator") +System_Boundary(c1, 'Sample') { + Container(web_app, "Web Application", "C#, ASP.NET Core 2.1 MVC", "Allows users to compare multiple Twitter timelines") +} +System(twitter, "Twitter") + +Rel(admin, web_app, "Uses", "HTTPS") +Rel(web_app, twitter, "Gets tweets from", "HTTPS") + +SHOW_LEGEND() +@enduml \ No newline at end of file