refactor(chess.com): use uv single file scripts (#1224)

This commit is contained in:
uncenter authored and GitHub committed 2024-08-22 10:06:30 -04:00
1 parent 195d5b6382
commit 157dce0e12
4 files changed
+38 -435

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "boardinator==0.1.0",
# "catppuccin==2.1.0",
# ]
# ///
import os
from catppuccin import PALETTE
from boardinator.boardinator import replace_colors
cwd = os.getcwd()
for flavor in PALETTE:
for color in flavor.colors:
if not color.accent:
continue
color_dict = {
# Light grayish yellow green
(237, 238, 209): (
flavor.colors.base.rgb.r,
flavor.colors.base.rgb.g,
flavor.colors.base.rgb.b,
),
# Dark grayish yellow green
(119, 153, 82): (
color.rgb.r,
color.rgb.g,
color.rgb.b,
),
}
replace_colors(
image_path=os.path.join(cwd, "assets/base/colorboard.png"),
output_path=os.path.join(
cwd, f"assets/{flavor.identifier}/{color.identifier}.png"
),
color_dict=color_dict,
)