Note: this page describes a feature that is not available to use with Structurizr's Free Plan.
In addition to styling diagram elements and relationships, some corporate branding can be added to diagrams and documentation. This includes:
- A font (font name and optional web font stylesheet URL).
- A logo (a URL to an image file or a data URI).
- 5 foreground/background colour pairs.
Here's an example diagram that hasn't been styled, aside from setting the shape of the Person
elements.
And here's what the documentation looks like.
You can add branding to an existing workspace, as follows:
Branding branding = views.Configuration.Branding;
branding.Color1 = new ColorPair("#02172c", "#ffffff");
branding.Color2 = new ColorPair("#08427b", "#ffffff");
branding.Color3 = new ColorPair("#1168bd", "#ffffff");
branding.Color4 = new ColorPair("#438dd5", "#ffffff");
branding.Color5 = new ColorPair("#85bbf0", "#ffffff");
branding.Logo = ImageUtils.GetImageAsDataUri(new FileInfo("structurizr-logo.png"));
If no colours have been specified via diagram element styles, colour pairs 1-4 will be used when rendering people, software systems, containers and components respectively. Here's the same diagram, now with added branding. Notice that the logo is now also shown in the bottom left corner.
With documentation, the colour pairs are mapped onto the navigation links at the top of the page, while the first colour pair is used when rendering hyperlinks. Again, the logo is shown.
See CorporateBranding.cs for a full example, and https://structurizr.com/share/35031 to access the workspace.