@fest-lib/image 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -2
- package/dist/image.js +360 -350
- package/package.json +11 -4
package/README.md
CHANGED
|
@@ -1,2 +1,34 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
1
|
+
# Image.TS
|
|
2
|
+
|
|
3
|
+
`@fest-lib/image` — orientation-aware wallpaper / canvas paint plus K-Means theme extraction for Veela tokens (`--color-primary` / secondary / tertiary).
|
|
4
|
+
|
|
5
|
+
Caches the last wallpaper URL and seed colors so a reload can skip re-clustering.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @fest-lib/image
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import {
|
|
15
|
+
applyThemeFromWallpaper,
|
|
16
|
+
setAppWallpaper,
|
|
17
|
+
syncAppWallpaperOrient
|
|
18
|
+
} from "@fest-lib/image";
|
|
19
|
+
|
|
20
|
+
await setAppWallpaper(url);
|
|
21
|
+
await applyThemeFromWallpaper(url);
|
|
22
|
+
syncAppWallpaperOrient();
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Layout
|
|
26
|
+
|
|
27
|
+
| Path | Role |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| `src/engine/KMean.ts` | dominant colors |
|
|
30
|
+
| `src/engine/WallpaperTheme.ts` | seeds → theme hosts |
|
|
31
|
+
| `src/canvas/Canvas.ts` | cover/orient paint |
|
|
32
|
+
| `src/canvas/Canvas-2.ts` | app wallpaper layer + IDB |
|
|
33
|
+
|
|
34
|
+
Peers: `@fest-lib/core`, `dom`, `object`, `lure`. Build: `npm run build`. Publish: `npm run publish`.
|