Looks & Themes

A look says what is drawn and how it moves. A theme says how it is skinned: colors, type, stroke, hand-drawn wobble, glow, node shape. Any look works with any theme, and neither changes the run.

Looks and themes beyond the defaults live in the module github.com/synodlang/looks (decision 122). A main file imports one look and at most one theme; a program that imports no look draws with std/look/basic and one that imports no theme uses std/theme/default. See the gallery for all pairs playing at once.

# package main
use github.com/synodlang/examples/raft
use github.com/synodlang/looks/doodle
use github.com/synodlang/looks/sketch
use std/sim

Fetch the module with synod get after adding require github.com/synodlang/looks v0.3.0 to synod.mod. Source: synodlang/looks.

Looks

std/look/basic

The default look: cards, links and the messages that fly between them. Its source and every phrase it gives are in the Library: std/look/basic, std/look.

lumen

lumen, default

Import: use github.com/synodlang/looks/lumen · source on GitHub

Source of lumen/lumen.synod
# package lumen
use std/disk
use std/lesson
use std/lists
use std/look
use std/net
use std/sim
use std/text
use std/theme

# The ring settles in with a slow push of the camera; a counter will roll with the messages sent
when sim.Started
  look.Layout "ring"
  look.Focus look.Center zoom 1.12 over 0s
  look.Focus look.Center zoom 1 over 1200ms
  draw (look.Counter 0) as total for "total"
  look.Role total as "value"
  look.Face total as "mono"
  look.Tween "x" of total to 58 over 0s
  look.Tween "y" of total to 40 over 0s
  draw (look.Label "messages") as unit
  look.Role unit as "caption"
  look.Place unit below total

# A node is drawn on, then its state rows pop in one after another
when (sim.Added n)
  draw (look.Card for n) as card for n
  look.Reveal card
  draw (look.Icon "cross") as crash for n
  look.Stroke crash with theme.Critical
  look.Tween "opacity" of crash to 0 over 0s
  look.Place crash above card
  draw (look.Icon "disk") as drive for n
  look.Tween "opacity" of drive to 0 over 0s
  look.Place drive beside card
  set above to card
  set rows to {card}
  each i, line in (sim.StateRows n)
    draw (look.Label line) as row for (text.Join {(sim.Name n), "/", (text.From (i plus 1))})
      look.Tween "text" of row to (item i of (sim.StateRows n)) over 300ms
    look.Role row as "value"
    look.Face row as "mono"
    look.Place row below above
    set above to row
    set rows to (lists.Append row to rows)
  look.Enter rows every 60ms

# A changed field makes the card stand out
when (sim.Changed f of n from old to new)
  look.Effect "indicate" on (card of n)

# A message is a glowing particle that leaves a short trail on a bent path
when (net.Sent m from a to b)
  draw (look.Circle 5) as particle for (net.Id m)
  look.Fill particle with (look.MessageColor m)
  look.Tween "halo" of particle to 1 over 0s
  look.Bend particle by 0.18
  look.Trail particle for 240ms
  look.Flight particle from (card of a) to (card of b) for m
  look.Tween "count" of (total of "total") to (net.Id m) over 200ms

when (net.Arrived m from a to b)
  look.Remove (particle of (net.Id m))

when (net.Dropped m from a to b because r)
  look.Effect "flash" on (particle of (net.Id m))
  look.Remove (particle of (net.Id m))

when (sim.Crashed n)
  if (theme.NodeFill is "solid")
    look.Fill (card of n) with theme.Quiet
  if (theme.NodeFill is "outline")
    look.Stroke (card of n) with theme.Quiet
  look.Tween "opacity" of (crash of n) to 1 over 0s
  look.PopIn (crash of n)

when (sim.Restarted n)
  if (theme.NodeFill is "solid")
    look.Fill (card of n) with theme.Ink
  if (theme.NodeFill is "outline")
    look.Stroke (card of n) with theme.Ink
  look.Fade (crash of n) to 0
  look.Reveal (card of n)
  look.Effect "flash" on (card of n)

when (sim.Removed n)
  look.Remove (card of n)
  look.Remove (crash of n)
  look.Remove (drive of n)
  each i in (lists.Range 1 to (lists.Size (sim.StateRows n)))
    look.Remove (row of (text.Join {(sim.Name n), "/", (text.From i)}))

# A partition dashes the cards of the second group; healing makes every card solid again
when (net.Partitioned a from b)
  each x in b
    look.Dash (card of x) on 8 off 6

when net.Healed
  each x in sim.Nodes
    look.Dash (card of x) on 0 off 0
    look.Effect "flash" on (card of x)

# A write blinks a disk beside the card
when (disk.Written k on n)
  look.Tween "opacity" of (drive of n) to 1 over 0s
  look.PopIn (drive of n)
  after 900ms
    look.Fade (drive of n) to 0

# A broken rule frames the scene in Critical and names the rule
when (sim.Broken rule)
  draw look.Frame as alarm for "alarm"
  look.Stroke alarm with theme.Critical
  draw (look.Label rule) as reason for "reason"
  look.Role reason as "caption"
  look.Tween "y" of reason to 72 over 0s
  look.Effect "sweep" on alarm
  look.Reveal reason
  after 1800ms
    look.Remove alarm
    look.Remove reason

# A lesson note writes itself at the top of the scene
when (sim.Emitted lesson.Noted by origin)
  draw (look.Label lesson.Noted.Text) as note for "note"
  look.Role note as "caption"
  look.Tween "y" of note to 40 over 0s
  look.Reveal note

# Any other emitted event circles the card of the node that emitted it
when (sim.Emitted e by n)
  if (n is not sim.Nobody)
    look.Effect "circumscribe" on (card of n)

# The camera pulls back a little at the end
when sim.Ended
  look.Focus look.Center zoom 0.96 over 1500ms

Edit the demo and press Run. Change the use lines to try another look or theme.

# package main
# Raft leader election drawn by the lumen look under the default theme
use github.com/synodlang/examples/raft
use github.com/synodlang/looks/lumen
use std/lesson
use std/net
use std/sim

define main
  sim.Seed 3
  net.Latency between 5ms and 15ms
  set nodes to (sim.Cluster of 5 running raft)
  raft.Meet nodes
  after 2s
    set old to (item 0 of raft.Leaders)
    sim.Crash old
    lesson.Ask "The leader just crashed. What do the followers do now?" choosing {"Wait for the old leader to return", "Time out and start an election", "Ask a coordinator service to pick a new leader", "Stop accepting writes for good"}
    after 3s
      sim.Restart old
      lesson.Note "The old leader returns as a follower: it sees a higher term."
  sim.StopAt 8s
# package lumen
use std/disk
use std/lesson
use std/lists
use std/look
use std/net
use std/sim
use std/text
use std/theme

