Skip to content

Commit

Permalink
refactor(chess.com): use uv single file scripts (#1224)
Browse files Browse the repository at this point in the history
  • Loading branch information
uncenter authored Aug 22, 2024
1 parent 195d5b6 commit 157dce0
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 435 deletions.
38 changes: 38 additions & 0 deletions styles/chess.com/generate.py
Original file line number Diff line number Diff line change
@@ -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,
)
28 changes: 0 additions & 28 deletions styles/chess.com/scripts/generate/generate/__init__.py

This file was deleted.

Loading

0 comments on commit 157dce0

Please sign in to comment.