v0.3.0, add customizable fill lightness

This commit is contained in:
Gaspard Jankowiak 2025-12-15 10:52:18 +01:00
commit 8668ad46e8
4 changed files with 19 additions and 13 deletions

View file

@ -2,8 +2,6 @@
* Customisation
*/
#let lightgray = rgb("#eeeeee")
// Default font (embedded in Typst)
#let font-text = "libertinus serif"
@ -117,7 +115,7 @@
}
let exercise_label = exercise_counter.display(exercise-numbering)
exercise_registry.update(entries => entries + ((exercise_label, title, points),))
block(radius: 1cm, stroke: none, fill: lightgray, inset: 1pt,
block(radius: 1cm, stroke: none, fill: luma(state("fill-luma").get()), inset: 1pt,
table(
columns: (auto, 1fr, auto),
align: (left, center, right),
@ -151,6 +149,8 @@
exercise-numbering: "1",
fill-luma: 200,
body
) = {
@ -163,6 +163,7 @@ set page(paper: paper-size)
set text(size: font-size, lang: language, hyphenate: true)
state("exercise-numbering").update(exercise-numbering)
state("fill-luma").update(fill-luma)
/*
* Localization
@ -224,7 +225,7 @@ let exercise_overview_table() = context {
columns.push(1fr)
[== #get_L("points_obtained")]
set text(size: 14pt)
block(radius: 0.3cm, stroke: none, fill: lightgray, inset: (x:0pt, y:4pt),
block(radius: 0.3cm, stroke: none, fill: luma(state("fill-luma").get()), inset: (x:0pt, y:4pt),
table(
columns: columns,
stroke: none,
@ -287,8 +288,9 @@ v(1fr)
v(0.5cm)
block(radius: 0.2cm, fill: lightgray, inset: 3pt, clip: true, table(
fill: lightgray,
context{
block(radius: 0.2cm, fill: luma(state("fill-luma").get()), inset: 3pt, clip: true, table(
fill: luma(state("fill-luma").get()),
stroke: none,
columns: (auto, 1fr),
gutter: 3pt,
@ -305,6 +307,7 @@ block(radius: 0.2cm, fill: lightgray, inset: 3pt, clip: true, table(
([#get_L("group")], rect(fill: white, width: 100%, radius: 0.2cm))
}
))
}
v(0.5cm)