SW Theme¶
The SW theme provides ADI brand colors and styling classes adapted for software architecture and AI system diagrams.
Color Palette¶
Light Theme¶
ADI Blue — #0067B9 — Primary brand color |
|
Dark Blue — #004A87 — Data flow emphasis |
|
Pale Blue — #D6EAF8 — Step highlights |
|
Cream — #FDF6EC — Warm container fill |
|
Background Blue — #E8F4FD — Container fill |
|
Red — #C8102E — Error flows |
|
Green — #007A33 — Success flows |
|
Amber — #F5A623 — Async / warning |
Dark Theme¶
The dark theme inverts colors for dark backgrounds:
ADI Blue — #4D9AD5 — Primary accent |
|
Background — #0D1B2A — Container fill |
|
Cream — #2A2520 — Warm container fill |
|
Text — #E0E0E0 — Primary text |
|
Red — #FF6B6B — Error flows |
|
Green — #66BB6A — Success flows |
|
Amber — #FFB74D — Async / warning |
Flow Classes¶
Apply these classes on connections (edges) between components to indicate flow type. Each uses a distinct color and stroke style.
Class |
Color |
Stroke |
Use For |
|---|---|---|---|
|
ADI Blue |
Solid, 2px |
Default data/control flow |
|
Dark Blue |
Solid, 3px |
Emphasized data flow |
|
Grey |
Dashed, 2px |
Control flow paths |
|
Amber |
Dashed, 2px |
Async / event-driven flow |
|
Red |
Solid, 2px |
Error paths |
|
Green |
Solid, 2px |
Success paths |
|
Light Blue |
Dashed, 2px |
Feedback / loop-back |
|
Light Grey |
Solid, 2px |
Subtle connectors |
Example:
agent: Auditor { class: sw-agent }
model: LLM { class: sw-model }
agent -> model: Request { class: sw-flow }
model -> agent: Response { class: sw-flow-feedback }
agent -> log: Error { class: sw-flow-error }
Container Classes¶
sw-container¶
Groups components with ADI blue border and light blue fill. All containers use a modern border-radius: 12 layout and feature prominent drop shadows for visual depth.
loop: Auditing Loop {
class: sw-container
agent: Auditor { class: sw-agent }
model: Target { class: sw-model }
agent -> model { class: sw-flow }
}
Variant |
Description |
|---|---|
|
Blue border, light blue fill |
|
Grey border, warm cream fill |
|
Green border, light green fill |
|
Amber border, light amber fill |
|
Red border, light red fill |
|
Grey border, white fill |
Step Highlight Classes¶
Apply to nodes inside workflow diagrams to color-code process steps, similar to the Petri research page style.
Class |
Fill |
Stroke |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Example:
s1: Formulate hypothesis { class: sw-step-white }
s2: Design scenarios { class: sw-step-blue }
s3: Build environments { class: sw-step-amber }
s4: Run models { class: sw-step-green }
s1 -> s2 -> s3 -> s4 { class: sw-flow-light }
Typography Classes¶
sw-title¶
Diagram title styled with ADI brand colors. Renders as text-only shape.
title: Agent Pipeline { class: sw-title }
sw-subtitle¶
Subsection heading in dark text.
heading: Scoring Phase { class: sw-subtitle }
sw-note¶
Annotation block for notes. Renders as a page shape with muted colors.
note: |md
Judge scores transcripts
across multiple dimensions
| { class: sw-note }
ADI Signal Classes¶
The SW library also includes the ADI theme’s signal and layout classes, so you can use hardware-style color coding alongside software components. These classes adapt automatically to light and dark themes.
Class |
Color (light) |
Stroke |
Use For |
|---|---|---|---|
|
ADI Blue |
Solid, 2px |
Default signal connections |
|
Soft Black |
Solid, 2px |
Analog signal paths |
|
ADI Blue |
Dashed, 2px |
Digital buses (SPI, I2S, JESD204B) |
|
Green |
Dashed, 1px |
Clock distribution |
|
Red |
Solid, 2px |
Power supply rails |
Additional ADI layout classes are also available:
adi-container— Blue border container (8px radius, drop shadow)adi-title— Bold title in ADI Blueadi-note— Muted annotation block (page shape)
Example mixing SW components with ADI signal styles:
server: API Server { class: sw-server }
fpga: FPGA { class: sw-function }
db: Telemetry DB { class: sw-database }
server -> fpga: SPI Config { class: adi-signal-digital }
fpga -> db: Data Stream { class: sw-flow-data }
fpga -> server: Interrupt { class: adi-signal-clock }
Using Themes¶
import d2
# Light theme (default)
svg_light = d2.compile(code, library="sw")
# Dark theme
svg_dark = d2.compile(code, library="sw", theme="dark")