diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-15 16:16:49 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-15 16:16:49 +1000 |
| commit | 8d86facd2fec34f7cac20cde0d82fd23a5c59937 (patch) | |
| tree | dd542be8d3ac3c5626977e315b0deaee6bb03b23 /src/caelestia/utils/material/__init__.py | |
| parent | shell: fix starting shell (diff) | |
| download | caelestia-cli-8d86facd2fec34f7cac20cde0d82fd23a5c59937.tar.gz caelestia-cli-8d86facd2fec34f7cac20cde0d82fd23a5c59937.tar.bz2 caelestia-cli-8d86facd2fec34f7cac20cde0d82fd23a5c59937.zip | |
material: fix colour generation
score needs to take a string path
Diffstat (limited to 'src/caelestia/utils/material/__init__.py')
| -rw-r--r-- | src/caelestia/utils/material/__init__.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/caelestia/utils/material/__init__.py b/src/caelestia/utils/material/__init__.py index 8adab1f..f7f7f3d 100644 --- a/src/caelestia/utils/material/__init__.py +++ b/src/caelestia/utils/material/__init__.py @@ -8,7 +8,7 @@ from caelestia.utils.material.score import score from caelestia.utils.paths import compute_hash, scheme_cache_dir, wallpaper_thumbnail_path -def get_score_for_image(image: str, cache_base: Path) -> tuple[list[Hct], list[Hct]]: +def get_score_for_image(image: Path | str, cache_base: Path) -> tuple[list[Hct], list[Hct]]: cache = cache_base / "score.json" try: @@ -17,7 +17,7 @@ def get_score_for_image(image: str, cache_base: Path) -> tuple[list[Hct], list[H except (IOError, json.JSONDecodeError): pass - s = score(image) + s = score(str(image)) cache.parent.mkdir(parents=True, exist_ok=True) with cache.open("w") as f: @@ -26,7 +26,7 @@ def get_score_for_image(image: str, cache_base: Path) -> tuple[list[Hct], list[H return s -def get_colours_for_image(image: str = str(wallpaper_thumbnail_path), scheme=None) -> dict[str, str]: +def get_colours_for_image(image: Path | str = wallpaper_thumbnail_path, scheme=None) -> dict[str, str]: if scheme is None: from caelestia.utils.scheme import get_scheme |