DiagramTheme Class
The colors and the font of a diagram: the variables of the themes of Mermaid. DiagramTheme.Default, DiagramTheme.Dark, DiagramTheme.Forest, DiagramTheme.Neutral and DiagramTheme.Base are the themes of Mermaid 12; change a value with with: DiagramTheme.Default with { NodeBackground = "#e0f2fe" }.
public sealed class DiagramTheme : IEquatable<DiagramTheme>- Implements
Constructors
| Name | Description |
|---|---|
| DiagramTheme() |
DiagramTheme()
DiagramTheme.cspublic DiagramTheme()No documentation is available.
Properties
| Name | Description |
|---|---|
| AlternateBackground | Gets an alternate fill, such as the regions of a concurrent state (Mermaid altBackground). |
| ArrowheadColor | Gets the color of the arrowheads (Mermaid arrowheadColor). |
| Background | Gets the background of the diagram, or null for a transparent background (Mermaid background). |
| Base | Gets the base theme of Mermaid, the starting point of custom themes. |
| ClusterBackground | Gets the fill of the clusters, such as the subgraphs of a flowchart (Mermaid clusterBkg). |
| ClusterBorderColor | Gets the outline of the clusters (Mermaid clusterBorder). |
| CompositeBackground | Gets the fill of the composite states (Mermaid compositeBackground). |
| CompositeTitleBackground | Gets the fill of the title bar of the composite states (Mermaid compositeTitleBackground). |
| Dark | Gets the dark theme of Mermaid. |
| Default | Gets the default theme of Mermaid: lavender nodes and yellow clusters. |
| EdgeLabelBackground | Gets the background of the labels of the edges (Mermaid edgeLabelBackground). |
| FontFamily | Gets the CSS font-family of the texts, or null for the family of the text measurer. |
| FontSize | Gets the size of the texts, in pixels. The default is 16, the size of Mermaid. |
| Forest | Gets the forest theme of Mermaid: shades of green. |
| InnerEndBackground | Gets the inner circle of the end states (Mermaid innerEndBackground). |
| IsDark | Gets a value that indicates whether the theme has light texts on dark colors. |
| LineColor | Gets the color of the lines of the edges (Mermaid lineColor). |
| Neutral | Gets the neutral theme of Mermaid: shades of gray, for printing. |
| NodeBackground | Gets the fill of the nodes (Mermaid mainBkg). |
| NodeBorderColor | Gets the outline of the nodes (Mermaid nodeBorder). |
| NodeTextColor | Gets the color of the labels of the nodes (Mermaid nodeTextColor, or textColor). |
| NoteBackground | Gets the fill of the notes (Mermaid noteBkgColor). |
| NoteBorderColor | Gets the outline of the notes (Mermaid noteBorderColor). |
| NoteTextColor | Gets the color of the texts of the notes (Mermaid noteTextColor). |
| Palette | Gets the colors of the categories, such as the sections of a mindmap or the groups of an architecture diagram (Mermaid cScale0 to cScale11). |
| PrimaryBorderColor | Gets the color of the outlines drawn on DiagramTheme.PrimaryColor (Mermaid primaryBorderColor). |
| PrimaryColor | Gets the main color, the base of the others (Mermaid primaryColor). |
| PrimaryTextColor | Gets the color of the texts drawn on DiagramTheme.PrimaryColor (Mermaid primaryTextColor). |
| RowEvenBackground | Gets the fill of the even rows of a table (Mermaid rowEven). |
| RowOddBackground | Gets the fill of the odd rows of a table, such as the attributes of an entity (Mermaid rowOdd). |
| SecondaryBorderColor | Gets the color of the outlines drawn on DiagramTheme.SecondaryColor (Mermaid secondaryBorderColor). |
| SecondaryColor | Gets the second color, for the elements that must stand out from the main ones (Mermaid secondaryColor). |
| SecondaryTextColor | Gets the color of the texts drawn on DiagramTheme.SecondaryColor (Mermaid secondaryTextColor). |
| SpecialStateColor | Gets the fill of the start and end states (Mermaid specialStateColor). |
| StrokeWidth | Gets the width of the outlines of the shapes. The default is 1. |
| TertiaryBorderColor | Gets the color of the outlines drawn on DiagramTheme.TertiaryColor (Mermaid tertiaryBorderColor). |
| TertiaryColor | Gets the third color (Mermaid tertiaryColor). |
| TertiaryTextColor | Gets the color of the texts drawn on DiagramTheme.TertiaryColor (Mermaid tertiaryTextColor). |
| TextColor | Gets the color of the texts drawn on the background, such as the labels of the edges (Mermaid textColor). |
| TitleColor | Gets the color of the titles of the diagram and of the clusters (Mermaid titleColor). |
| TitleFontSize | Gets the size of the title of the diagram, in pixels. The default is 18. |
AlternateBackground
DiagramTheme.csGets an alternate fill, such as the regions of a concurrent state (Mermaid altBackground).
public SceneColor AlternateBackground { get; init; }Property value
ArrowheadColor
DiagramTheme.csGets the color of the arrowheads (Mermaid arrowheadColor).
public SceneColor ArrowheadColor { get; init; }Property value
Background
DiagramTheme.csGets the background of the diagram, or null for a transparent background (Mermaid background).
public SceneColor? Background { get; init; }Property value
Base
DiagramTheme.csGets the base theme of Mermaid, the starting point of custom themes.
public static DiagramTheme Base { get; }Property value
ClusterBackground
DiagramTheme.csGets the fill of the clusters, such as the subgraphs of a flowchart (Mermaid clusterBkg).
public SceneColor ClusterBackground { get; init; }Property value
ClusterBorderColor
DiagramTheme.csGets the outline of the clusters (Mermaid clusterBorder).
public SceneColor ClusterBorderColor { get; init; }Property value
CompositeBackground
DiagramTheme.csGets the fill of the composite states (Mermaid compositeBackground).
public SceneColor CompositeBackground { get; init; }Property value
CompositeTitleBackground
DiagramTheme.csGets the fill of the title bar of the composite states (Mermaid compositeTitleBackground).
public SceneColor CompositeTitleBackground { get; init; }Property value
Dark
DiagramTheme.csDefault
DiagramTheme.csGets the default theme of Mermaid: lavender nodes and yellow clusters.
public static DiagramTheme Default { get; }Property value
EdgeLabelBackground
DiagramTheme.csGets the background of the labels of the edges (Mermaid edgeLabelBackground).
public SceneColor EdgeLabelBackground { get; init; }Property value
FontFamily
DiagramTheme.csGets the CSS font-family of the texts, or null for the family of the text measurer.
public string? FontFamily { get; init; }Property value
Remarks
When the text measurer has fonts (ITextMeasurer.Fonts), the texts are measured and drawn with the first family of the list the fonts have. Otherwise the texts are laid out with the metrics of the measurer: a family with other widths can overflow the shapes.
FontSize
DiagramTheme.csForest
DiagramTheme.csGets the forest theme of Mermaid: shades of green.
public static DiagramTheme Forest { get; }Property value
InnerEndBackground
DiagramTheme.csGets the inner circle of the end states (Mermaid innerEndBackground).
public SceneColor InnerEndBackground { get; init; }Property value
IsDark
DiagramTheme.csLineColor
DiagramTheme.csGets the color of the lines of the edges (Mermaid lineColor).
public SceneColor LineColor { get; init; }Property value
Neutral
DiagramTheme.csGets the neutral theme of Mermaid: shades of gray, for printing.
public static DiagramTheme Neutral { get; }Property value
NodeBackground
DiagramTheme.csGets the fill of the nodes (Mermaid mainBkg).
public SceneColor NodeBackground { get; init; }Property value
NodeBorderColor
DiagramTheme.csGets the outline of the nodes (Mermaid nodeBorder).
public SceneColor NodeBorderColor { get; init; }Property value
NodeTextColor
DiagramTheme.csGets the color of the labels of the nodes (Mermaid nodeTextColor, or textColor).
public SceneColor NodeTextColor { get; init; }Property value
NoteBackground
DiagramTheme.csGets the fill of the notes (Mermaid noteBkgColor).
public SceneColor NoteBackground { get; init; }Property value
NoteBorderColor
DiagramTheme.csGets the outline of the notes (Mermaid noteBorderColor).
public SceneColor NoteBorderColor { get; init; }Property value
NoteTextColor
DiagramTheme.csGets the color of the texts of the notes (Mermaid noteTextColor).
public SceneColor NoteTextColor { get; init; }Property value
Palette
DiagramTheme.csGets the colors of the categories, such as the sections of a mindmap or the groups of an architecture diagram (Mermaid cScale0 to cScale11).
public IReadOnlyList<SceneColor> Palette { get; init; }Property value
PrimaryBorderColor
DiagramTheme.csGets the color of the outlines drawn on DiagramTheme.PrimaryColor (Mermaid primaryBorderColor).
public SceneColor PrimaryBorderColor { get; init; }Property value
PrimaryColor
DiagramTheme.csGets the main color, the base of the others (Mermaid primaryColor).
public SceneColor PrimaryColor { get; init; }Property value
PrimaryTextColor
DiagramTheme.csGets the color of the texts drawn on DiagramTheme.PrimaryColor (Mermaid primaryTextColor).
public SceneColor PrimaryTextColor { get; init; }Property value
RowEvenBackground
DiagramTheme.csGets the fill of the even rows of a table (Mermaid rowEven).
public SceneColor RowEvenBackground { get; init; }Property value
RowOddBackground
DiagramTheme.csGets the fill of the odd rows of a table, such as the attributes of an entity (Mermaid rowOdd).
public SceneColor RowOddBackground { get; init; }Property value
SecondaryBorderColor
DiagramTheme.csGets the color of the outlines drawn on DiagramTheme.SecondaryColor (Mermaid secondaryBorderColor).
public SceneColor SecondaryBorderColor { get; init; }Property value
SecondaryColor
DiagramTheme.csGets the second color, for the elements that must stand out from the main ones (Mermaid secondaryColor).
public SceneColor SecondaryColor { get; init; }Property value
SecondaryTextColor
DiagramTheme.csGets the color of the texts drawn on DiagramTheme.SecondaryColor (Mermaid secondaryTextColor).
public SceneColor SecondaryTextColor { get; init; }Property value
SpecialStateColor
DiagramTheme.csGets the fill of the start and end states (Mermaid specialStateColor).
public SceneColor SpecialStateColor { get; init; }Property value
StrokeWidth
DiagramTheme.csTertiaryBorderColor
DiagramTheme.csGets the color of the outlines drawn on DiagramTheme.TertiaryColor (Mermaid tertiaryBorderColor).
public SceneColor TertiaryBorderColor { get; init; }Property value
TertiaryColor
DiagramTheme.csGets the third color (Mermaid tertiaryColor).
public SceneColor TertiaryColor { get; init; }Property value
TertiaryTextColor
DiagramTheme.csGets the color of the texts drawn on DiagramTheme.TertiaryColor (Mermaid tertiaryTextColor).
public SceneColor TertiaryTextColor { get; init; }Property value
TextColor
DiagramTheme.csGets the color of the texts drawn on the background, such as the labels of the edges (Mermaid textColor).
public SceneColor TextColor { get; init; }Property value
TitleColor
DiagramTheme.csGets the color of the titles of the diagram and of the clusters (Mermaid titleColor).
public SceneColor TitleColor { get; init; }Property value
TitleFontSize
DiagramTheme.csMethods
| Name | Description |
|---|---|
| Equals(DiagramTheme?) | |
| Equals(object?) | |
| GetHashCode() | |
| GetPaletteColor(int) | Returns the color of a category: the colors of DiagramTheme.Palette repeat. |
| ToString() |
Equals overloads
Equals(DiagramTheme?)
public bool Equals(DiagramTheme? other)No documentation is available.
Equals(object?)
GetHashCode()
GetPaletteColor(int)
DiagramTheme.csReturns the color of a category: the colors of DiagramTheme.Palette repeat.
public SceneColor GetPaletteColor(int index)Parameters
indexint- The index of the category.
Returns
SceneColor The color, or DiagramTheme.PrimaryColor when the palette is empty.
ToString()
Operators
| Name | Description |
|---|---|
| operator ==(DiagramTheme?, DiagramTheme?) | |
| operator !=(DiagramTheme?, DiagramTheme?) |
operator ==(DiagramTheme?, DiagramTheme?)
public static bool operator ==(DiagramTheme? left, DiagramTheme? right)No documentation is available.
operator !=(DiagramTheme?, DiagramTheme?)
public static bool operator !=(DiagramTheme? left, DiagramTheme? right)No documentation is available.