# The ring settles in with a slow push of the camera; a counter will roll with the messages sent
when sim.Started
  look.Layout "ring"
  look.Focus look.Center zoom 1.12 over 0s
  look.Focus look.Center zoom 1 over 1200ms
  draw (look.Counter 0) as total for "total"
  look.Role total as "value"
  look.Face total as "mono"
  look.Tween "x" of total to 58 over 0s
  look.Tween "y" of total to 40 over 0s
  draw (look.Label "messages") as unit
  look.Role unit as "caption"
  look.Place unit below total

# A node is drawn on, then its state rows pop in one after another
when (sim.Added n)
  draw (look.Card for n) as card for n
  look.Reveal card
  draw (look.Icon "cross") as crash for n
  look.Stroke crash with theme.Critical
  look.Tween "opacity" of crash to 0 over 0s
  look.Place crash above card
  draw (look.Icon "disk") as drive for n
  look.Tween "opacity" of drive to 0 over 0s
  look.Place drive beside card
  set above to card
  set rows to {card}
  each i, line in (sim.StateRows n)
    draw (look.Label line) as row for (text.Join {(sim.Name n), "/", (text.From (i plus 1))})
      look.Tween "text" of row to (item i of (sim.StateRows n)) over 300ms
    look.Role row as "value"
    look.Face row as "mono"
    look.Place row below above
    set above to row
    set rows to (lists.Append row to rows)
  look.Enter rows every 60ms

# A changed field makes the card stand out
when (sim.Changed f of n from old to new)
  look.Effect "indicate" on (card of n)

# A message is a glowing particle that leaves a short trail on a bent path
when (net.Sent m from a to b)
  draw (look.Circle 5) as particle for (net.Id m)
  look.Fill particle with (look.MessageColor m)
  look.Tween "halo" of particle to 1 over 0s
  look.Bend particle by 0.18
  look.Trail particle for 240ms
  look.Flight particle from (card of a) to (card of b) for m
  look.Tween "count" of (total of "total") to (net.Id m) over 200ms

when (net.Arrived m from a to b)
  look.Remove (particle of (net.Id m))

when (net.Dropped m from a to b because r)
  look.Effect "flash" on (particle of (net.Id m))
  look.Remove (particle of (net.Id m))

when (sim.Crashed n)
  if (theme.NodeFill is "solid")
    look.Fill (card of n) with theme.Quiet
  if (theme.NodeFill is "outline")
    look.Stroke (card of n) with theme.Quiet
  look.Tween "opacity" of (crash of n) to 1 over 0s
  look.PopIn (crash of n)

when (sim.Restarted n)
  if (theme.NodeFill is "solid")
    look.Fill (card of n) with theme.Ink
  if (theme.NodeFill is "outline")
    look.Stroke (card of n) with theme.Ink
  look.Fade (crash of n) to 0
  look.Reveal (card of n)
  look.Effect "flash" on (card of n)

when (sim.Removed n)
  look.Remove (card of n)
  look.Remove (crash of n)
  look.Remove (drive of n)
  each i in (lists.Range 1 to (lists.Size (sim.StateRows n)))
    look.Remove (row of (text.Join {(sim.Name n), "/", (text.From i)}))

# A partition dashes the cards of the second group; healing makes every card solid again
when (net.Partitioned a from b)
  each x in b
    look.Dash (card of x) on 8 off 6

when net.Healed
  each x in sim.Nodes
    look.Dash (card of x) on 0 off 0
    look.Effect "flash" on (card of x)

# A write blinks a disk beside the card
when (disk.Written k on n)
  look.Tween "opacity" of (drive of n) to 1 over 0s
  look.PopIn (drive of n)
  after 900ms
    look.Fade (drive of n) to 0

# A broken rule frames the scene in Critical and names the rule
when (sim.Broken rule)
  draw look.Frame as alarm for "alarm"
  look.Stroke alarm with theme.Critical
  draw (look.Label rule) as reason for "reason"
  look.Role reason as "caption"
  look.Tween "y" of reason to 72 over 0s
  look.Effect "sweep" on alarm
  look.Reveal reason
  after 1800ms
    look.Remove alarm
    look.Remove reason

# A lesson note writes itself at the top of the scene
when (sim.Emitted lesson.Noted by origin)
  draw (look.Label lesson.Noted.Text) as note for "note"
  look.Role note as "caption"
  look.Tween "y" of note to 40 over 0s
  look.Reveal note

# Any other emitted event circles the card of the node that emitted it
when (sim.Emitted e by n)
  if (n is not sim.Nobody)
    look.Effect "circumscribe" on (card of n)

# The camera pulls back a little at the end
when sim.Ended
  look.Focus look.Center zoom 0.96 over 1500ms

doodle

doodle, default

Import: use github.com/synodlang/looks/doodle · source on GitHub

Source of doodle/doodle.synod
# package doodle
use std/disk
use std/lesson
use std/lists
use std/look
use std/net
use std/sim
use std/text
use std/theme

# Nodes stand in a ring inside a dashed frame
when sim.Started
  look.Layout "ring"
  draw look.Frame as frame
  look.Stroke frame with theme.Line
  look.Dash frame on 6 off 6
  look.Tween "opacity" of frame to 0.4 over 0s

# A node is a stick-figure: a small head above the card, its state in captions below
when (sim.Added n)
  draw (look.Card for n) as card for n
  look.Reveal card
  draw (look.Circle 10) as head for n
  look.Stroke head with theme.Ink
  look.Place head above card
  look.Reveal head
  draw (look.Icon "cross") as crash for n
  look.Stroke crash with theme.Critical
  look.Tween "opacity" of crash to 0 over 0s
  look.Place crash beside card
  draw (look.Icon "disk") as drive for n
  look.Tween "opacity" of drive to 0 over 0s
  look.Place drive below card
  set above to card
  each i, line in (sim.StateRows n)
    draw (look.Label line) as row for (text.Join {(sim.Name n), "/", (text.From (i plus 1))})
      look.Tween "text" of row to (item i of (sim.StateRows n)) over 300ms
    look.Role row as "caption"
    look.Place row below above
    set above to row
    look.Reveal row

# A change is written beside the card, then fades; a node shows one note at a time
when (sim.Changed f of n from old to new)
  draw (look.Label (text.Join {(text.From f), ": ", (text.From new)})) as note for n
  look.Role note as "caption"
  look.Place note beside (card of n)
  look.Reveal note
  after 1200ms
    look.Remove note

# A message is a little envelope; its type shows mid-flight, so tags that leave or land together never pile up
when (net.Sent m from a to b)
  draw (look.Icon "mail") as mail for (net.Id m)
  look.Tween "scale" of mail to 0.625 over 0s
  draw (look.Label (net.Type m)) as tag
  look.Role tag as "caption"
  look.Place tag above mail
  look.Tween "opacity" of tag to 0 over 0s
  look.Tween "opacity" of tag to 1 over 120ms
  draw (look.Group {mail, tag}) as dot for (net.Id m)
  look.Bend dot by 0.25
  look.Flight dot from (card of a) to (card of b) for m
  after 200ms
    look.Fade tag to 0

