theme.json metadata edited

This commit is contained in:
dez 2024-02-08 07:51:35 +01:00
parent 30be4b3c37
commit 7d752c068f

View file

@ -1,5 +1,6 @@
import json import json
import os import os
from datetime import datetime
def rgb_to_hex(rgb): def rgb_to_hex(rgb):
""" """
@ -318,31 +319,18 @@ def generate_theme_json(path, col_theme, is_dark):
} }
}, },
"provenance": { "provenance": {
"theme name": col_theme, "theme name": f"Spitfire {col_theme} {'Dark' if is_dark else 'Light'}",
"theme author": "generated theme by spitfire launcher", "theme author": "generated theme by spitfire launcher",
"date created": None, "date created": f"{datetime.now().date()}",
"last modified by": None, "last modified by": None,
"last modified": None, "last modified": None,
"created with": "https://spitfirebrowser.com/", "created with": "https://spitfirebrowser.com/",
"keystone colour": None, "keystone colour": f"{col_theme}",
"harmony method": None, "harmony method": None,
"harmony differential": None "harmony differential": None
} }
} }
# Add provenance information
theme_data["provenance"] = {
"theme name": "Custom",
"theme author": "Your Name",
"date created": "Current Date",
"last modified by": "Your Name",
"last modified": "Current Date",
"created with": "Python Theme Generator",
"keystone colour": None,
"harmony method": None,
"harmony differential": None
}
with open(os.path.join(path + "./theme.json"), "w") as json_file: with open(os.path.join(path + "./theme.json"), "w") as json_file:
json.dump(theme_data, json_file, indent=2) json.dump(theme_data, json_file, indent=2)