@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-04-23T07:02:17Z
3
+ - **Last updated**: 2024-05-08T18:24:31Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
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.70 KB
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
@@ -1340,8 +1340,7 @@ const __maxLC = (chroma) => {
1340
1340
  if (chroma[i] >= maxC) {
1341
1341
  maxC = chroma[i];
1342
1342
  maxL = i;
1343
- } else
1344
- break;
1343
+ } else break;
1345
1344
  }
1346
1345
  return [maxL, maxC];
1347
1346
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/color",
3
- "version": "5.6.43",
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.1",
44
- "@thi.ng/arrays": "^2.9.5",
45
- "@thi.ng/binary": "^3.4.24",
46
- "@thi.ng/checks": "^3.6.3",
47
- "@thi.ng/compare": "^2.3.4",
48
- "@thi.ng/compose": "^3.0.3",
49
- "@thi.ng/defmulti": "^3.0.38",
50
- "@thi.ng/errors": "^2.5.6",
51
- "@thi.ng/math": "^5.10.12",
52
- "@thi.ng/random": "^3.7.5",
53
- "@thi.ng/strings": "^3.7.32",
54
- "@thi.ng/transducers": "^9.0.3",
55
- "@thi.ng/vectors": "^7.10.29"
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.0",
59
- "esbuild": "^0.20.2",
60
- "typedoc": "^0.25.12",
61
- "typescript": "^5.4.3"
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": "5dd66c18a3862a3af69a5b2f49563f7cbdd960c2\n"
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) => {