-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.lua
More file actions
executable file
·250 lines (237 loc) · 6.6 KB
/
build.lua
File metadata and controls
executable file
·250 lines (237 loc) · 6.6 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
#!/usr/bin/env lua
local blueberry_peach_light = {
red = "#C34165",
maroon = "#C34165",
yellow = "#8A7400",
peach = "#AC591C",
green = "#288043",
teal = "#007E7D",
sky = "#007E7D",
sapphire = "#007E7D",
blue = "#1675AB",
lavender = "#1675AB",
mauve = "#6A67B4",
pink = "#6A67B4",
flamingo = "#A352A0",
rosewater = "#A352A0",
text = "#706F7A",
subtext1 = "#757480",
subtext0 = "#757480",
overlay2 = "#797985",
overlay1 = "#7E7D8A",
overlay0 = "#84828F",
surface2 = "#9C8282",
surface1 = "#EBDFD3",
surface0 = "#EBDFD3",
base = "#FAF4ED",
mantle = "#FCF9F5",
crust = "#FCF9F5",
id = "light",
name = "Blueberry Peach Light",
}
local blueberry_peach_dark = {
red = "#DF8BA0",
maroon = "#DF8BA0",
yellow = "#C7B96F",
peach = "#C79A76",
green = "#75B087",
teal = "#5EB1AF",
sky = "#5EB1AF",
sapphire = "#5EB1AF",
blue = "#7AA8CE",
lavender = "#7AA8CE",
mauve = "#A19DD4",
pink = "#A19DD4",
flamingo = "#C394C2",
rosewater = "#C394C2",
text = "#A2A2A9",
subtext1 = "#878794",
subtext0 = "#878794",
overlay2 = "#7D7D7D",
overlay1 = "#808084",
overlay0 = "#84848C",
surface2 = "#7C7992",
surface1 = "#37363E",
surface0 = "#37363E",
base = "#191724",
mantle = "#0B0A0F",
crust = "#0B0A0F",
id = "dark",
name = "Blueberry Peach Dark",
}
local blueberry_peach_dark_dimmed = {
red = "#BF657B",
maroon = "#BF657B",
yellow = "#91812C",
peach = "#A67753",
green = "#578D67",
teal = "#278F8E",
sky = "#278F8E",
sapphire = "#278F8E",
blue = "#5188A6",
lavender = "#5188A6",
mauve = "#7E7ABA",
pink = "#7E7ABA",
flamingo = "#A370A1",
rosewater = "#A370A1",
text = "#7F7F91",
subtext1 = "#797985",
subtext0 = "#797985",
overlay2 = "#6E6E6E",
overlay1 = "#717175",
overlay0 = "#76767D",
surface2 = "#6A677E",
surface1 = "#29263A",
surface0 = "#29263A",
base = "#191724",
mantle = "#0B0A0F",
crust = "#0B0A0F",
id = "dark-dimmed",
name = "Blueberry Peach Dark Dimmed",
}
local blueberry_peach_palette = {
red = "red", -- #C34165
yellow = "yellow", -- #8A7400
orange = "peach", -- #AC591C
green = "green", -- #288043
teal = "teal", -- #007E7D
blue = "blue", -- #1675AB
violet = "mauve", -- #6A67B4
pink = "flamingo", -- #A352A0
text = "text", -- #5B5B5B
subtext = "subtext1", -- #908A84
overlay2 = "overlay2", -- #707070
overlay1 = "overlay1", -- #646464
overlay0 = "overlay0", -- #585858
dimmed = "surface2", -- #9C8282
surface2 = "surface1", -- #e8dfd4
surface1 = "surface0", -- #f1ece5
background = "base", -- #faf4ed
surface0 = "mantle", -- #FFFAF0
}
local template_files = {
{
source = "./templates/bat/blueberry_peach.tmTheme",
target = "./ports/bat/blueberry_peach_light.tmTheme",
colors = blueberry_peach_light,
},
{
source = "./templates/fzf/blueberry_peach.sh",
target = "./ports/fzf/blueberry_peach_light-fzf-colors.sh",
colors = blueberry_peach_light,
},
{
source = "./templates/ghostty/blueberry_peach",
target = "./ports/ghostty/blueberry_peach_light",
colors = blueberry_peach_light,
},
{
source = "./templates/neovim/blueberry_peach.lua",
target = "./ports/neovim/blueberry_peach_light.lua",
colors = blueberry_peach_light,
},
{
source = "./templates/lazygit/blueberry_peach.yml",
target = "./ports/lazygit/blueberry_peach_light.yml",
colors = blueberry_peach_light,
},
{
source = "./templates/tmux/blueberry_peach.conf",
target = "./ports/tmux/blueberry_peach_light.conf",
colors = blueberry_peach_light,
},
{
source = "./templates/wezterm/blueberry_peach.toml",
target = "./ports/wezterm/blueberry_peach_light.toml",
colors = blueberry_peach_light,
},
{
source = "./templates/zsh_syntax_highlighting/blueberry_peach.sh",
target = "./ports/zsh_syntax_highlighting/blueberry_peach_light-syntax-highlighting.sh",
colors = blueberry_peach_light,
},
{
source = "./templates/bat/blueberry_peach.tmTheme",
target = "./ports/bat/blueberry_peach_dark.tmTheme",
colors = blueberry_peach_dark,
},
{
source = "./templates/fzf/blueberry_peach.sh",
target = "./ports/fzf/blueberry_peach_dark-fzf-colors.sh",
colors = blueberry_peach_dark,
},
{
source = "./templates/ghostty/blueberry_peach",
target = "./ports/ghostty/blueberry_peach_dark",
colors = blueberry_peach_dark,
},
{
source = "./templates/neovim/blueberry_peach.lua",
target = "./ports/neovim/blueberry_peach_dark.lua",
colors = blueberry_peach_dark,
},
{
source = "./templates/lazygit/blueberry_peach.yml",
target = "./ports/lazygit/blueberry_peach_dark.yml",
colors = blueberry_peach_dark,
},
{
source = "./templates/tmux/blueberry_peach.conf",
target = "./ports/tmux/blueberry_peach_dark.conf",
colors = blueberry_peach_dark,
},
{
source = "./templates/wezterm/blueberry_peach.toml",
target = "./ports/wezterm/blueberry_peach_dark.toml",
colors = blueberry_peach_dark,
},
{
source = "./templates/zsh_syntax_highlighting/blueberry_peach.sh",
target = "./ports/zsh_syntax_highlighting/blueberry_peach_dark-syntax-highlighting.sh",
colors = blueberry_peach_dark,
},
}
for _, template_file in pairs(template_files) do
local file = io.open(template_file.source, "r")
if file == nil then
print("Error: Could not open source file " .. template_file.source)
return
end
local content = file:read("*all")
file:close()
for key, value in pairs(template_file.colors) do
content = content:gsub("{{" .. key .. "}}", value)
end
file = io.open(template_file.target, "w")
if file == nil then
print("Error: Could not open target file " .. template_file.target)
return
end
file:write(content)
file:close()
end
local file = io.open("./templates/svg/swatch.svg")
if file == nil then
print("Error: Could not open source file ./templates/svg/swatch.svg")
return
end
local content = file:read("*all")
file:close()
for blueberry_color, catppuccin_color in pairs(blueberry_peach_palette) do
local svg = content:gsub("{{color}}", blueberry_peach_light[catppuccin_color])
file = io.open("./assets/light_" .. blueberry_color .. ".svg", "w")
if file == nil then
print("Error: Could not open target file " .. "./assets/" .. blueberry_color .. ".svg")
return
end
file:write(svg)
file:close()
svg = content:gsub("{{color}}", blueberry_peach_dark[catppuccin_color])
file = io.open("./assets/dark_" .. blueberry_color .. ".svg", "w")
if file == nil then
print("Error: Could not open target file " .. "./assets/" .. blueberry_color .. ".svg")
return
end
file:write(svg)
file:close()
end