1
Fork 0
mirror of https://github.com/Steffo99/steffula-code.git synced 2024-11-21 18:44:19 +00:00
steffula-code/.scripts/gen-palette.py

13 lines
587 B
Python
Executable file

#!/usr/bin/python3
import re
with open("../themes/Steffula-color-theme.json") as file:
while line := file.readline():
if match := re.search(r'''["']name["']: ?["']([a-z-]+)["'],''', line):
name = match.group(1)
while line := file.readline():
if match := re.search(r'''["']foreground["']: ?["'][#]([0-9a-f]+)["'],''', line):
color = match.group(1)
print(f"- ![{name}](https://img.shields.io/static/v1?style=flat-square&label={name}&color={color}&message=%23{color})")
break