Edit weather emoji, Tools color badge and duplicate tool badges

This commit is contained in:
LucasVbr
2022-06-21 14:14:40 +02:00
parent b10673ccb3
commit 2062f87459
5 changed files with 54 additions and 37 deletions
+7 -2
View File
@@ -30,17 +30,22 @@ class Badge:
icon = icons.get(self.name)
color_hue = Color(f'#{icon.hex}').get_hue()
color_hsl = (color_hue, 0.75, 0.5)
color = Color()
color.set_hsl(color_hsl)
try:
params = {
"label": "",
"message": icon.title,
"color": f"#{icon.hex}",
"color": color,
"logo": icon.slug,
"logoColor": LOGO_COLOR
}
urlParams = urlencode(params)
self.url = f"{BASE_URL}?{urlParams}"
self.color = Color(params["color"]).get_hue()
self.color = color_hue
except Exception:
pass # Let default values
+4
View File
@@ -24,6 +24,10 @@ def getJsonData(filePath: str) -> str:
return data
def setJsonData(filePath: str, content) -> None:
setFileData(filePath, json.dumps(content, indent=2))
def setFileData(filePath: str, content: str) -> None:
"""
Create a new File or replace it content if already exist