主题
Untitled string in Mermaid Config Schema
txt
https://mermaid.js.org/schemas/config.schema.json#/$defs/UsecaseDiagramConfig/properties/colorScheme用例图的颜色如何从活动主题中获取。role(默认)会给每种元素分配一种颜色,这些颜色取自 usecaseActorBkg / usecaseActorBorder、usecaseBkg / usecaseBorder 和 usecaseBoundaryBkg / usecaseBoundaryBorder 主题变量。颜色表示元素的“类型”,在插入、重新排序和重命名时保持不变——在中间添加一个用例不会重新着色后面的元素,因此差异对比、文档截图和视觉基线都保持稳定。而 rotate 则会给每个角色、用例和系统边界分配主题类别调色板(borderColorArray / bkgColorArray)中的独立槽,就像 ER 实体和类框的着色方式一样。角色和用例共享一个循环,而系统边界从零开始运行第二个循环,因此边界不会被迫与其中的元素匹配。在共享循环中,角色优先编号,用例紧随其后,按声明顺序排列——因此交错的 actor A、usecase U、actor B 的编号是 A、B、U,而不是 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.
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
|---|---|---|---|---|---|---|---|
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | config.schema.json* |
colorScheme Type
string
colorScheme Constraints
enum: the value of this property must be equal to one of the following values:
| Value | Explanation |
|---|---|
"role" | |
"rotate" |
colorScheme Default Value
The default value is:
json
"role"