when (net.Arrived m from a to b)
  look.Remove (dot of (net.Id m))

# A lost message turns into a cross, then goes
when (net.Dropped m from a to b because r)
  look.Tween "icon" of (mail of (net.Id m)) to "cross" over 200ms
  after 400ms
    look.Remove (dot of (net.Id m))

when (sim.Crashed n)
  look.Dash (card of n) on 4 off 4
  look.Tween "opacity" of (crash of n) to 1 over 0s
  look.Reveal (crash of n)

when (sim.Restarted n)
  look.Dash (card of n) on 0 off 0
  look.Fade (crash of n) to 0

when (sim.Removed n)
  look.Remove (card of n)
  look.Remove (head of n)
  look.Remove (crash of n)
  look.Remove (drive of n)
  each i in (lists.Range 1 to (lists.Size (sim.StateRows n)))
    look.Remove (row of (text.Join {(sim.Name n), "/", (text.From i)}))

# A partition dashes the cards of the second group; healing makes them solid
when (net.Partitioned a from b)
  each x in b
    look.Dash (card of x) on 8 off 6

when net.Healed
  each x in sim.Nodes
    look.Dash (card of x) on 0 off 0

# A write blinks a disk below the card
when (disk.Written k on n)
  look.Tween "opacity" of (drive of n) to 1 over 0s
  look.Reveal (drive of n)
  after 900ms
    look.Fade (drive of n) to 0

# A broken rule is written at the top and underlined with a dashed line
when (sim.Broken rule)
  draw (look.Label rule) as reason for "reason"
  look.Role reason as "caption"
  look.Tween "y" of reason to 72 over 0s
  draw (look.Rect (8 times (text.Size rule)) by 2) as underline for "underline"
  look.Stroke underline with theme.Critical
  look.Dash underline on 6 off 4
  look.Place underline below reason
  look.Reveal reason
  look.Reveal underline
  after 1800ms
    look.Remove reason
    look.Remove underline

# A lesson note is a caption at the top of the scene
when (sim.Emitted lesson.Noted by origin)
  draw (look.Label lesson.Noted.Text) as note for "note"
  look.Role note as "caption"
  look.Tween "y" of note to 40 over 0s

# Any other emitted event is named beside the node that emitted it
when (sim.Emitted e by n)
  if (n is not sim.Nobody)
    draw (look.Label (net.Type e)) as event
    look.Role event as "caption"
    look.Place event beside (card of n)
    after 1200ms
      look.Remove event

Edit the demo and press Run. Change the use lines to try another look or theme.

# package main
# Raft leader election drawn by the doodle look under the default theme
use github.com/synodlang/examples/raft
use github.com/synodlang/looks/doodle
use std/lesson
use std/net
use std/sim

define main
  sim.Seed 3
  net.Latency between 5ms and 15ms
  set nodes to (sim.Cluster of 5 running raft)
  raft.Meet nodes
  after 2s
    set old to (item 0 of raft.Leaders)
    sim.Crash old
    lesson.Ask "The leader just crashed. What do the followers do now?" choosing {"Wait for the old leader to return", "Time out and start an election", "Ask a coordinator service to pick a new leader", "Stop accepting writes for good"}
    after 3s
      sim.Restart old
      lesson.Note "The old leader returns as a follower: it sees a higher term."
  sim.StopAt 8s
# package doodle
use std/disk
use std/lesson
use std/lists
use std/look
use std/net
use std/sim
use std/text
use std/theme

# Nodes stand in a ring inside a dashed frame
when sim.Started
  look.Layout "ring"
  draw look.Frame as frame
  look.Stroke frame with theme.Line
  look.Dash frame on 6 off 6
  look.Tween "opacity" of frame to 0.4 over 0s

# A node is a stick-figure: a small head above the card, its state in captions below
when (sim.Added n)
  draw (look.Card for n) as card for n
  look.Reveal card
  draw (look.Circle 10) as head for n
  look.Stroke head with theme.Ink
  look.Place head above card
  look.Reveal head
  draw (look.Icon "cross") as crash for n
  look.Stroke crash with theme.Critical
  look.Tween "opacity" of crash to 0 over 0s
  look.Place crash beside card
  draw (look.Icon "disk") as drive for n
  look.Tween "opacity" of drive to 0 over 0s
  look.Place drive below card
  set above to card
  each i, line in (sim.StateRows n)
    draw (look.Label line) as row for (text.Join {(sim.Name n), "/", (text.From (i plus 1))})
      look.Tween "text" of row to (item i of (sim.StateRows n)) over 300ms
    look.Role row as "caption"
    look.Place row below above
    set above to row
    look.Reveal row

# A change is written beside the card, then fades; a node shows one note at a time
when (sim.Changed f of n from old to new)
  draw (look.Label (text.Join {(text.From f), ": ", (text.From new)})) as note for n
  look.Role note as "caption"
  look.Place note beside (card of n)
  look.Reveal note
  after 1200ms
    look.Remove note

# A message is a little envelope; its type shows mid-flight, so tags that leave or land together never pile up
when (net.Sent m from a to b)
  draw (look.Icon "mail") as mail for (net.Id m)
  look.Tween "scale" of mail to 0.625 over 0s
  draw (look.Label (net.Type m)) as tag
  look.Role tag as "caption"
  look.Place tag above mail
  look.Tween "opacity" of tag to 0 over 0s
  look.Tween "opacity" of tag to 1 over 120ms
  draw (look.Group {mail, tag}) as dot for (net.Id m)
  look.Bend dot by 0.25
  look.Flight dot from (card of a) to (card of b) for m
  after 200ms
    look.Fade tag to 0

when (net.Arrived m from a to b)
  look.Remove (dot of (net.Id m))

# A lost message turns into a cross, then goes
when (net.Dropped m from a to b because r)
  look.Tween "icon" of (mail of (net.Id m)) to "cross" over 200ms
  after 400ms
    look.Remove (dot of (net.Id m))

when (sim.Crashed n)
  look.Dash (card of n) on 4 off 4
  look.Tween "opacity" of (crash of n) to 1 over 0s
  look.Reveal (crash of n)

when (sim.Restarted n)
  look.Dash (card of n) on 0 off 0
  look.Fade (crash of n) to 0

when (sim.Removed n)
  look.Remove (card of n)
  look.Remove (head of n)
  look.Remove (crash of n)
  look.Remove (drive of n)
  each i in (lists.Range 1 to (lists.Size (sim.StateRows n)))
    look.Remove (row of (text.Join {(sim.Name n), "/", (text.From i)}))

# A partition dashes the cards of the second group; healing makes them solid
when (net.Partitioned a from b)
  each x in b
    look.Dash (card of x) on 8 off 6

when net.Healed
  each x in sim.Nodes
    look.Dash (card of x) on 0 off 0

