std/theme

the program's theme values

A theme is a package whose files start # theme <word> (spec/06 §6.7). The program's theme is the theme its main file imports, else std/theme/default. std/theme is the interface to it: each of these 34 names is a one-word look-context native whose result is the value the program's theme gives, read in a look as theme.<Name> (for example theme.Paper). A theme exports no phrase, so theme.<Name> is the only spelling. The names are look context only, so a theme never changes a run. Every theme defines each name exactly once, with a value of the name's type inside the domain its Meaning gives (bad-theme). Colors keep their bare names in the scene theme (spec/09 §9.5). Sans and Mono name only the four families of the font set (decision 118).

Phrases

theme.Paper

Scene ground color

Gives
color
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:3
Examples
theme/palette

theme.Ink

Node cards and primary text color

Gives
color
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:6
Examples
theme/palette

theme.Line

Links and borders color

Gives
color
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:9
Examples
theme/palette

theme.Quiet

Secondary text and idle nodes color

Gives
color
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:12
Examples
theme/palette

theme.Accent

Messages color: the one thing to look at

Gives
color
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:15
Examples
theme/palette

theme.Good

Success and committed color

Gives
color
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:18
Examples
theme/palette

theme.Warning

Candidate and pending color

Gives
color
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:21
Examples
theme/palette

theme.Critical

Broken invariant and crashed color

Gives
color
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:24
Examples
theme/palette

theme.Message1

First of four message colors, picked by look.MessageColor

Gives
color
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:27
Examples
theme/values

theme.Message2

Second of four message colors

Gives
color
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:30
Examples
theme/values

theme.Message3

Third of four message colors

Gives
color
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:33
Examples
theme/values

theme.Message4

Fourth of four message colors

Gives
color
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:36
Examples
theme/values

theme.Vignette

Darkening of the scene edges, 0 to 1

Gives
number
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:39
Examples
theme/values

theme.Sketch

Hand-drawn wobble of outlines, 0 to 1

Gives
number
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:42
Examples
theme/values

theme.Glow

Glow blur in units, 0 to 48

Gives
number
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:45
Examples
theme/values

theme.Shadow

Shadow strength of filled shapes, 0 to 1

Gives
number
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:48
Examples
theme/values

theme.StrokeWidth

Outline width in units, 0.5 to 6

Gives
number
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:51
Examples
theme/values

theme.CornerRadius

Corner radius of rects in units, 0 to 40

Gives
number
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:54
Examples
theme/values

theme.NodeShape

Shape of a node card: "card" or "circle"

Gives
text
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:57
Examples
theme/values

theme.NodeFill

Fill of a node card: "solid" or "outline"

Gives
text
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:60
Examples
theme/values

theme.LinkOpacity

Opacity of links, 0 to 1

Gives
number
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:63
Examples
theme/values

theme.Easing

Curve of position, scale, rotation and camera moves: "smooth" or "spring"

Gives
text
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:66
Examples
theme/values

theme.Drift

Slow camera drift in units, 0 to 24

Gives
number
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:69
Examples
theme/values

theme.Sans

Family of the sans face: "Inter", "JetBrains Mono", "Source Serif 4" or "Shantell Sans"

Gives
text
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:72
Examples
theme/values

theme.Mono

Family of the mono face: "Inter", "JetBrains Mono", "Source Serif 4" or "Shantell Sans"

Gives
text
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:75
Examples
theme/values

theme.TitleSize

Size of the title role in units, 12 to 64

Gives
number
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:78
Examples
theme/values

theme.LabelSize

Size of the label role in units, 10 to 40

Gives
number
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:81
Examples
theme/values

theme.ValueSize

Size of the value role in units, 10 to 40

Gives
number
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:84
Examples
theme/values

theme.CaptionSize

Size of the caption role in units, 12 to 48

Gives
number
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:87
Examples
theme/values

theme.TitleWeight

Weight of the title role: 400, 500, 600 or 700

Gives
number
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:90
Examples
theme/values

theme.LabelWeight

Weight of the label, value and caption roles: 400, 500, 600 or 700

Gives
number
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:93
Examples
theme/values

theme.Tracking

Letter spacing in em, -0.05 to 0.2

Gives
number
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:96
Examples
theme/values

theme.Margin

Inset of look.Frame in units, 0 to 100

Gives
number
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:99
Examples
theme/values

theme.Fill

Scale of layout radii and spacing, 0.5 to 1.5

