@thi.ng/color 5.6.43 → 5.6.45
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/CHANGELOG.md +1 -1
- package/README.md +3 -1
- package/color-range.js +1 -2
- package/distance.js +1 -2
- package/gradients.js +1 -2
- package/max-chroma.js +1 -2
- package/package.json +19 -19
- package/sort.js +1 -2
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -676,7 +676,7 @@ For Node.js REPL:
|
|
|
676
676
|
const color = await import("@thi.ng/color");
|
|
677
677
|
```
|
|
678
678
|
|
|
679
|
-
Package sizes (brotli'd, pre-treeshake): ESM: 15.
|
|
679
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 15.71 KB
|
|
680
680
|
|
|
681
681
|
## Dependencies
|
|
682
682
|
|
|
@@ -707,6 +707,7 @@ directory are using this package:
|
|
|
707
707
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/commit-heatmap.png" width="240"/> | Heatmap visualization of this mono-repo's commits | | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/commit-heatmap) |
|
|
708
708
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/dominant-colors.png" width="240"/> | Color palette generation via dominant color extraction from uploaded images | [Demo](https://demo.thi.ng/umbrella/dominant-colors/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/dominant-colors) |
|
|
709
709
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/fiber-basics.png" width="240"/> | Fiber-based cooperative multitasking basics | [Demo](https://demo.thi.ng/umbrella/fiber-basics/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/fiber-basics) |
|
|
710
|
+
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/geom-complex-poly.png" width="240"/> | Shape conversions & operations using polygons with holes | [Demo](https://demo.thi.ng/umbrella/geom-complex-poly/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/geom-complex-poly) |
|
|
710
711
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/grid-iterators.png" width="240"/> | Visualization of different grid iterator strategies | [Demo](https://demo.thi.ng/umbrella/grid-iterators/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/grid-iterators) |
|
|
711
712
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/hdom-canvas/hdom-canvas-shapes-results.png" width="240"/> | Various hdom-canvas shape drawing examples & SVG conversion / export | [Demo](https://demo.thi.ng/umbrella/hdom-canvas-shapes/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/hdom-canvas-shapes) |
|
|
712
713
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/hiccup-canvas-basics.png" width="240"/> | Basic hiccup-based canvas drawing | [Demo](https://demo.thi.ng/umbrella/hiccup-canvas-basics/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/hiccup-canvas-basics) |
|
|
@@ -716,6 +717,7 @@ directory are using this package:
|
|
|
716
717
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/pixel-indexed.jpg" width="240"/> | Image dithering and remapping using indexed palettes | [Demo](https://demo.thi.ng/umbrella/pixel-indexed/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/pixel-indexed) |
|
|
717
718
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/pixel-sorting.png" width="240"/> | Interactive pixel sorting tool using thi.ng/color & thi.ng/pixel | [Demo](https://demo.thi.ng/umbrella/pixel-sorting/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/pixel-sorting) |
|
|
718
719
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/poly-subdiv.jpg" width="240"/> | Animated, iterative polygon subdivisions & visualization | [Demo](https://demo.thi.ng/umbrella/poly-subdiv/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/poly-subdiv) |
|
|
720
|
+
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rdom-reactive-svg.jpg" width="240"/> | Animated SVG elements with reactive attributes | [Demo](https://demo.thi.ng/umbrella/rdom-reactive-svg/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rdom-reactive-svg) |
|
|
719
721
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/shader-ast-workers.jpg" width="240"/> | Fork-join worker-based raymarch renderer (JS/CPU only) | [Demo](https://demo.thi.ng/umbrella/shader-ast-workers/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/shader-ast-workers) |
|
|
720
722
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/simd-plot.png" width="240"/> | Fitting, transforming & plotting 10k data points per frame using SIMD | [Demo](https://demo.thi.ng/umbrella/simd-plot/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/simd-plot) |
|
|
721
723
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/stacked-layout.png" width="240"/> | Responsive & reactively computed stacked column layout | [Demo](https://demo.thi.ng/umbrella/stacked-layout/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/stacked-layout) |
|
package/color-range.js
CHANGED
|
@@ -134,8 +134,7 @@ const colorFromRange = (range, opts) => {
|
|
|
134
134
|
};
|
|
135
135
|
function* colorsFromRange(range, opts = {}) {
|
|
136
136
|
let num = opts.num != void 0 ? opts.num : Infinity;
|
|
137
|
-
while (num-- > 0)
|
|
138
|
-
yield colorFromRange(range, opts);
|
|
137
|
+
while (num-- > 0) yield colorFromRange(range, opts);
|
|
139
138
|
}
|
|
140
139
|
const compileThemePart = (part, opts) => {
|
|
141
140
|
let spec;
|
package/distance.js
CHANGED
|
@@ -65,8 +65,7 @@ const c7Coeff = (c) => {
|
|
|
65
65
|
const computeDeltaH = (a1, b1, a2, b2, c1, c2, eps = 1e-3) => {
|
|
66
66
|
const h1 = atan2Abs(b1, a1);
|
|
67
67
|
const h2 = atan2Abs(b2, a2);
|
|
68
|
-
if (c1 <= eps || c2 <= eps)
|
|
69
|
-
return { deltaH: 0, H: h1 + h2 };
|
|
68
|
+
if (c1 <= eps || c2 <= eps) return { deltaH: 0, H: h1 + h2 };
|
|
70
69
|
let dh = h2 - h1;
|
|
71
70
|
const sumH = h1 + h2;
|
|
72
71
|
const absH = abs(dh);
|
package/gradients.js
CHANGED
|
@@ -5,8 +5,7 @@ import { argb32 } from "./int/int.js";
|
|
|
5
5
|
import { mix as $mix } from "./mix.js";
|
|
6
6
|
function multiColorGradient(opts, isABGR) {
|
|
7
7
|
const cols = [...gradient(opts)];
|
|
8
|
-
if (isABGR === void 0)
|
|
9
|
-
return cols;
|
|
8
|
+
if (isABGR === void 0) return cols;
|
|
10
9
|
const rgba = cols.map((x) => argb32(x)[0]);
|
|
11
10
|
return isABGR ? rgba.map(intArgb32Abgr32) : rgba;
|
|
12
11
|
}
|
package/max-chroma.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/color",
|
|
3
|
-
"version": "5.6.
|
|
3
|
+
"version": "5.6.45",
|
|
4
4
|
"description": "Array-based color types, CSS parsing, conversions, transformations, declarative theme generation, gradients, presets",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -40,25 +40,25 @@
|
|
|
40
40
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@thi.ng/api": "^8.11.
|
|
44
|
-
"@thi.ng/arrays": "^2.9.
|
|
45
|
-
"@thi.ng/binary": "^3.4.
|
|
46
|
-
"@thi.ng/checks": "^3.6.
|
|
47
|
-
"@thi.ng/compare": "^2.3.
|
|
48
|
-
"@thi.ng/compose": "^3.0.
|
|
49
|
-
"@thi.ng/defmulti": "^3.0.
|
|
50
|
-
"@thi.ng/errors": "^2.5.
|
|
51
|
-
"@thi.ng/math": "^5.10.
|
|
52
|
-
"@thi.ng/random": "^3.
|
|
53
|
-
"@thi.ng/strings": "^3.7.
|
|
54
|
-
"@thi.ng/transducers": "^9.0.
|
|
55
|
-
"@thi.ng/vectors": "^7.10.
|
|
43
|
+
"@thi.ng/api": "^8.11.2",
|
|
44
|
+
"@thi.ng/arrays": "^2.9.6",
|
|
45
|
+
"@thi.ng/binary": "^3.4.25",
|
|
46
|
+
"@thi.ng/checks": "^3.6.4",
|
|
47
|
+
"@thi.ng/compare": "^2.3.5",
|
|
48
|
+
"@thi.ng/compose": "^3.0.4",
|
|
49
|
+
"@thi.ng/defmulti": "^3.0.39",
|
|
50
|
+
"@thi.ng/errors": "^2.5.7",
|
|
51
|
+
"@thi.ng/math": "^5.10.13",
|
|
52
|
+
"@thi.ng/random": "^3.8.0",
|
|
53
|
+
"@thi.ng/strings": "^3.7.33",
|
|
54
|
+
"@thi.ng/transducers": "^9.0.5",
|
|
55
|
+
"@thi.ng/vectors": "^7.10.31"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@microsoft/api-extractor": "^7.43.
|
|
59
|
-
"esbuild": "^0.
|
|
60
|
-
"typedoc": "^0.25.
|
|
61
|
-
"typescript": "^5.4.
|
|
58
|
+
"@microsoft/api-extractor": "^7.43.2",
|
|
59
|
+
"esbuild": "^0.21.1",
|
|
60
|
+
"typedoc": "^0.25.13",
|
|
61
|
+
"typescript": "^5.4.5"
|
|
62
62
|
},
|
|
63
63
|
"keywords": [
|
|
64
64
|
"color",
|
|
@@ -445,5 +445,5 @@
|
|
|
445
445
|
"vectors"
|
|
446
446
|
]
|
|
447
447
|
},
|
|
448
|
-
"gitHead": "
|
|
448
|
+
"gitHead": "df34b4a9e650cc7323575356de207d78933bdcf3\n"
|
|
449
449
|
}
|
package/sort.js
CHANGED
|
@@ -10,8 +10,7 @@ const proximity = (target, dist = distEucledian3) => (col) => dist(target, col);
|
|
|
10
10
|
const proximityABGR32 = (target, dist = distEucledian3) => (col) => dist(target, intAbgr32Srgb([], col[0]));
|
|
11
11
|
const sort = (colors, key, isReverse = false) => sortByCachedKey(colors, key, isReverse ? compareNumDesc : compareNumAsc);
|
|
12
12
|
const sortMapped = (colors, key, isReverse = false) => {
|
|
13
|
-
if (!colors.length)
|
|
14
|
-
return colors;
|
|
13
|
+
if (!colors.length) return colors;
|
|
15
14
|
const keys = colors.map(key);
|
|
16
15
|
const tmp = typedArray(typedArrayType(colors[0].buf), colors[0].length);
|
|
17
16
|
quickSort(keys, isReverse ? compareNumDesc : compareNumAsc, (_, x, y) => {
|