# A write blinks a disk below the card
when (disk.Written k on n)
  look.Tween "opacity" of (drive of n) to 1 over 0s
  look.Reveal (drive of n)
  after 900ms
    look.Fade (drive of n) to 0

# A broken rule is written at the top and underlined with a dashed line
when (sim.Broken rule)
  draw (look.Label rule) as reason for "reason"
  look.Role reason as "caption"
  look.Tween "y" of reason to 72 over 0s
  draw (look.Rect (8 times (text.Size rule)) by 2) as underline for "underline"
  look.Stroke underline with theme.Critical
  look.Dash underline on 6 off 4
  look.Place underline below reason
  look.Reveal reason
  look.Reveal underline
  after 1800ms
    look.Remove reason
    look.Remove underline

# A lesson note is a caption at the top of the scene
when (sim.Emitted lesson.Noted by origin)
  draw (look.Label lesson.Noted.Text) as note for "note"
  look.Role note as "caption"
  look.Tween "y" of note to 40 over 0s

# Any other emitted event is named beside the node that emitted it
when (sim.Emitted e by n)
  if (n is not sim.Nobody)
    draw (look.Label (net.Type e)) as event
    look.Role event as "caption"
    look.Place event beside (card of n)
    after 1200ms
      look.Remove event

Themes

Every theme gives all 34 names; to make your own, copy std/theme/default or one of these into a folder, set its first line to # theme <folder name> and change the values. The Library has std/theme (the phrases a look reads) and std/theme/default.

Theme values compared

Namestd/theme/defaultsolarized/lightsolarized/darkterminalsketchchalk
Paper #151A2E #FDF6E3 #002B36 #0B0F0B #FFFFFF #1F2B2A
Ink #EDE9E1 #073642 #EEE8D5 #33FF66 #1A1A1A #F2EFE6
Line #3A4366 #93A1A1 #586E75 #1F5F2F #1A1A1A #6B857D
Quiet #8A90A8 #839496 #657B83 #2E9E4F #8C8C8C #97ABA3
Accent #F4A340 #B58900 #B58900 #FFB000 #1F6FD1 #F7D154
Good #5CC8B8 #859900 #859900 #7DFF9A #2A9D3F #8FD694
Warning #E8C35A #CB4B16 #CB4B16 #FFD24A #E09F1F #F2A65A
Critical #E86F5A #DC322F #DC322F #FF5F4A #D62828 #F07167
Message1 #F4A340 #268BD2 #268BD2 #FFB000 #1F6FD1 #F7D154
Message2 #7FB2F0 #2AA198 #2AA198 #33FF66 #D62828 #7FC8F8
Message3 #C79BEA #6C71C4 #6C71C4 #66D9FF #2A9D3F #E8A0D8
Message4 #F08FB0 #D33682 #D33682 #FF7AD9 #7B3FB8 #9EE6B8
Vignette000.350.5500.3
Sketch000010.6
Glow2412241806
Shadow00.150000
StrokeWidth222222.5
CornerRadius121212046
NodeShapecardcardcardcardcardcircle
NodeFillsolidsolidsolidoutlineoutlineoutline
LinkOpacity10.60.60.810.8
Easingsmoothsmoothsmoothsmoothsmoothsmooth
Drift000000
SansInterInterInterJetBrains MonoShantell SansShantell Sans
MonoJetBrains MonoJetBrains MonoJetBrains MonoJetBrains MonoShantell SansShantell Sans
TitleSize282828263030
LabelSize161616161818
ValueSize151515151717
CaptionSize202020182222
TitleWeight600600600700400600
LabelWeight500500500400400400
Tracking0000.0200.01
Margin444444
Fill111111

solarized/light

doodle, solarized light

scene ground

Import: use github.com/synodlang/looks/solarized/light · source on GitHub

Source of solarized/light/light.synod
# theme light
# scene ground
define Paper
  result #FDF6E3

# node cards, primary text
define Ink
  result #073642

# links, borders
define Line
  result #93A1A1

# secondary text, idle nodes
define Quiet
  result #839496

# messages, the one thing to look at
define Accent
  result #B58900

# success, committed
define Good
  result #859900

# candidate, pending
define Warning
  result #CB4B16

# broken invariant, crashed
define Critical
  result #DC322F

# message color 1
define Message1
  result #268BD2

# message color 2
define Message2
  result #2AA198

# message color 3
define Message3
  result #6C71C4

# message color 4
define Message4
  result #D33682

# edge darkening, 0 to 1
define Vignette
  result 0

# outline wobble, 0 to 1
define Sketch
  result 0

# glow blur
define Glow
  result 12

# shadow strength, 0 to 1
define Shadow
  result 0.15

# outline width
define StrokeWidth
  result 2

# rect corners
define CornerRadius
  result 12

# node card shape: "card" or "circle"
define NodeShape
  result "card"

# node card fill: "solid" or "outline"
define NodeFill
  result "solid"

# link opacity
define LinkOpacity
  result 0.6

# motion curve: "smooth" or "spring"
define Easing
  result "smooth"

# camera drift
define Drift
  result 0

# sans face
define Sans
  result "Inter"

# mono face
define Mono
  result "JetBrains Mono"

# title role
define TitleSize
  result 28

# label role
define LabelSize
  result 16

# value role
define ValueSize
  result 15

# caption role
define CaptionSize
  result 20

# title role
define TitleWeight
  result 600

# label, value, caption roles
define LabelWeight
  result 500

# letter spacing
define Tracking
  result 0

# `look.Frame` inset
define Margin
  result 4

# layout scale
define Fill
  result 1
The 34 values of this theme
NameTypeValueMeaning
Papercolor #FDF6E3scene ground
Inkcolor #073642node cards, primary text
Linecolor #93A1A1links, borders
Quietcolor #839496secondary text, idle nodes
Accentcolor #B58900messages, the one thing to look at
Goodcolor #859900success, committed
Warningcolor #CB4B16candidate, pending
Criticalcolor #DC322Fbroken invariant, crashed
Message1color #268BD2message color 1
Message2color #2AA198message color 2
Message3color #6C71C4message color 3
Message4color #D33682message color 4
Vignettenumber0edge darkening, 0 to 1
Sketchnumber0outline wobble, 0 to 1
Glownumber12glow blur
Shadownumber0.15shadow strength, 0 to 1
StrokeWidthnumber2outline width
CornerRadiusnumber12rect corners
NodeShapetextcardnode card shape: "card" or "circle"
NodeFilltextsolidnode card fill: "solid" or "outline"
LinkOpacitynumber0.6link opacity
Easingtextsmoothmotion curve: "smooth" or "spring"
Driftnumber0camera drift
SanstextIntersans face
MonotextJetBrains Monomono face
TitleSizenumber28title role
LabelSizenumber16label role
ValueSizenumber15value role
CaptionSizenumber20caption role
TitleWeightnumber600title role
LabelWeightnumber500label, value, caption roles
Trackingnumber0letter spacing
Marginnumber4`look.Frame` inset
Fillnumber1layout scale

