https://github.com/thrzl/calore
generate colorthief palettes from spotify album covers on cloudflare workers
https://github.com/thrzl/calore
album-art cloudflare-workers color-palette color-scheme colorthief
Last synced: 3 months ago
JSON representation
generate colorthief palettes from spotify album covers on cloudflare workers
- Host: GitHub
- URL: https://github.com/thrzl/calore
- Owner: thrzl
- Created: 2025-07-07T17:02:51.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-07-15T15:51:17.000Z (3 months ago)
- Last Synced: 2025-07-16T10:57:12.714Z (3 months ago)
- Topics: album-art, cloudflare-workers, color-palette, color-scheme, colorthief
- Language: TypeScript
- Homepage: https://calore.thrzl.xyz
- Size: 166 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# calore calore calore
service to calculate spotify album art color palettes and cache them using cloudflare workers and KV!
uses a modified version of colorthief (in [src/colorthief.ts](src/colorthief.ts)) under the hood. this modified version uses [@jsquash/jpeg](https://github.com/jamsinclair/jSquash/tree/main/packages/jpeg) under the hood instead of sharp so that it can support cloudflare workers.
## how to use
```
https://calore.thrzl.xyz?image=IMAGE_URL&count=COLOR_COUNT
```- `image` should be a spotify album art url from `i.scdn.co`.
- `color` should be the number of desired colors, 1-10. defaults to 4. if you want a dominant color, i recommend using the default (4) and just taking the first color.
the response exists in this format:
```ts
{
palette: [
[
number,
number,
number
],
...
]
}
```the cache keys use the following structure:
```
{color count}:{image slug}
```## example:
```json
> xhs "https://calore.thrzl.xyz/?image=https://i.scdn.co/image/ab67616d0000b273f8c7a1c275f8c00dd0b4eb6f"
HTTP/1.1 200 OK
Cache-Control: public, s-maxage 2592000
Content-Encoding: gzip
Content-Type: application/json
Transfer-Encoding: chunked{
"palette": [
[
200,
195,
192
],
[
67,
58,
59
],
[
93,
91,
98
],
[
114,
94,
102
]
]
}
```