-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogo.typ
60 lines (53 loc) · 1.32 KB
/
logo.typ
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#import "@preview/cetz:0.3.1"
#import "base.typ": *
#let match = (value, cases) => {
for case in cases {
if case.at(0) == value {
return case.at(1)(value)
}
}
panic("No match found for " + value)
}
#let draw(fill: none, stroke: none, ratio: 1, text-fill: none) = {
set page(margin: 1em, fill: none, width: auto, height: auto)
let canvas = cetz.canvas(
length: 1pt,
cetz.draw.merge-path(
close: true,
fill: fill,
stroke: stroke,
logo(40, ratio),
),
)
if text-fill != none {
grid(
align: horizon,
columns: (auto, auto),
gutter: .4em,
canvas,
move(
text(
font: "Metropolis",
weight: 700,
size: 76pt,
fill: text-fill,
baseline: 2pt,
"ompio",
),
),
)
} else {
canvas
}
}
#match(
sys.inputs.at("variant", default: "bold-with-text"),
(
("outline", v => draw(stroke: dark + 4pt, ratio: 1.3)),
("bold", v => draw(fill: dark, ratio: 1.2)),
("bold-with-text", v => draw(fill: dark, text-fill: dark, ratio: 1.2)),
("colored-bold", v => draw(fill: blue, ratio: 1.2)),
("colored-outline", v => draw(fill: blue, stroke: dark + 4pt, ratio: 1.3)),
("colored-with-text", v => draw(fill: blue, text-fill: dark.lighten(20%), ratio: 1.2)),
),
)