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
| Name | std/theme/default | solarized/light | solarized/dark | terminal | sketch | chalk |
|---|---|---|---|---|---|---|
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 |
Vignette | 0 | 0 | 0.35 | 0.55 | 0 | 0.3 |
Sketch | 0 | 0 | 0 | 0 | 1 | 0.6 |
Glow | 24 | 12 | 24 | 18 | 0 | 6 |
Shadow | 0 | 0.15 | 0 | 0 | 0 | 0 |
StrokeWidth | 2 | 2 | 2 | 2 | 2 | 2.5 |
CornerRadius | 12 | 12 | 12 | 0 | 4 | 6 |
NodeShape | card | card | card | card | card | circle |
NodeFill | solid | solid | solid | outline | outline | outline |
LinkOpacity | 1 | 0.6 | 0.6 | 0.8 | 1 | 0.8 |
Easing | smooth | smooth | smooth | smooth | smooth | smooth |
Drift | 0 | 0 | 0 | 0 | 0 | 0 |
Sans | Inter | Inter | Inter | JetBrains Mono | Shantell Sans | Shantell Sans |
Mono | JetBrains Mono | JetBrains Mono | JetBrains Mono | JetBrains Mono | Shantell Sans | Shantell Sans |
TitleSize | 28 | 28 | 28 | 26 | 30 | 30 |
LabelSize | 16 | 16 | 16 | 16 | 18 | 18 |
ValueSize | 15 | 15 | 15 | 15 | 17 | 17 |
CaptionSize | 20 | 20 | 20 | 18 | 22 | 22 |
TitleWeight | 600 | 600 | 600 | 700 | 400 | 600 |
LabelWeight | 500 | 500 | 500 | 400 | 400 | 400 |
Tracking | 0 | 0 | 0 | 0.02 | 0 | 0.01 |
Margin | 4 | 4 | 4 | 4 | 4 | 4 |
Fill | 1 | 1 | 1 | 1 | 1 | 1 |
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
| Name | Type | Value | Meaning |
|---|---|---|---|
Paper | color | #FDF6E3 | scene ground |
Ink | color | #073642 | node cards, primary text |
Line | color | #93A1A1 | links, borders |
Quiet | color | #839496 | secondary text, idle nodes |
Accent | color | #B58900 | messages, the one thing to look at |
Good | color | #859900 | success, committed |
Warning | color | #CB4B16 | candidate, pending |
Critical | color | #DC322F | broken invariant, crashed |
Message1 | color | #268BD2 | message color 1 |
Message2 | color | #2AA198 | message color 2 |
Message3 | color | #6C71C4 | message color 3 |
Message4 | color | #D33682 | message color 4 |
Vignette | number | 0 | edge darkening, 0 to 1 |
Sketch | number | 0 | outline wobble, 0 to 1 |
Glow | number | 12 | glow blur |
Shadow | number | 0.15 | shadow strength, 0 to 1 |
StrokeWidth | number | 2 | outline width |
CornerRadius | number | 12 | rect corners |
NodeShape | text | card | node card shape: "card" or "circle" |
NodeFill | text | solid | node card fill: "solid" or "outline" |
LinkOpacity | number | 0.6 | link opacity |
Easing | text | smooth | motion curve: "smooth" or "spring" |
Drift | number | 0 | camera drift |
Sans | text | Inter | sans face |
Mono | text | JetBrains Mono | mono face |
TitleSize | number | 28 | title role |
LabelSize | number | 16 | label role |
ValueSize | number | 15 | value role |
CaptionSize | number | 20 | caption role |
TitleWeight | number | 600 | title role |
LabelWeight | number | 500 | label, value, caption roles |
Tracking | number | 0 | letter spacing |
Margin | number | 4 | `look.Frame` inset |
Fill | number | 1 | layout 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
| Name | Type | Value | Meaning |
|---|---|---|---|
Paper | color | #002B36 | scene ground |
Ink | color | #EEE8D5 | node cards, primary text |
Line | color | #586E75 | links, borders |
Quiet | color | #657B83 | secondary text, idle nodes |
Accent | color | #B58900 | messages, the one thing to look at |
Good | color | #859900 | success, committed |
Warning | color | #CB4B16 | candidate, pending |
Critical | color | #DC322F | broken invariant, crashed |
Message1 | color | #268BD2 | message color 1 |
Message2 | color | #2AA198 | message color 2 |
Message3 | color | #6C71C4 | message color 3 |
Message4 | color | #D33682 | message color 4 |
Vignette | number | 0.35 | edge darkening, 0 to 1 |
Sketch | number | 0 | outline wobble, 0 to 1 |
Glow | number | 24 | glow blur |
Shadow | number | 0 | shadow strength, 0 to 1 |
StrokeWidth | number | 2 | outline width |
CornerRadius | number | 12 | rect corners |
NodeShape | text | card | node card shape: "card" or "circle" |
NodeFill | text | solid | node card fill: "solid" or "outline" |
LinkOpacity | number | 0.6 | link opacity |
Easing | text | smooth | motion curve: "smooth" or "spring" |
Drift | number | 0 | camera drift |
Sans | text | Inter | sans face |
Mono | text | JetBrains Mono | mono face |
TitleSize | number | 28 | title role |
LabelSize | number | 16 | label role |
ValueSize | number | 15 | value role |
CaptionSize | number | 20 | caption role |
TitleWeight | number | 600 | title role |
LabelWeight | number | 500 | label, value, caption roles |
Tracking | number | 0 | letter spacing |
Margin | number | 4 | `look.Frame` inset |
Fill | number | 1 | layout 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
| Name | Type | Value | Meaning |
|---|---|---|---|
Paper | color | #0B0F0B | scene ground |
Ink | color | #33FF66 | node cards, primary text |
Line | color | #1F5F2F | links, borders |
Quiet | color | #2E9E4F | secondary text, idle nodes |
Accent | color | #FFB000 | messages, the one thing to look at |
Good | color | #7DFF9A | success, committed |
Warning | color | #FFD24A | candidate, pending |
Critical | color | #FF5F4A | broken invariant, crashed |
Message1 | color | #FFB000 | message color 1 |
Message2 | color | #33FF66 | message color 2 |
Message3 | color | #66D9FF | message color 3 |
Message4 | color | #FF7AD9 | message color 4 |
Vignette | number | 0.55 | edge darkening, 0 to 1 |
Sketch | number | 0 | outline wobble, 0 to 1 |
Glow | number | 18 | glow blur |
Shadow | number | 0 | shadow strength, 0 to 1 |
StrokeWidth | number | 2 | outline width |
CornerRadius | number | 0 | rect corners |
NodeShape | text | card | node card shape: "card" or "circle" |
NodeFill | text | outline | node card fill: "solid" or "outline" |
LinkOpacity | number | 0.8 | link opacity |
Easing | text | smooth | motion curve: "smooth" or "spring" |
Drift | number | 0 | camera drift |
Sans | text | JetBrains Mono | sans face |
Mono | text | JetBrains Mono | mono face |
TitleSize | number | 26 | title role |
LabelSize | number | 16 | label role |
ValueSize | number | 15 | value role |
CaptionSize | number | 18 | caption role |
TitleWeight | number | 700 | title role |
LabelWeight | number | 400 | label, value, caption roles |
Tracking | number | 0.02 | letter spacing |
Margin | number | 4 | `look.Frame` inset |
Fill | number | 1 | layout 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
| Name | Type | Value | Meaning |
|---|---|---|---|
Paper | color | #FFFFFF | scene ground |
Ink | color | #1A1A1A | node cards, primary text |
Line | color | #1A1A1A | links, borders |
Quiet | color | #8C8C8C | secondary text, idle nodes |
Accent | color | #1F6FD1 | messages, the one thing to look at |
Good | color | #2A9D3F | success, committed |
Warning | color | #E09F1F | candidate, pending |
Critical | color | #D62828 | broken invariant, crashed |
Message1 | color | #1F6FD1 | message color 1 |
Message2 | color | #D62828 | message color 2 |
Message3 | color | #2A9D3F | message color 3 |
Message4 | color | #7B3FB8 | message color 4 |
Vignette | number | 0 | edge darkening, 0 to 1 |
Sketch | number | 1 | outline wobble, 0 to 1 |
Glow | number | 0 | glow blur |
Shadow | number | 0 | shadow strength, 0 to 1 |
StrokeWidth | number | 2 | outline width |
CornerRadius | number | 4 | rect corners |
NodeShape | text | card | node card shape: "card" or "circle" |
NodeFill | text | outline | node card fill: "solid" or "outline" |
LinkOpacity | number | 1 | link opacity |
Easing | text | smooth | motion curve: "smooth" or "spring" |
Drift | number | 0 | camera drift |
Sans | text | Shantell Sans | sans face |
Mono | text | Shantell Sans | mono face |
TitleSize | number | 30 | title role |
LabelSize | number | 18 | label role |
ValueSize | number | 17 | value role |
CaptionSize | number | 22 | caption role |
TitleWeight | number | 400 | title role |
LabelWeight | number | 400 | label, value, caption roles |
Tracking | number | 0 | letter spacing |
Margin | number | 4 | `look.Frame` inset |
Fill | number | 1 | layout 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
| Name | Type | Value | Meaning |
|---|---|---|---|
Paper | color | #1F2B2A | scene ground |
Ink | color | #F2EFE6 | node cards, primary text |
Line | color | #6B857D | links, borders |
Quiet | color | #97ABA3 | secondary text, idle nodes |
Accent | color | #F7D154 | messages, the one thing to look at |
Good | color | #8FD694 | success, committed |
Warning | color | #F2A65A | candidate, pending |
Critical | color | #F07167 | broken invariant, crashed |
Message1 | color | #F7D154 | message color 1 |
Message2 | color | #7FC8F8 | message color 2 |
Message3 | color | #E8A0D8 | message color 3 |
Message4 | color | #9EE6B8 | message color 4 |
Vignette | number | 0.3 | edge darkening, 0 to 1 |
Sketch | number | 0.6 | outline wobble, 0 to 1 |
Glow | number | 6 | glow blur |
Shadow | number | 0 | shadow strength, 0 to 1 |
StrokeWidth | number | 2.5 | outline width |
CornerRadius | number | 6 | rect corners |
NodeShape | text | circle | node card shape: "card" or "circle" |
NodeFill | text | outline | node card fill: "solid" or "outline" |
LinkOpacity | number | 0.8 | link opacity |
Easing | text | smooth | motion curve: "smooth" or "spring" |
Drift | number | 0 | camera drift |
Sans | text | Shantell Sans | sans face |
Mono | text | Shantell Sans | mono face |
TitleSize | number | 30 | title role |
LabelSize | number | 18 | label role |
ValueSize | number | 17 | value role |
CaptionSize | number | 22 | caption role |
TitleWeight | number | 600 | title role |
LabelWeight | number | 400 | label, value, caption roles |
Tracking | number | 0.01 | letter spacing |
Margin | number | 4 | `look.Frame` inset |
Fill | number | 1 | layout 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