mirror of
https://github.com/LucasVbr/LucasVbr.git
synced 2026-05-16 09:05:34 +00:00
Edit weather emoji, Tools color badge and duplicate tool badges
This commit is contained in:
+7
-2
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user