Edit the demo and press Run. Change the use lines to try another look or theme.

# package main
# Raft leader election in the Solarized light theme, drawn by the doodle look
use github.com/synodlang/examples/raft
use github.com/synodlang/looks/doodle
use github.com/synodlang/looks/solarized/light
use std/lesson
use std/net
use std/sim

define main
  sim.Seed 3
  net.Latency between 5ms and 15ms
  set nodes to (sim.Cluster of 5 running raft)
  raft.Meet nodes
  after 2s
    set old to (item 0 of raft.Leaders)
    sim.Crash old
    lesson.Ask "The leader just crashed. What do the followers do now?" choosing {"Wait for the old leader to return", "Time out and start an election", "Ask a coordinator service to pick a new leader", "Stop accepting writes for good"}
    after 3s
      sim.Restart old
      lesson.Note "The old leader returns as a follower: it sees a higher term."
  sim.StopAt 8s
# theme light
# scene ground
define Paper
  result #FDF6E3

# node cards, primary text
define Ink
  result #073642

# links, borders
define Line
  result #93A1A1

# secondary text, idle nodes
define Quiet
  result #839496

# messages, the one thing to look at
define Accent
  result #B58900

# success, committed
define Good
  result #859900

# candidate, pending
define Warning
  result #CB4B16

# broken invariant, crashed
define Critical
  result #DC322F

# message color 1
define Message1
  result #268BD2

# message color 2
define Message2
  result #2AA198

# message color 3
define Message3
  result #6C71C4

# message color 4
define Message4
  result #D33682

# edge darkening, 0 to 1
define Vignette
  result 0

# outline wobble, 0 to 1
define Sketch
  result 0

# glow blur
define Glow
  result 12

# shadow strength, 0 to 1
define Shadow
  result 0.15

# outline width
define StrokeWidth
  result 2

# rect corners
define CornerRadius
  result 12

# node card shape: "card" or "circle"
define NodeShape
  result "card"

# node card fill: "solid" or "outline"
define NodeFill
  result "solid"

# link opacity
define LinkOpacity
  result 0.6

# motion curve: "smooth" or "spring"
define Easing
  result "smooth"

# camera drift
define Drift
  result 0

# sans face
define Sans
  result "Inter"

# mono face
define Mono
  result "JetBrains Mono"

# title role
define TitleSize
  result 28

# label role
define LabelSize
  result 16

# value role
define ValueSize
  result 15

# caption role
define CaptionSize
  result 20

# title role
define TitleWeight
  result 600

# label, value, caption roles
define LabelWeight
  result 500

# letter spacing
define Tracking
  result 0

# `look.Frame` inset
define Margin
  result 4

# layout scale
define Fill
  result 1

solarized/dark

lumen, solarized dark

scene ground

Import: use github.com/synodlang/looks/solarized/dark · source on GitHub

Source of solarized/dark/dark.synod
# theme dark
# scene ground
define Paper
  result #002B36

# node cards, primary text
define Ink
  result #EEE8D5

# links, borders
define Line
  result #586E75

# secondary text, idle nodes
define Quiet
  result #657B83

# messages, the one thing to look at
define Accent
  result #B58900

# success, committed
define Good
  result #859900

# candidate, pending
define Warning
  result #CB4B16

# broken invariant, crashed
define Critical
  result #DC322F

# message color 1
define Message1
  result #268BD2

# message color 2
define Message2
  result #2AA198

# message color 3
define Message3
  result #6C71C4

# message color 4
define Message4
  result #D33682

# edge darkening, 0 to 1
define Vignette
  result 0.35

# outline wobble, 0 to 1
define Sketch
  result 0

# glow blur
define Glow
  result 24

# shadow strength, 0 to 1
define Shadow
  result 0

# outline width
define StrokeWidth
  result 2

# rect corners
define CornerRadius
  result 12

# node card shape: "card" or "circle"
define NodeShape
  result "card"

# node card fill: "solid" or "outline"
define NodeFill
  result "solid"

# link opacity
define LinkOpacity
  result 0.6

# motion curve: "smooth" or "spring"
define Easing
  result "smooth"

# camera drift
define Drift
  result 0

# sans face
define Sans
  result "Inter"

# mono face
define Mono
  result "JetBrains Mono"

# title role
define TitleSize
  result 28

# label role
define LabelSize
  result 16

# value role
define ValueSize
  result 15

# caption role
define CaptionSize
  result 20

# title role
define TitleWeight
  result 600

# label, value, caption roles
define LabelWeight
  result 500

# letter spacing
define Tracking
  result 0

# `look.Frame` inset
define Margin
  result 4

# layout scale
define Fill
  result 1
The 34 values of this theme
NameTypeValueMeaning
Papercolor #002B36scene ground
Inkcolor #EEE8D5node cards, primary text
Linecolor #586E75links, borders
Quietcolor #657B83secondary text, idle nodes
Accentcolor #B58900messages, the one thing to look at
Goodcolor #859900success, committed
Warningcolor #CB4B16candidate, pending
Criticalcolor #DC322Fbroken invariant, crashed
Message1color #268BD2message color 1
Message2color #2AA198message color 2
Message3color #6C71C4message color 3
Message4color #D33682message color 4
Vignettenumber0.35edge darkening, 0 to 1
Sketchnumber0outline wobble, 0 to 1
Glownumber24glow blur
Shadownumber0shadow strength, 0 to 1
StrokeWidthnumber2outline width
CornerRadiusnumber12rect corners
NodeShapetextcardnode card shape: "card" or "circle"
NodeFilltextsolidnode card fill: "solid" or "outline"
LinkOpacitynumber0.6link opacity
Easingtextsmoothmotion curve: "smooth" or "spring"
Driftnumber0camera drift
SanstextIntersans face
MonotextJetBrains Monomono face
TitleSizenumber28title role
LabelSizenumber16label role
ValueSizenumber15value role
CaptionSizenumber20caption role
TitleWeightnumber600title role
LabelWeightnumber500label, value, caption roles
Trackingnumber0letter spacing
Marginnumber4`look.Frame` inset
Fillnumber1layout scale

Edit the demo and press Run. Change the use lines to try another look or theme.

# package main
# Raft leader election in the Solarized dark theme, drawn by the lumen look
use github.com/synodlang/examples/raft
use github.com/synodlang/looks/lumen
use github.com/synodlang/looks/solarized/dark
use std/lesson
use std/net
use std/sim

define main
  sim.Seed 3
  net.Latency between 5ms and 15ms
  set nodes to (sim.Cluster of 5 running raft)
  raft.Meet nodes
  after 2s
    set old to (item 0 of raft.Leaders)
    sim.Crash old
    lesson.Ask "The leader just crashed. What do the followers do now?" choosing {"Wait for the old leader to return", "Time out and start an election", "Ask a coordinator service to pick a new leader", "Stop accepting writes for good"}
    after 3s
      sim.Restart old
      lesson.Note "The old leader returns as a follower: it sees a higher term."
  sim.StopAt 8s
