-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogo.lua
57 lines (48 loc) · 1.26 KB
/
logo.lua
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
local w, h = 2048, 2048
local F = require "F"
img {
width = w,
height = h,
font_size=h/8, text_anchor="middle",
}
local border_size = 64
img:Rect {
x = border_size/2,
y = border_size/2,
width = w-2*border_size/2,
height = h-2*border_size/2,
rx = 2*border_size,
stroke = "#435488", stroke_width = border_size,
fill = "grey",
}
img:Text "Fizz Buzz" {
x = w/2,
y = h/4,
}
img:Rect {
x = w/4-64, width = w/2+2*64,
y = h/4-100, height = 64,
rx = 32,
fill = "red",
opacity = 0.7,
}
img:Rect {
x = 128, width = w-2*128,
y = h/4+64, height = 64,
rx = 32,
fill = "#435488",
opacity = 0.7,
}
local function ix(i) return w/4 + (256+64)*(i-1) end
local function iy(i) return 896 + 256*(i-1) end
local names = string.words "LuaX ypp Panda Pandoc ..." ---@diagnostic disable-line: undefined-field
names:mapi(function(i, name)
img:Text(name) { x = ix(i), y = iy(i) } {
fill = F.case(name) {
Pandoc = "darkgrey",
otherwise = "white",
},
}
end)
img:Text "bang" {transform=("translate(%d, %d) rotate(45)"):format(ix(1.0), iy(3.5))} { fill = "white" }
img:Text "ninja" {transform=("translate(%d, %d) rotate(45)"):format(ix(0.5), iy(4.0))} { fill = "darkgrey" }