Gives
number
Contexts
look
Kind
phrase, native
Source
theme/theme.synod:102
Examples
theme/values

More looks and themes, with an editable demo each, are on Looks & Themes; the gallery plays every pair.

Examples

palette

Shows every theme color (Paper, Ink, Line, Quiet, Accent, Good, Warning, Critical) as a swatch

# package main
# Shows every theme color (Paper, Ink, Line, Quiet, Accent, Good, Warning, Critical) as a swatch
use example.com/library/theme/palette
use std/sim

define main
  sim.StopAt 1s
# package palette
use std/look
use std/sim
use std/theme

# One swatch per theme color, in a row
when sim.Started
  draw (look.Rect 1032 by 642) as ground
  look.Fill ground with theme.Paper
  look.Stroke ground with theme.Line
  draw (look.Rect 100 by 100) as ink
  look.Fill ink with theme.Ink
  draw (look.Rect 100 by 100) as quiet
  look.Fill quiet with theme.Quiet
  look.Place quiet beside ink
  draw (look.Rect 100 by 100) as accent
  look.Fill accent with theme.Accent
  look.Place accent beside quiet
  draw (look.Rect 100 by 100) as good
  look.Fill good with theme.Good
  look.Place good beside accent
  draw (look.Rect 100 by 100) as warning
  look.Fill warning with theme.Warning
  look.Place warning beside good
  draw (look.Rect 100 by 100) as critical
  look.Fill critical with theme.Critical
  look.Place critical beside warning

values

Shows every theme value of std/theme not yet shown by the palette: message colors, effects, shapes and type

# package main
# Shows every theme value of std/theme not yet shown by the palette: message colors, effects, shapes and type
use example.com/library/theme/values
use std/sim

define main
  sim.StopAt 1s
# package values
use std/look
use std/sim
use std/theme

# The four message colors as swatches, the numbers as counters, the texts as labels
when sim.Started
  draw (look.Rect 60 by 60) as m1
  look.Fill m1 with theme.Message1
  draw (look.Rect 60 by 60) as m2
  look.Fill m2 with theme.Message2
  look.Place m2 beside m1
  draw (look.Rect 60 by 60) as m3
  look.Fill m3 with theme.Message3
  look.Place m3 beside m2
  draw (look.Rect 60 by 60) as m4
  look.Fill m4 with theme.Message4
  look.Place m4 beside m3
  draw (look.Counter theme.Vignette) as vignette
  look.Place vignette below m1
  draw (look.Counter theme.Sketch) as sketch
  look.Place sketch below vignette
  draw (look.Counter theme.Glow) as glow
  look.Place glow below sketch
  draw (look.Counter theme.Shadow) as shadow
  look.Place shadow below glow
  draw (look.Counter theme.StrokeWidth) as strokewidth
  look.Place strokewidth below shadow
  draw (look.Counter theme.CornerRadius) as cornerradius
  look.Place cornerradius below strokewidth
  draw (look.Counter theme.LinkOpacity) as linkopacity
  look.Place linkopacity below cornerradius
  draw (look.Counter theme.Drift) as drift
  look.Place drift below linkopacity
  draw (look.Counter theme.TitleSize) as titlesize
  look.Place titlesize below drift
  draw (look.Counter theme.LabelSize) as labelsize
  look.Place labelsize below titlesize
  draw (look.Counter theme.ValueSize) as valuesize
  look.Place valuesize below labelsize
  draw (look.Counter theme.CaptionSize) as captionsize
  look.Place captionsize below valuesize
  draw (look.Counter theme.TitleWeight) as titleweight
  look.Place titleweight below captionsize
  draw (look.Counter theme.LabelWeight) as labelweight
  look.Place labelweight below titleweight
  draw (look.Counter theme.Tracking) as tracking
  look.Place tracking below labelweight
  draw (look.Counter theme.Margin) as margin
  look.Place margin below tracking
  draw (look.Counter theme.Fill) as fill
  look.Place fill below margin
  draw (look.Label theme.NodeShape) as nodeshape
  look.Place nodeshape below fill
  draw (look.Label theme.NodeFill) as nodefill
  look.Place nodefill below nodeshape
  draw (look.Label theme.Easing) as easing
  look.Place easing below nodefill
  draw (look.Label theme.Sans) as sans
  look.Place sans below easing
  draw (look.Label theme.Mono) as mono
  look.Place mono below sans