# theme dark
# scene ground
define Paper
  result #002B36

# node cards, primary text
define Ink
  result #EEE8D5

# links, borders
define Line
  result #586E75

# secondary text, idle nodes
define Quiet
  result #657B83

# messages, the one thing to look at
define Accent
  result #B58900

# success, committed
define Good
  result #859900

# candidate, pending
define Warning
  result #CB4B16

# broken invariant, crashed
define Critical
  result #DC322F

# message color 1
define Message1
  result #268BD2

# message color 2
define Message2
  result #2AA198

# message color 3
define Message3
  result #6C71C4

# message color 4
define Message4
  result #D33682

# edge darkening, 0 to 1
define Vignette
  result 0.35

# outline wobble, 0 to 1
define Sketch
  result 0

# glow blur
define Glow
  result 24

# shadow strength, 0 to 1
define Shadow
  result 0

# outline width
define StrokeWidth
  result 2

# rect corners
define CornerRadius
  result 12

# node card shape: "card" or "circle"
define NodeShape
  result "card"

# node card fill: "solid" or "outline"
define NodeFill
  result "solid"

# link opacity
define LinkOpacity
  result 0.6

# motion curve: "smooth" or "spring"
define Easing
  result "smooth"

# camera drift
define Drift
  result 0

# sans face
define Sans
  result "Inter"

# mono face
define Mono
  result "JetBrains Mono"

# title role
define TitleSize
  result 28

# label role
define LabelSize
  result 16

# value role
define ValueSize
  result 15

# caption role
define CaptionSize
  result 20

# title role
define TitleWeight
  result 600

# label, value, caption roles
define LabelWeight
  result 500

# letter spacing
define Tracking
  result 0

# `look.Frame` inset
define Margin
  result 4

# layout scale
define Fill
  result 1

terminal

lumen, terminal

scene ground

Import: use github.com/synodlang/looks/terminal · source on GitHub

Source of terminal/terminal.synod
# theme terminal
# scene ground
define Paper
  result #0B0F0B

# node cards, primary text
define Ink
  result #33FF66

# links, borders
define Line
  result #1F5F2F

# secondary text, idle nodes
define Quiet
  result #2E9E4F

# messages, the one thing to look at
define Accent
  result #FFB000

# success, committed
define Good
  result #7DFF9A

# candidate, pending
define Warning
  result #FFD24A

# broken invariant, crashed
define Critical
  result #FF5F4A

# message color 1
define Message1
  result #FFB000

# message color 2
define Message2
  result #33FF66

# message color 3
define Message3
  result #66D9FF

# message color 4
define Message4
  result #FF7AD9

# edge darkening, 0 to 1
define Vignette
  result 0.55

# outline wobble, 0 to 1
define Sketch
  result 0

# glow blur
define Glow
  result 18

# shadow strength, 0 to 1
define Shadow
  result 0

# outline width
define StrokeWidth
  result 2

# rect corners
define CornerRadius
  result 0

# node card shape: "card" or "circle"
define NodeShape
  result "card"

# node card fill: "solid" or "outline"
define NodeFill
  result "outline"

# link opacity
define LinkOpacity
  result 0.8

# motion curve: "smooth" or "spring"
define Easing
  result "smooth"

# camera drift
define Drift
  result 0

# sans face
define Sans
  result "JetBrains Mono"

# mono face
define Mono
  result "JetBrains Mono"

# title role
define TitleSize
  result 26

# label role
define LabelSize
  result 16

# value role
define ValueSize
  result 15

# caption role
define CaptionSize
  result 18

# title role
define TitleWeight
  result 700

# label, value, caption roles
define LabelWeight
  result 400

# letter spacing
define Tracking
  result 0.02

# `look.Frame` inset
define Margin
  result 4

# layout scale
define Fill
  result 1
The 34 values of this theme
NameTypeValueMeaning
Papercolor #0B0F0Bscene ground
Inkcolor #33FF66node cards, primary text
Linecolor #1F5F2Flinks, borders
Quietcolor #2E9E4Fsecondary text, idle nodes
Accentcolor #FFB000messages, the one thing to look at
Goodcolor #7DFF9Asuccess, committed
Warningcolor #FFD24Acandidate, pending
Criticalcolor #FF5F4Abroken invariant, crashed
Message1color #FFB000message color 1
Message2color #33FF66message color 2
Message3color #66D9FFmessage color 3
Message4color #FF7AD9message color 4
Vignettenumber0.55edge darkening, 0 to 1
Sketchnumber0outline wobble, 0 to 1
Glownumber18glow blur
Shadownumber0shadow strength, 0 to 1
StrokeWidthnumber2outline width
CornerRadiusnumber0rect corners
NodeShapetextcardnode card shape: "card" or "circle"
NodeFilltextoutlinenode card fill: "solid" or "outline"
LinkOpacitynumber0.8link opacity
Easingtextsmoothmotion curve: "smooth" or "spring"
Driftnumber0camera drift
SanstextJetBrains Monosans face
MonotextJetBrains Monomono face
TitleSizenumber26title role
LabelSizenumber16label role
ValueSizenumber15value role
CaptionSizenumber18caption role
TitleWeightnumber700title role
LabelWeightnumber400label, value, caption roles
Trackingnumber0.02letter spacing
Marginnumber4`look.Frame` inset
Fillnumber1layout scale

Edit the demo and press Run. Change the use lines to try another look or theme.

# package main
# Raft leader election in the terminal theme, drawn by the lumen look
use github.com/synodlang/examples/raft
use github.com/synodlang/looks/lumen
use github.com/synodlang/looks/terminal
use std/lesson
use std/net
use std/sim

define main
  sim.Seed 3
  net.Latency between 5ms and 15ms
  set nodes to (sim.Cluster of 5 running raft)
  raft.Meet nodes
  after 2s
    set old to (item 0 of raft.Leaders)
    sim.Crash old
    lesson.Ask "The leader just crashed. What do the followers do now?" choosing {"Wait for the old leader to return", "Time out and start an election", "Ask a coordinator service to pick a new leader", "Stop accepting writes for good"}
    after 3s
      sim.Restart old
      lesson.Note "The old leader returns as a follower: it sees a higher term."
  sim.StopAt 8s
# theme terminal
# scene ground
define Paper
  result #0B0F0B

# node cards, primary text
define Ink
  result #33FF66

# links, borders
define Line
  result #1F5F2F

# secondary text, idle nodes
define Quiet
  result #2E9E4F

# messages, the one thing to look at
define Accent
  result #FFB000

# success, committed
define Good
  result #7DFF9A

# candidate, pending
define Warning
  result #FFD24A

# broken invariant, crashed
define Critical
  result #FF5F4A

# message color 1
define Message1
  result #FFB000

