Custom color support
This commit is contained in:
parent
e2db45aedf
commit
4829761261
BIN
build/main.pdf
BIN
build/main.pdf
Binary file not shown.
47
template.typ
47
template.typ
|
@ -1,3 +1,6 @@
|
||||||
|
#let color = blue
|
||||||
|
// #let color = rgb("#018d32")
|
||||||
|
|
||||||
// Basic template settings. Must be shown at very begining
|
// Basic template settings. Must be shown at very begining
|
||||||
#let init(doc) = {
|
#let init(doc) = {
|
||||||
|
|
||||||
|
@ -18,8 +21,8 @@
|
||||||
image.decode(polymny_transparent, width: 65em, height: 65em)
|
image.decode(polymny_transparent, width: 65em, height: 65em)
|
||||||
})
|
})
|
||||||
|
|
||||||
#place(top + left, rect(width: 5.55cm, height: 100%, fill: blue.lighten(90%)))
|
#place(top + left, rect(width: 5.55cm, height: 100%, fill: color.lighten(90%)))
|
||||||
#place(top + left, rect(width: 100%, height: 4.4cm, fill: blue))
|
#place(top + left, rect(width: 100%, height: 4.4cm, fill: color))
|
||||||
#place(top + left, dx: 0.8cm, dy: 1cm, image("./assets/moi.png", height: 4cm))
|
#place(top + left, dx: 0.8cm, dy: 1cm, image("./assets/moi.png", height: 4cm))
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -57,15 +60,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
show heading.where(level: 1): it => {
|
show heading.where(level: 1): it => {
|
||||||
set text(fill: blue)
|
set text(fill: color)
|
||||||
grid(
|
grid(
|
||||||
gutter: 1em,
|
gutter: 1em,
|
||||||
columns: (5cm, 7fr),
|
columns: (5cm, 7fr),
|
||||||
[], // align(horizon, [#v(3pt) #rect(width: 1cm, height: 0.33em, fill: blue)]),
|
[], // align(horizon, [#v(3pt) #rect(width: 1cm, height: 0.33em, fill: color)]),
|
||||||
[
|
[
|
||||||
#it.body
|
#it.body
|
||||||
#v(-0.5cm)
|
#v(-0.5cm)
|
||||||
#line(stroke: blue, length: 100%)
|
#line(stroke: color, length: 100%)
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -108,16 +111,28 @@
|
||||||
#let entry2(left: content, heading: content, description: content, note: content) = {
|
#let entry2(left: content, heading: content, description: content, note: content) = {
|
||||||
|
|
||||||
let content = [
|
let content = [
|
||||||
#heading \
|
#heading \
|
||||||
#set text(size: 12pt, style: "italic")
|
#set text(size: 12pt, style: "italic")
|
||||||
#description \
|
#description \
|
||||||
#set text(size: 11pt, style: "normal")
|
#set text(size: 11pt, style: "normal")
|
||||||
#note
|
#note
|
||||||
]
|
]
|
||||||
|
|
||||||
|
layout(size =>
|
||||||
style(styles => {
|
style(styles => {
|
||||||
let size = measure(content, styles)
|
let size = measure({
|
||||||
|
block(
|
||||||
|
width: size.width,
|
||||||
|
grid(
|
||||||
|
gutter: 1em,
|
||||||
|
columns: (5.5cm, 0.75fr, 7fr),
|
||||||
|
[], [], content
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}, styles)
|
||||||
|
|
||||||
let offset = measure(left, styles)
|
let offset = measure(left, styles)
|
||||||
|
|
||||||
grid(
|
grid(
|
||||||
gutter: 1em,
|
gutter: 1em,
|
||||||
columns: (5.5cm, 0.75fr, 7fr),
|
columns: (5.5cm, 0.75fr, 7fr),
|
||||||
|
@ -130,8 +145,8 @@
|
||||||
content
|
content
|
||||||
)
|
)
|
||||||
v(-4pt)
|
v(-4pt)
|
||||||
|
})
|
||||||
})
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// A score box between 1 and 5.
|
// A score box between 1 and 5.
|
||||||
|
@ -141,9 +156,9 @@
|
||||||
|
|
||||||
for x in range(5) {
|
for x in range(5) {
|
||||||
if level > x {
|
if level > x {
|
||||||
elems.push(rect(width: 0.4cm, height: 0.2cm, fill: blue))
|
elems.push(rect(width: 0.4cm, height: 0.2cm, fill: color))
|
||||||
} else {
|
} else {
|
||||||
elems.push(rect(width: 0.4cm, height: 0.2cm, fill: blue.lighten(60%)))
|
elems.push(rect(width: 0.4cm, height: 0.2cm, fill: color.lighten(60%)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue