@thi.ng/color 5.5.31 → 5.6.0

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**: 2023-11-09T10:28:18Z
3
+ - **Last updated**: 2023-11-12T16:43: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.
@@ -9,6 +9,13 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
9
9
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
10
  and/or version bumps of transitive dependencies.
11
11
 
12
+ ## [5.6.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/color@5.6.0) (2023-11-12)
13
+
14
+ #### 🚀 Features
15
+
16
+ - update temperatureMat() ([eaacfa0](https://github.com/thi-ng/umbrella/commit/eaacfa0))
17
+ - add (optional) 2nd green/magenta axis to existing blue/yellow
18
+
12
19
  ### [5.5.27](https://github.com/thi-ng/umbrella/tree/@thi.ng/color@5.5.27) (2023-10-27)
13
20
 
14
21
  #### ♻️ Refactoring
package/README.md CHANGED
@@ -602,7 +602,7 @@ For Node.js REPL:
602
602
  const color = await import("@thi.ng/color");
603
603
  ```
604
604
 
605
- Package sizes (brotli'd, pre-treeshake): ESM: 15.68 KB
605
+ Package sizes (brotli'd, pre-treeshake): ESM: 15.69 KB
606
606
 
607
607
  ## Dependencies
608
608
 
@@ -636,6 +636,7 @@ directory are using this package:
636
636
  | <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) |
637
637
  | <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) |
638
638
  | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/kmeans-viz.jpg" width="240"/> | k-means clustering visualization | [Demo](https://demo.thi.ng/umbrella/kmeans-viz/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/kmeans-viz) |
639
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/pixel-colormatrix.jpg" width="240"/> | Matrix-based image color adjustments | [Demo](https://demo.thi.ng/umbrella/pixel-colormatrix/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/pixel-colormatrix) |
639
640
  | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/pixel-gradients.jpg" width="240"/> | Randomized 4-point 2D color gradient image generator | [Demo](https://demo.thi.ng/umbrella/pixel-gradients/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/pixel-gradients) |
640
641
  | <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) |
641
642
  | <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) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/color",
3
- "version": "5.5.31",
3
+ "version": "5.6.0",
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",
@@ -48,8 +48,8 @@
48
48
  "@thi.ng/math": "^5.7.3",
49
49
  "@thi.ng/random": "^3.6.14",
50
50
  "@thi.ng/strings": "^3.6.6",
51
- "@thi.ng/transducers": "^8.8.10",
52
- "@thi.ng/vectors": "^7.8.4"
51
+ "@thi.ng/transducers": "^8.8.11",
52
+ "@thi.ng/vectors": "^7.8.5"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@microsoft/api-extractor": "^7.38.2",
@@ -444,5 +444,5 @@
444
444
  "vectors"
445
445
  ]
446
446
  },
447
- "gitHead": "669a3151e4302480244fe3e60eff5e732ea5b7a7\n"
447
+ "gitHead": "2be4c38c9680da929339bd164acfb69ebb1fd3d0\n"
448
448
  }
package/transform.d.ts CHANGED
@@ -51,7 +51,14 @@ export declare const contrastMat: (x: number, o?: number) => ColorMatrix;
51
51
  export declare const exposureMat: (x: number) => ColorMatrix;
52
52
  export declare const saturationMat: (x: number) => ColorMatrix;
53
53
  export declare const hueRotateMat: (theta: number) => ColorMatrix;
54
- export declare const temperatureMat: (x: number) => ColorMatrix;
54
+ /**
55
+ * Color temperature adjustment matrix. `x` controls blue/yellow, `y` controls
56
+ * green/magenta axis (both params in [-1,1] range).
57
+ *
58
+ * @param x
59
+ * @param y
60
+ */
61
+ export declare const temperatureMat: (x: number, y?: number) => ColorMatrix;
55
62
  export declare const sepiaMat: (x?: number) => ColorMatrix;
56
63
  export declare const tintMat: (x: number) => ColorMatrix;
57
64
  /**
package/transform.js CHANGED
@@ -109,11 +109,18 @@ export const hueRotateMat = (theta) => {
109
109
  0, 0, 0, 1, 0
110
110
  ];
111
111
  };
112
+ /**
113
+ * Color temperature adjustment matrix. `x` controls blue/yellow, `y` controls
114
+ * green/magenta axis (both params in [-1,1] range).
115
+ *
116
+ * @param x
117
+ * @param y
118
+ */
112
119
  // prettier-ignore
113
- export const temperatureMat = (x) => [
114
- 1 + x, 0, 0, 0, 0,
115
- 0, 1, 0, 0, 0,
116
- 0, 0, 1 - x, 0, 0,
120
+ export const temperatureMat = (x, y = 0) => [
121
+ 1 + x + y, 0, 0, 0, 0,
122
+ 0, 1 - y, 0, 0, 0,
123
+ 0, 0, 1 - x + y, 0, 0,
117
124
  0, 0, 0, 1, 0
118
125
  ];
119
126
  // prettier-ignore