# message color 2
define Message2
  result #33FF66

# message color 3
define Message3
  result #66D9FF

# message color 4
define Message4
  result #FF7AD9

# edge darkening, 0 to 1
define Vignette
  result 0.55

# outline wobble, 0 to 1
define Sketch
  result 0

# glow blur
define Glow
  result 18

# shadow strength, 0 to 1
define Shadow
  result 0

# outline width
define StrokeWidth
  result 2

# rect corners
define CornerRadius
  result 0

# node card shape: "card" or "circle"
define NodeShape
  result "card"

# node card fill: "solid" or "outline"
define NodeFill
  result "outline"

# link opacity
define LinkOpacity
  result 0.8

# motion curve: "smooth" or "spring"
define Easing
  result "smooth"

# camera drift
define Drift
  result 0

# sans face
define Sans
  result "JetBrains Mono"

# mono face
define Mono
  result "JetBrains Mono"

# title role
define TitleSize
  result 26

# label role
define LabelSize
  result 16

# value role
define ValueSize
  result 15

# caption role
define CaptionSize
  result 18

# title role
define TitleWeight
  result 700

# label, value, caption roles
define LabelWeight
  result 400

# letter spacing
define Tracking
  result 0.02

# `look.Frame` inset
define Margin
  result 4

# layout scale
define Fill
  result 1

sketch

doodle, sketch

scene ground

Import: use github.com/synodlang/looks/sketch · source on GitHub

Source of sketch/sketch.synod
# theme sketch
# scene ground
define Paper
  result #FFFFFF

# node cards, primary text
define Ink
  result #1A1A1A

# links, borders
define Line
  result #1A1A1A

# secondary text, idle nodes
define Quiet
  result #8C8C8C

# messages, the one thing to look at
define Accent
  result #1F6FD1

# success, committed
define Good
  result #2A9D3F

# candidate, pending
define Warning
  result #E09F1F

# broken invariant, crashed
define Critical
  result #D62828

# message color 1
define Message1
  result #1F6FD1

# message color 2
define Message2
  result #D62828

# message color 3
define Message3
  result #2A9D3F

# message color 4
define Message4
  result #7B3FB8

# edge darkening, 0 to 1
define Vignette
  result 0

# outline wobble, 0 to 1
define Sketch
  result 1

# glow blur
define Glow
  result 0

# shadow strength, 0 to 1
define Shadow
  result 0

# outline width
define StrokeWidth
  result 2

# rect corners
define CornerRadius
  result 4

# node card shape: "card" or "circle"
define NodeShape
  result "card"

# node card fill: "solid" or "outline"
define NodeFill
  result "outline"

# link opacity
define LinkOpacity
  result 1

# motion curve: "smooth" or "spring"
define Easing
  result "smooth"

# camera drift
define Drift
  result 0

# sans face
define Sans
  result "Shantell Sans"

# mono face
define Mono
  result "Shantell Sans"

# title role
define TitleSize
  result 30

# label role
define LabelSize
  result 18

# value role
define ValueSize
  result 17

# caption role
define CaptionSize
  result 22

# title role
define TitleWeight
  result 400

# label, value, caption roles
define LabelWeight
  result 400

# letter spacing
define Tracking
  result 0

# `look.Frame` inset
define Margin
  result 4

# layout scale
define Fill
  result 1
The 34 values of this theme
NameTypeValueMeaning
Papercolor #FFFFFFscene ground
Inkcolor #1A1A1Anode cards, primary text
Linecolor #1A1A1Alinks, borders
Quietcolor #8C8C8Csecondary text, idle nodes
Accentcolor #1F6FD1messages, the one thing to look at
Goodcolor #2A9D3Fsuccess, committed
Warningcolor #E09F1Fcandidate, pending
Criticalcolor #D62828broken invariant, crashed
Message1color #1F6FD1message color 1
Message2color #D62828message color 2
Message3color #2A9D3Fmessage color 3
Message4color #7B3FB8message color 4
Vignettenumber0edge darkening, 0 to 1
Sketchnumber1outline wobble, 0 to 1
Glownumber0glow blur
Shadownumber0shadow strength, 0 to 1
StrokeWidthnumber2outline width
CornerRadiusnumber4rect corners
NodeShapetextcardnode card shape: "card" or "circle"
NodeFilltextoutlinenode card fill: "solid" or "outline"
LinkOpacitynumber1link opacity
Easingtextsmoothmotion curve: "smooth" or "spring"
Driftnumber0camera drift
SanstextShantell Sanssans face
MonotextShantell Sansmono face
TitleSizenumber30title role
LabelSizenumber18label role
ValueSizenumber17value role
CaptionSizenumber22caption role
TitleWeightnumber400title role
LabelWeightnumber400label, value, caption roles
Trackingnumber0letter spacing
Marginnumber4`look.Frame` inset
Fillnumber1layout scale

Edit the demo and press Run. Change the use lines to try another look or theme.

# package main
# Raft leader election in the sketch theme, drawn by the doodle look
use github.com/synodlang/examples/raft
use github.com/synodlang/looks/doodle
use github.com/synodlang/looks/sketch
use std/lesson
use std/net
use std/sim

define main
  sim.Seed 3
  net.Latency between 5ms and 15ms
  set nodes to (sim.Cluster of 5 running raft)
  raft.Meet nodes
  after 2s
    set old to (item 0 of raft.Leaders)
    sim.Crash old
    lesson.Ask "The leader just crashed. What do the followers do now?" choosing {"Wait for the old leader to return", "Time out and start an election", "Ask a coordinator service to pick a new leader", "Stop accepting writes for good"}
    after 3s
      sim.Restart old
      lesson.Note "The old leader returns as a follower: it sees a higher term."
  sim.StopAt 8s
# theme sketch
# scene ground
define Paper
  result #FFFFFF

# node cards, primary text
define Ink
  result #1A1A1A

# links, borders
define Line
  result #1A1A1A

# secondary text, idle nodes
define Quiet
  result #8C8C8C

# messages, the one thing to look at
define Accent
  result #1F6FD1

# success, committed
define Good
  result #2A9D3F

# candidate, pending
define Warning
  result #E09F1F

# broken invariant, crashed
define Critical
  result #D62828

# message color 1
define Message1
  result #1F6FD1

# message color 2
define Message2
  result #D62828

# message color 3
define Message3
  result #2A9D3F

# message color 4
define Message4
  result #7B3FB8

# edge darkening, 0 to 1
define Vignette
  result 0

# outline wobble, 0 to 1
define Sketch
  result 1

# glow blur
define Glow
  result 0

# shadow strength, 0 to 1
define Shadow
  result 0

# outline width
define StrokeWidth
  result 2

# rect corners
define CornerRadius
  result 4

# node card shape: "card" or "circle"
define NodeShape
  result "card"

# node card fill: "solid" or "outline"
define NodeFill
  result "outline"

