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

14 lines
587 B
Python
Raw Normal View History

2022-06-06 02:39:49 +00:00
#!/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