486 lines
12 KiB
Plaintext
486 lines
12 KiB
Plaintext
// ----- Available color themes -----
|
||
#let default-theme = "warm"
|
||
#let themes = (
|
||
warm: (
|
||
// ----- Base colors -----
|
||
ink: rgb("#302c26"),
|
||
muted-ink: rgb("#716957"),
|
||
gold: rgb("#9b8050"),
|
||
dark-gold: rgb("#70582f"),
|
||
parchment: rgb("#F4EBD8"),
|
||
parchment-dark: rgb("#ece4d2"),
|
||
parchment-light: rgb("#fbf9f3"),
|
||
parchment-accent: rgb("#EDE1C8"),
|
||
border: rgb("#c9bda4"),
|
||
blood: rgb("#7A2424"),
|
||
muted: rgb("#756B5D"),
|
||
|
||
// ----- Semantic colors -----
|
||
heading: rgb("#7A2424"),
|
||
heading-accent: rgb("#9b8050"),
|
||
heading-subtle: rgb("#716957"),
|
||
emphasis: rgb("#7A2424"),
|
||
link: rgb("#7A2424"),
|
||
|
||
// ----- Heading and decorative symbols -----
|
||
heading-numbering: "1.",
|
||
section-symbol: "❖",
|
||
chapter-symbol: "✧",
|
||
small-symbol: "•",
|
||
bullet-symbol: "–",
|
||
separator-symbol: "◆",
|
||
// ----- Progress bar and the sort -----
|
||
progress-full: "●",
|
||
progress-half: "◐",
|
||
progress-void: "○",
|
||
// ----- Misc -----
|
||
star: "★",
|
||
font: "Libertinus Serif",
|
||
),
|
||
|
||
steel: (
|
||
// ----- Base colors -----
|
||
ink: rgb("#292B32"),
|
||
muted-ink: rgb("#626873"),
|
||
gold: rgb("#7187A0"),
|
||
dark-gold: rgb("#465A72"),
|
||
parchment: rgb("#EEF1F3"),
|
||
parchment-dark: rgb("#DCE2E7"),
|
||
parchment-light: rgb("#F7F9FA"),
|
||
parchment-accent: rgb("#DCE3E8"),
|
||
border: rgb("#B8C2CC"),
|
||
blood: rgb("#526D85"),
|
||
muted: rgb("#69717C"),
|
||
|
||
// ----- Semantic colors -----
|
||
heading: rgb("#526D85"),
|
||
heading-accent: rgb("#7187A0"),
|
||
heading-subtle: rgb("#626873"),
|
||
emphasis: rgb("#526D85"),
|
||
link: rgb("#526D85"),
|
||
|
||
// ----- Heading and decorative symbols -----
|
||
heading-numbering: "1.",
|
||
section-symbol: "◆",
|
||
chapter-symbol: "◇",
|
||
small-symbol: "·",
|
||
),
|
||
|
||
fangdrael: (
|
||
// ----- Base colors -----
|
||
ink: rgb("#29302A"),
|
||
muted-ink: rgb("#687064"),
|
||
gold: rgb("#7F8F62"),
|
||
dark-gold: rgb("#53603D"),
|
||
parchment: rgb("#F1F2E8"),
|
||
parchment-dark: rgb("#E1E4D5"),
|
||
parchment-light: rgb("#FAFBF5"),
|
||
parchment-accent: rgb("#E3E5D4"),
|
||
border: rgb("#BDC3AE"),
|
||
blood: rgb("#536B45"),
|
||
muted: rgb("#6D7568"),
|
||
|
||
// ----- Semantic colors -----
|
||
heading: rgb("#536B45"),
|
||
heading-accent: rgb("#7F8F62"),
|
||
heading-subtle: rgb("#687064"),
|
||
emphasis: rgb("#536B45"),
|
||
link: rgb("#536B45"),
|
||
|
||
// ----- Heading and decorative symbols -----
|
||
heading-numbering: "1.",
|
||
section-symbol: "❦",
|
||
chapter-symbol: "›",
|
||
small-symbol: "·",
|
||
),
|
||
|
||
bw: (
|
||
// ----- Base colors -----
|
||
ink: rgb("#202020"),
|
||
muted-ink: rgb("#666666"),
|
||
gold: rgb("#777777"),
|
||
dark-gold: rgb("#484848"),
|
||
parchment: rgb("#eeeeee"),
|
||
parchment-dark: rgb("#dddddd"),
|
||
parchment-light: rgb("#fafafa"),
|
||
parchment-accent: rgb("#E2E2E2"),
|
||
border: rgb("#b5b5b5"),
|
||
blood: rgb("#444444"),
|
||
muted: rgb("#707070"),
|
||
|
||
// ----- Semantic colors -----
|
||
heading: rgb("#202020"),
|
||
heading-accent: rgb("#484848"),
|
||
heading-subtle: rgb("#666666"),
|
||
emphasis: rgb("#202020"),
|
||
link: rgb("#202020"),
|
||
),
|
||
|
||
high-contrast: (
|
||
// ----- Core colors -----
|
||
ink: rgb("#111111"),
|
||
muted-ink: rgb("#333333"),
|
||
gold: rgb("#005A9C"),
|
||
dark-gold: rgb("#003B66"),
|
||
parchment: rgb("#FFFFFF"),
|
||
parchment-dark: rgb("#E6E6E6"),
|
||
parchment-light: rgb("#FFFFFF"),
|
||
parchment-accent: rgb("#FFF4CC"),
|
||
border: rgb("#555555"),
|
||
blood: rgb("#A40000"),
|
||
muted: rgb("#444444"),
|
||
|
||
// ----- Semantic colors -----
|
||
heading: rgb("#003B66"),
|
||
heading-accent: rgb("#005A9C"),
|
||
heading-subtle: rgb("#333333"),
|
||
emphasis: rgb("#A40000"),
|
||
link: rgb("#003B66"),
|
||
),
|
||
|
||
yon-sen: (
|
||
// ----- Base colors -----
|
||
ink: rgb("#292724"),
|
||
muted-ink: rgb("#625D54"),
|
||
vermilion: rgb("#9E3B2F"),
|
||
dark-vermilion: rgb("#743129"),
|
||
indigo: rgb("#304C5E"),
|
||
dark-indigo: rgb("#263D4B"),
|
||
moss: rgb("#68705A"),
|
||
dark-moss: rgb("#4D5644"),
|
||
gold: rgb("#A88A54"),
|
||
dark-gold: rgb("#78633D"),
|
||
parchment: rgb("#F3EBDD"),
|
||
parchment-dark: rgb("#E7DDC9"),
|
||
parchment-light: rgb("#FAF6EC"),
|
||
parchment-accent: rgb("#EEE4D1"),
|
||
border: rgb("#C8BDA8"),
|
||
muted: rgb("#777064"),
|
||
|
||
// ----- Semantic colors -----
|
||
heading: rgb("#743129"),
|
||
heading-accent: rgb("#304C5E"),
|
||
heading-subtle: rgb("#625D54"),
|
||
emphasis: rgb("#743129"),
|
||
link: rgb("#304C5E"),
|
||
blood: rgb("#8C3029"),
|
||
|
||
// ----- Heading and decorative symbols -----
|
||
heading-numbering: "一、",
|
||
section-symbol: "※",
|
||
separator-symbol: "—",
|
||
important-symbol: "※",
|
||
quote-symbol: "「",
|
||
),
|
||
// steingrund: (
|
||
// // ----- Base colors -----
|
||
// ink: rgb("#25262B"),
|
||
// muted-ink: rgb("#686A73"),
|
||
// gold: rgb("#8E96A8"),
|
||
// dark-gold: rgb("#5C6372"),
|
||
// parchment: rgb("#EEF0F2"),
|
||
// parchment-dark: rgb("#D9DDE1"),
|
||
// parchment-light: rgb("#F8F9FA"),
|
||
// parchment-accent: rgb("#E1E5E9"),
|
||
// border: rgb("#B5BBC3"),
|
||
// blood: rgb("#6F2535"),
|
||
// muted: rgb("#747781"),
|
||
|
||
// // ----- Semantic colors -----
|
||
// heading: rgb("#572331"),
|
||
// heading-accent: rgb("#7D879B"),
|
||
// heading-subtle: rgb("#686A73"),
|
||
// emphasis: rgb("#78283B"),
|
||
// link: rgb("#53667D"),
|
||
|
||
// // ----- Heading and decorative symbols -----
|
||
// heading-numbering: "I.",
|
||
// section-symbol: "†",
|
||
// chapter-symbol: "✠",
|
||
// small-symbol: "·",
|
||
// bullet-symbol: "–",
|
||
// separator-symbol: "❖",
|
||
|
||
// // ----- Progress bar and the sort -----
|
||
// progress-full: "◆",
|
||
// progress-half: "◈",
|
||
// progress-void: "◇",
|
||
|
||
// // ----- Misc -----
|
||
// star: "✦",
|
||
// font: "Libertinus Serif",
|
||
// ),
|
||
|
||
// anankar: (
|
||
// // ----- Base colors -----
|
||
// ink: rgb("#3A3025"),
|
||
// muted-ink: rgb("#796C59"),
|
||
// gold: rgb("#B28A45"),
|
||
// dark-gold: rgb("#80612F"),
|
||
// parchment: rgb("#F2E5C7"),
|
||
// parchment-dark: rgb("#E2CFA6"),
|
||
// parchment-light: rgb("#FBF4DF"),
|
||
// parchment-accent: rgb("#EAD6AD"),
|
||
// border: rgb("#CBB98F"),
|
||
// blood: rgb("#8B4930"),
|
||
// muted: rgb("#81735E"),
|
||
|
||
// // ----- Semantic colors -----
|
||
// heading: rgb("#715126"),
|
||
// heading-accent: rgb("#A97E39"),
|
||
// heading-subtle: rgb("#796C59"),
|
||
// emphasis: rgb("#8B4930"),
|
||
// link: rgb("#426E72"),
|
||
|
||
// // ----- Heading and decorative symbols -----
|
||
// heading-numbering: "1.",
|
||
// section-symbol: "☥",
|
||
// chapter-symbol: "◇",
|
||
// small-symbol: "·",
|
||
// bullet-symbol: "›",
|
||
// separator-symbol: "◆",
|
||
|
||
// // ----- Progress bar and the sort -----
|
||
// progress-full: "◆",
|
||
// progress-half: "◈",
|
||
// progress-void: "◇",
|
||
|
||
// // ----- Misc -----
|
||
// star: "✦",
|
||
// font: "Libertinus Serif",
|
||
// ),
|
||
|
||
// drekinsteps: (
|
||
// // ----- Base colors -----
|
||
// ink: rgb("#33251F"),
|
||
// muted-ink: rgb("#765B4E"),
|
||
// gold: rgb("#C08A3E"),
|
||
// dark-gold: rgb("#875722"),
|
||
// parchment: rgb("#F1DDC5"),
|
||
// parchment-dark: rgb("#DEC0A0"),
|
||
// parchment-light: rgb("#FAEBD9"),
|
||
// parchment-accent: rgb("#E7C9A8"),
|
||
// border: rgb("#C69D76"),
|
||
// blood: rgb("#A83224"),
|
||
// muted: rgb("#7D6557"),
|
||
|
||
// // ----- Semantic colors -----
|
||
// heading: rgb("#8E2C20"),
|
||
// heading-accent: rgb("#C0782D"),
|
||
// heading-subtle: rgb("#765B4E"),
|
||
// emphasis: rgb("#B53B26"),
|
||
// link: rgb("#9A4325"),
|
||
|
||
// // ----- Heading and decorative symbols -----
|
||
// heading-numbering: "1.",
|
||
// section-symbol: "◆",
|
||
// chapter-symbol: "✦",
|
||
// small-symbol: "•",
|
||
// bullet-symbol: "›",
|
||
// separator-symbol: "✧",
|
||
|
||
// // ----- Progress bar and the sort -----
|
||
// progress-full: "◆",
|
||
// progress-half: "◈",
|
||
// progress-void: "◇",
|
||
|
||
// // ----- Misc -----
|
||
// star: "★",
|
||
// font: "Libertinus Serif",
|
||
// ),
|
||
|
||
// draan: (
|
||
// // ----- Base colors -----
|
||
// ink: rgb("#292631"),
|
||
// muted-ink: rgb("#6E6878"),
|
||
// gold: rgb("#9A8467"),
|
||
// dark-gold: rgb("#675747"),
|
||
// parchment: rgb("#EAE7E1"),
|
||
// parchment-dark: rgb("#D6D0C8"),
|
||
// parchment-light: rgb("#F6F3EE"),
|
||
// parchment-accent: rgb("#DDD7CE"),
|
||
// border: rgb("#B8AEB1"),
|
||
// blood: rgb("#684C78"),
|
||
// muted: rgb("#756E7C"),
|
||
|
||
// // ----- Semantic colors -----
|
||
// heading: rgb("#57436C"),
|
||
// heading-accent: rgb("#477273"),
|
||
// heading-subtle: rgb("#6E6878"),
|
||
// emphasis: rgb("#76507B"),
|
||
// link: rgb("#3E7073"),
|
||
|
||
// // ----- Heading and decorative symbols -----
|
||
// heading-numbering: "1.",
|
||
// section-symbol: "◈",
|
||
// chapter-symbol: "⬖",
|
||
// small-symbol: "∙",
|
||
// bullet-symbol: "›",
|
||
// separator-symbol: "◇",
|
||
|
||
// // ----- Progress bar and the sort -----
|
||
// progress-full: "⬢",
|
||
// progress-half: "◐",
|
||
// progress-void: "⬡",
|
||
|
||
// // ----- Misc -----
|
||
// star: "✦",
|
||
// font: "Libertinus Serif",
|
||
// ),
|
||
)
|
||
|
||
// ----- Return the complete selected theme -----
|
||
#let make-theme(theme-name: default-theme) = {
|
||
themes.at(theme-name)
|
||
}
|
||
|
||
// ----- Return a safe dynamic theme-variable accessor -----
|
||
#let make-theme-variable(theme-name: default-theme) = {
|
||
let symfinder(name) = {
|
||
if theme-name in themes {
|
||
themes.at(theme-name).at(name)
|
||
} else {
|
||
themes.at(default-theme).at(name)
|
||
}
|
||
}
|
||
|
||
symfinder
|
||
}
|
||
|
||
// =============================================================================
|
||
// THEMATIC LABELS & DIVIDERS
|
||
// =============================================================================
|
||
#let resolve-table-theme(theme-name) = if theme-name == none {
|
||
themes.at(default-theme)
|
||
} else {
|
||
if theme-name in themes {
|
||
themes.at(theme-name)
|
||
} else {
|
||
themes.at(default-theme)
|
||
}
|
||
}
|
||
|
||
// =============================================================================
|
||
// LABEL
|
||
// =============================================================================
|
||
|
||
#let fantasy-config = (
|
||
// Label
|
||
label-size: 7.5pt,
|
||
label-weight: "bold",
|
||
label-tracking: 0.12em,
|
||
|
||
// Section
|
||
section-spacing: 0.3em,
|
||
|
||
// Rule
|
||
rule-width: 0.65pt,
|
||
)
|
||
|
||
#let fantasy-label(
|
||
body,
|
||
theme-name: none,
|
||
size: none,
|
||
weight: none,
|
||
tracking: none,
|
||
fill: none,
|
||
) = {
|
||
let t = resolve-table-theme(theme-name)
|
||
|
||
let size = if size == none {
|
||
fantasy-config.label-size
|
||
} else {
|
||
size
|
||
}
|
||
|
||
let weight = if weight == none {
|
||
fantasy-config.label-weight
|
||
} else {
|
||
weight
|
||
}
|
||
|
||
let tracking = if tracking == none {
|
||
fantasy-config.label-tracking
|
||
} else {
|
||
tracking
|
||
}
|
||
|
||
let fill = if fill == none {
|
||
t.dark-gold
|
||
} else {
|
||
fill
|
||
}
|
||
|
||
text(
|
||
size: size,
|
||
weight: weight,
|
||
fill: fill,
|
||
tracking: tracking,
|
||
)[
|
||
#body
|
||
]
|
||
}
|
||
|
||
|
||
// =============================================================================
|
||
// RULE
|
||
// =============================================================================
|
||
|
||
#let fantasy-rule(
|
||
theme-name: none,
|
||
stroke-width: none,
|
||
stroke: none,
|
||
) = {
|
||
let t = resolve-table-theme(theme-name)
|
||
|
||
let stroke-width = if stroke-width == none {
|
||
fantasy-config.rule-width
|
||
} else {
|
||
stroke-width
|
||
}
|
||
|
||
let stroke = if stroke == none {
|
||
stroke-width + t.border
|
||
} else {
|
||
stroke
|
||
}
|
||
|
||
line(
|
||
length: 100%,
|
||
stroke: stroke,
|
||
)
|
||
}
|
||
|
||
|
||
// =============================================================================
|
||
// SECTION
|
||
// =============================================================================
|
||
|
||
#let fantasy-section(
|
||
title,
|
||
body,
|
||
theme-name: none,
|
||
label-size: none,
|
||
label-weight: none,
|
||
label-tracking: none,
|
||
spacing: none,
|
||
) = {
|
||
let spacing = if spacing == none {
|
||
fantasy-config.section-spacing
|
||
} else {
|
||
spacing
|
||
}
|
||
|
||
fantasy-label(
|
||
title,
|
||
theme-name: theme-name,
|
||
size: label-size,
|
||
weight: label-weight,
|
||
tracking: label-tracking,
|
||
)
|
||
|
||
v(spacing)
|
||
|
||
body
|
||
}
|