diff --git a/build.py b/build.py index a6a8019..33319d2 100755 --- a/build.py +++ b/build.py @@ -5,16 +5,16 @@ import urllib.request def main(): - with urllib.request.urlopen('https://github.com/raw/catppuccin/palette/main/palette.json') as f: + with urllib.request.urlopen('https://github.com/raw/catppuccin/palette/v0.2.0/palette.json') as f: data = f.read().decode('utf-8') colors = json.loads(data) - + for theme in ["latte", "frappe", "macchiato", "mocha"]: # create mapping colormap = {} for color in colors["macchiato"]: colormap[colors["macchiato"][color]["hex"]] = colors[theme][color]["hex"] - + # delete old files for file in os.listdir(f"themes/catppuccin-{theme}"): if file.endswith(".png"): @@ -29,12 +29,12 @@ def main(): svg = svg.replace(color, colormap[color]) with open("tmp.svg", "w") as tmp: tmp.write(svg) - + if file == "preview.svg": os.system(f'convert -background none "tmp.svg" "assets/{theme}.png"') else: os.system(f'convert -background none "tmp.svg" "themes/catppuccin-{theme}/{file.removesuffix(".svg")}.png"') - + # cleanup os.remove("tmp.svg") @@ -46,4 +46,4 @@ def main(): os.system("python3 -m catwalk -o assets/mocha.png assets/mocha.png assets/mocha.png assets/mocha.png assets/mocha.png") if __name__ == "__main__": - main() \ No newline at end of file + main()