Skip to content

Untitled string in Mermaid Config Schema

txt
https://mermaid.js.org/schemas/config.schema.json#/$defs/UsecaseDiagramConfig/properties/colorScheme

How a use case diagram takes its colours from the active theme.

role (the default) gives every element of a kind one colour, read from the usecaseActorBkg / usecaseActorBorder, usecaseBkg / usecaseBorder, and usecaseBoundaryBkg / usecaseBoundaryBorder theme variables. Colour then says what an element is, and it is invariant under insertion, reordering, and renaming -- adding one use case in the middle does not recolour the ones after it, so diffs, documentation screenshots, and visual baselines stay stable.

rotate instead gives each actor, use case, and system boundary its own slot from the theme's categorical palette (borderColorArray / bkgColorArray), the way ER entities and class boxes are coloured. Actors and use cases share one cycle, and system boundaries run a second one from zero, so a boundary is never forced to match an element inside it. Within the shared cycle the actors are numbered first and the use cases after them, each in declaration order -- an interleaved actor A, usecase U, actor B is therefore numbered A, B, U rather than A, U, B. This buys per-instance variety at the cost of the stability role has: inserting an element shifts the colour of every later element of its own kind, and inserting an actor shifts the use cases too. Only the colour themes (redux-color, redux-dark-color) carry a palette, so on every other theme the two settings render identically.

classDef and style keep overriding both, whichever is set.

AbstractExtensibleStatusIdentifiableCustom PropertiesAdditional PropertiesAccess RestrictionsDefined In
Can be instantiatedNoUnknown statusUnknown identifiabilityForbiddenAllowednoneconfig.schema.json*

colorScheme Type

string

colorScheme Constraints

enum: the value of this property must be equal to one of the following values:

ValueExplanation
"role"
"rotate"

colorScheme Default Value

The default value is:

json
"role"
Opens in mermaid.ai