Documentation
¶
Overview ¶
Package theme is the look lfm gives every editable file of a product: the faces, colors and typesetting a concept's Look decides, on a quiet base for what it leaves open, the color math its checks need, and the DrawingML theme part Word and PowerPoint read, so a set's documents and decks match.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Base = Theme{Base: 10.5, Leading: 1.42, Ratio: 1.25, HeadingBold: true, Table: "booktabs", Ornament: "·", Ink: "#1E1F22", Muted: "#5B5F66", Accent: "#1E1F22", Tint: Tint("#1E1F22", 0.92), Stroke: "#C9CCD1"}
Base is the typesetting a Look starts from. It holds no faces and no accent of its own: a concept names its families, and a set without an accent stays in its ink.
var Variants = map[string]string{
"base": "Text font: Lora",
"indented": "Text font: Lora\nParagraphs: indented\nHeadings: regular\nText size: 11.5\nLine height: 1.35\nOrnament: ❧\nAccent: #7A2E2E",
"hairline": "Text font: Lora\nTables: hairline\nText size: 10\nLine height: 1.45\nHeading scale: 1.2\nAccent: #1F4FD1",
"monochrome": "Text font: Lora\nTables: hairline\nText size: 10\nLine height: 1.5\nHeading scale: 1.125",
"accent-headings": "Text font: Lora\nHeadings: regular\nHeading color: accent\nText size: 11\nLine height: 1.45\nOrnament: ❦\nAccent: #9C4A2C",
"grid": "Text font: Lora\nTables: grid\nText size: 10\nLine height: 1.4\nHeading scale: 1.2\nOrnament: ■\nAccent: #2F4A6D",
}
Variants are Looks that between them use every typesetting mechanism a concept decides: lfm's tests build every file format in each. The faces are the test fixtures' own; a product names its families.
Functions ¶
Types ¶
type Look ¶
type Look struct {
TextFont, HeadFont, Accent string
Paragraphs, Tables, Headings, Color string // spaced|indented, booktabs|hairline|grid, bold|regular, ink|accent
TextSize, LineHeight, HeadingScale float64
Ornament string
}
Look is a concept's Look section: the faces, the accent and whatever typesetting the concept decides; what it leaves out comes from Base.
type Theme ¶
type Theme struct {
Text, Heading string // font families the concept names
Base float64 // body size in pt
Leading float64 // body line height as a multiple of the size
Ratio float64 // heading scale
Indent bool // paragraphs separate by a first-line indent instead of space
HeadingBold bool
HeadingAccent bool // headings take the accent; otherwise the ink
Table string // booktabs, hairline or grid
Ornament string // the section break glyph
Ink, Muted string
Accent, Tint string
Stroke string // hairlines and table rules
}
Theme is the look of every editable file of a product: the tokens a concept's Look decides and the compiler turns into Word and PowerPoint styles, so the documents of a set match and nothing is formatted by hand.
func (Theme) ColorProblems ¶
ColorProblems are the colors of a theme that do not read on white or on its tint.