Menu

Themes and contrast

Every diagram comes in four themes. Since types only define an accent, switching theme needs no change to your CSS.

The themes

ThemeUse
lightdefault; secondary texts, arrows and borders keep a contrast of at least 4.5:1
darkdark screens: only the base colours change, tints are recomputed from --c
printpaper, including black and white: white background, black ink, no shadow, darker fills and thicker strokes. Applied automatically when the HTML output is printed
autoHTML only: follows the reader's system setting. PNG and SVG render as light

Choose with diagram(theme="dark") or, overriding the file, skemo render --theme dark.

Dark

{"skemo":1,"name":"themes.skemo","source":"//- Network diagram — automatic layout\ndiagram(dir=\"down\")\n\n card#internet.cloud Internet\n to(fw).wan WAN\n\n card#fw.t0 Perimeter firewall\n | 203.0.113.10/29\n | 10.0.0.1/24\n to(web)\n to(mail)\n to(core) transit\n\n zone#dmz.dmz DMZ\n card#web.t1 Web server\n | 172.16.0.10\n card#mail.t1 Mail server\n | 172.16.0.20\n\n zone#lan.lan Internal LAN\n card#core.t1 Core switch\n | 10.10.0.0/16 VLAN 10\n | 10.20.0.0/16 VLAN 20\n to(srv)\n to(users)\n to(voip)\n card#srv.t2 Internal servers\n | 10.30.0.0/24\n card#users.t3 Workstations\n | ~400 workstations\n card#voip.t3 IP telephony\n | ~150 phones\n","theme":"dark"}InternetT0Perimeter firewall203.0.113.10/2910.0.0.1/24DMZT1Web server172.16.0.10T1Mail server172.16.0.20INTERNAL LANT1Core switch10.10.0.0/16VLAN 1010.20.0.0/16VLAN 20T2Internal servers10.30.0.0/24T3Workstations~400 workstationsT3IP telephony~150 phonesWANtransit

Print

{"skemo":1,"name":"themes.skemo","source":"//- Network diagram — automatic layout\ndiagram(dir=\"down\")\n\n card#internet.cloud Internet\n to(fw).wan WAN\n\n card#fw.t0 Perimeter firewall\n | 203.0.113.10/29\n | 10.0.0.1/24\n to(web)\n to(mail)\n to(core) transit\n\n zone#dmz.dmz DMZ\n card#web.t1 Web server\n | 172.16.0.10\n card#mail.t1 Mail server\n | 172.16.0.20\n\n zone#lan.lan Internal LAN\n card#core.t1 Core switch\n | 10.10.0.0/16 VLAN 10\n | 10.20.0.0/16 VLAN 20\n to(srv)\n to(users)\n to(voip)\n card#srv.t2 Internal servers\n | 10.30.0.0/24\n card#users.t3 Workstations\n | ~400 workstations\n card#voip.t3 IP telephony\n | ~150 phones\n","theme":"print"}InternetT0Perimeter firewall203.0.113.10/2910.0.0.1/24DMZT1Web server172.16.0.10T1Mail server172.16.0.20INTERNAL LANT1Core switch10.10.0.0/16VLAN 1010.20.0.0/16VLAN 20T2Internal servers10.30.0.0/24T3Workstations~400 workstationsT3IP telephony~150 phonesWANtransit

The print theme may change dimensions slightly (thicker borders): the layout is computed for the theme you ask for.

Contrast

skemo lint --contrast diagram.skemo           # reports texts below the WCAG threshold
skemo render --contrast high diagram.skemo     # darkens (or lightens) those texts, layout unchanged

The threshold is 4.5:1 for text, 3:1 for text on an accent fill and for icons. A custom accent that is too light is reported, with the element and the measured ratio.

Never colour alone

Readers who do not see colours, and printers, still need to tell types apart: give types a --label, and arrows whose meaning matters a line style (.dashed, .dotted, .thick, .link).