Themes can be created using a minimal two-color approach or a fully enriched configuration.
Two-Color Theming
Provide only background and foreground colors; the system derives the rest.
Enriched Theming
Add optional colors for fine-grained control over lines, accents, surfaces, and borders.
VS Code / Shiki Import
Convert Shiki-compatible JSON themes into DiagramTheme objects.
// Two-color minimal theme
let theme = DiagramTheme(
background: "#1a1b26",
foreground: "#c0caf5"
)
// Enriched theme
let enrichedTheme = DiagramTheme(
background: "#1a1b26",
foreground: "#c0caf5",
line: "#565f89",
accent: "#7aa2f7",
muted: "#414868",
surface: "#24283b",
border: "#414868"
)
// Shiki import
let shikiTheme = DiagramTheme.ShikiTheme(
type: "dark",
colors: [
"editor.background": "#1e1e1e",
"editor.foreground": "#d4d4d4",
"focusBorder": "#007acc"
],
tokenColors: []
)
let themeFromShiki = DiagramTheme.fromShikiTheme(shikiTheme)