# link opacity
define LinkOpacity
  result 1

# motion curve: "smooth" or "spring"
define Easing
  result "smooth"

# camera drift
define Drift
  result 0

# sans face
define Sans
  result "Shantell Sans"

# mono face
define Mono
  result "Shantell Sans"

# title role
define TitleSize
  result 30

# label role
define LabelSize
  result 18

# value role
define ValueSize
  result 17

# caption role
define CaptionSize
  result 22

# title role
define TitleWeight
  result 400

# label, value, caption roles
define LabelWeight
  result 400

# letter spacing
define Tracking
  result 0

# `look.Frame` inset
define Margin
  result 4

# layout scale
define Fill
  result 1

chalk

lumen, chalk

scene ground

Import: use github.com/synodlang/looks/chalk · source on GitHub

Source of chalk/chalk.synod
# theme chalk
# scene ground
define Paper
  result #1F2B2A

# node cards, primary text
define Ink
  result #F2EFE6

# links, borders
define Line
  result #6B857D

# secondary text, idle nodes
define Quiet
  result #97ABA3

# messages, the one thing to look at
define Accent
  result #F7D154

# success, committed
define Good
  result #8FD694

# candidate, pending
define Warning
  result #F2A65A

# broken invariant, crashed
define Critical
  result #F07167

# message color 1
define Message1
  result #F7D154

# message color 2
define Message2
  result #7FC8F8

# message color 3
define Message3
  result #E8A0D8

# message color 4
define Message4
  result #9EE6B8

# edge darkening, 0 to 1
define Vignette
  result 0.3

# outline wobble, 0 to 1
define Sketch
  result 0.6

# glow blur
define Glow
  result 6

# shadow strength, 0 to 1
define Shadow
  result 0

# outline width
define StrokeWidth
  result 2.5

# rect corners
define CornerRadius
  result 6

# node card shape: "card" or "circle"
define NodeShape
  result "circle"

# node card fill: "solid" or "outline"
define NodeFill
  result "outline"

# link opacity
define LinkOpacity
  result 0.8

# motion curve: "smooth" or "spring"
define Easing
  result "smooth"

# camera drift
define Drift
  result 0

# sans face
define Sans
  result "Shantell Sans"

# mono face
define Mono
  result "Shantell Sans"

# title role
define TitleSize
  result 30

# label role
define LabelSize
  result 18

# value role
define ValueSize
  result 17

# caption role
define CaptionSize
  result 22

# title role
define TitleWeight
  result 600

# label, value, caption roles
define LabelWeight
  result 400

# letter spacing
define Tracking
  result 0.01

# `look.Frame` inset
define Margin
  result 4

# layout scale
define Fill
  result 1
The 34 values of this theme
NameTypeValueMeaning
Papercolor #1F2B2Ascene ground
Inkcolor #F2EFE6node cards, primary text
Linecolor #6B857Dlinks, borders
Quietcolor #97ABA3secondary text, idle nodes
Accentcolor #F7D154messages, the one thing to look at
Goodcolor #8FD694success, committed
Warningcolor #F2A65Acandidate, pending
Criticalcolor #F07167broken invariant, crashed
Message1color #F7D154message color 1
Message2color #7FC8F8message color 2
Message3color #E8A0D8message color 3
Message4color #9EE6B8message color 4
Vignettenumber0.3edge darkening, 0 to 1
Sketchnumber0.6outline wobble, 0 to 1
Glownumber6glow blur
Shadownumber0shadow strength, 0 to 1
StrokeWidthnumber2.5outline width
CornerRadiusnumber6rect corners
NodeShapetextcirclenode card shape: "card" or "circle"
NodeFilltextoutlinenode card fill: "solid" or "outline"
LinkOpacitynumber0.8link opacity
Easingtextsmoothmotion curve: "smooth" or "spring"
Driftnumber0camera drift
SanstextShantell Sanssans face
MonotextShantell Sansmono face
TitleSizenumber30title role
LabelSizenumber18label role
ValueSizenumber17value role
CaptionSizenumber22caption role
TitleWeightnumber600title role
LabelWeightnumber400label, value, caption roles
Trackingnumber0.01letter spacing
Marginnumber4`look.Frame` inset
Fillnumber1layout scale

Edit the demo and press Run. Change the use lines to try another look or theme.

# package main
# Raft leader election in the chalk theme, drawn by the lumen look
use github.com/synodlang/examples/raft
use github.com/synodlang/looks/chalk
use github.com/synodlang/looks/lumen
use std/lesson
use std/net
use std/sim

define main
  sim.Seed 3
  net.Latency between 5ms and 15ms
  set nodes to (sim.Cluster of 5 running raft)
  raft.Meet nodes
  after 2s
    set old to (item 0 of raft.Leaders)
    sim.Crash old
    lesson.Ask "The leader just crashed. What do the followers do now?" choosing {"Wait for the old leader to return", "Time out and start an election", "Ask a coordinator service to pick a new leader", "Stop accepting writes for good"}
    after 3s
      sim.Restart old
      lesson.Note "The old leader returns as a follower: it sees a higher term."
  sim.StopAt 8s
# theme chalk
# scene ground
define Paper
  result #1F2B2A

# node cards, primary text
define Ink
  result #F2EFE6

# links, borders
define Line
  result #6B857D

# secondary text, idle nodes
define Quiet
  result #97ABA3

# messages, the one thing to look at
define Accent
  result #F7D154

# success, committed
define Good
  result #8FD694

# candidate, pending
define Warning
  result #F2A65A

# broken invariant, crashed
define Critical
  result #F07167

# message color 1
define Message1
  result #F7D154

# message color 2
define Message2
  result #7FC8F8

# message color 3
define Message3
  result #E8A0D8

# message color 4
define Message4
  result #9EE6B8

# edge darkening, 0 to 1
define Vignette
  result 0.3

# outline wobble, 0 to 1
define Sketch
  result 0.6

# glow blur
define Glow
  result 6

# shadow strength, 0 to 1
define Shadow
  result 0

# outline width
define StrokeWidth
  result 2.5

# rect corners
define CornerRadius
  result 6

# node card shape: "card" or "circle"
define NodeShape
  result "circle"

# node card fill: "solid" or "outline"
define NodeFill
  result "outline"

# link opacity
define LinkOpacity
  result 0.8

# motion curve: "smooth" or "spring"
define Easing
  result "smooth"

# camera drift
define Drift
  result 0

# sans face
define Sans
  result "Shantell Sans"

# mono face
define Mono
  result "Shantell Sans"

# title role
define TitleSize
  result 30

# label role
define LabelSize
  result 18

# value role
define ValueSize
  result 17

# caption role
define CaptionSize
  result 22

# title role
define TitleWeight
  result 600

# label, value, caption roles
define LabelWeight
  result 400

# letter spacing
define Tracking
  result 0.01

# `look.Frame` inset
define Margin
  result 4

# layout scale
define Fill
  result 1