@thi.ng/color 5.4.4 → 5.4.6

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-03-14T13:27:19Z
3
+ - **Last updated**: 2023-03-27T19:05:48Z
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
@@ -579,7 +579,7 @@ concatenation (see `concat()`) for more efficient application.
579
579
  ## Related packages
580
580
 
581
581
  - [@thi.ng/pixel](https://github.com/thi-ng/umbrella/tree/develop/packages/pixel) - Typedarray integer & float pixel buffers w/ customizable formats, blitting, drawing, convolution
582
- - [@thi.ng/vectors](https://github.com/thi-ng/umbrella/tree/develop/packages/vectors) - Optimized 2d/3d/4d and arbitrary length vector operations
582
+ - [@thi.ng/vectors](https://github.com/thi-ng/umbrella/tree/develop/packages/vectors) - Optimized 2d/3d/4d and arbitrary length vector operations, support for memory mapping/layouts
583
583
 
584
584
  ## Installation
585
585
 
package/color-range.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { Without } from "@thi.ng/api";
2
2
  import type { ColorRange, ColorRangeOpts, ColorRangePreset, ColorThemePart, ColorThemePartTuple } from "./api/ranges.js";
3
- import { LCH } from "./lch/lch.js";
3
+ import { type LCH } from "./lch/lch.js";
4
4
  /**
5
5
  * Preset {@link ColorRange}s for use with {@link colorsFromRange},
6
6
  * {@link colorsFromTheme} etc.
package/color-range.js CHANGED
@@ -7,13 +7,13 @@ import { fract } from "@thi.ng/math/prec";
7
7
  import { coin } from "@thi.ng/random/coin";
8
8
  import { SYSTEM } from "@thi.ng/random/system";
9
9
  import { weightedRandom } from "@thi.ng/random/weighted-random";
10
+ import { analog } from "./analog.js";
10
11
  import { parseCss } from "./css/parse-css.js";
11
12
  import { __ensureAlpha } from "./internal/ensure.js";
12
- import { lch } from "./lch/lch.js";
13
- import { analog } from "./analog.js";
14
13
  import { isBlack } from "./is-black.js";
15
14
  import { isGray } from "./is-gray.js";
16
15
  import { isWhite } from "./is-white.js";
16
+ import { lch } from "./lch/lch.js";
17
17
  /**
18
18
  * Preset {@link ColorRange}s for use with {@link colorsFromRange},
19
19
  * {@link colorsFromTheme} etc.
@@ -1,5 +1,5 @@
1
1
  import type { IDeref } from "@thi.ng/api";
2
- import { IParsedColor } from "../api.js";
2
+ import { type IParsedColor } from "../api.js";
3
3
  /**
4
4
  * Attempts to parse given CSS color into an interim {@link ParsedColor} type
5
5
  * with {@link srgb}, {@link hsl}, {@link labD50} or {@link lch} color modes.
package/distance.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ReadonlyVec } from "@thi.ng/vectors/api";
1
+ import { type ReadonlyVec } from "@thi.ng/vectors/api";
2
2
  import type { ColorDistance } from "./api.js";
3
3
  /**
4
4
  * Higher order function. Returns {@link ColorDistance} function for given color
@@ -35,14 +35,14 @@ export declare const distLch: ColorDistance;
35
35
  * @param a -
36
36
  * @param b -
37
37
  */
38
- export declare const distHsvSat: ColorDistance<ReadonlyVec>;
38
+ export declare const distHsvSat: ColorDistance;
39
39
  /**
40
40
  * Computes difference in brightness between two HSV or two HSL colors.
41
41
  *
42
42
  * @param a -
43
43
  * @param b -
44
44
  */
45
- export declare const distHsvLuma: ColorDistance<ReadonlyVec>;
45
+ export declare const distHsvLuma: ColorDistance;
46
46
  /**
47
47
  * Computes eucledian distance between two colors. Only the first 3 color
48
48
  * channels will be considered.
@@ -66,21 +66,21 @@ export declare const distSrgbLuma: ColorDistance;
66
66
  * @param a -
67
67
  * @param b -
68
68
  */
69
- export declare const distRgbRed: ColorDistance<ReadonlyVec>;
69
+ export declare const distRgbRed: ColorDistance;
70
70
  /**
71
71
  * Computes green difference between two RGB colors.
72
72
  *
73
73
  * @param a -
74
74
  * @param b -
75
75
  */
76
- export declare const distRgbGreen: ColorDistance<ReadonlyVec>;
76
+ export declare const distRgbGreen: ColorDistance;
77
77
  /**
78
78
  * Computes blue difference between two RGB colors.
79
79
  *
80
80
  * @param a -
81
81
  * @param b -
82
82
  */
83
- export declare const distRgbBlue: ColorDistance<ReadonlyVec>;
83
+ export declare const distRgbBlue: ColorDistance;
84
84
  /**
85
85
  * Higher order function to compute the CIEDE2000 color difference between 2
86
86
  * colors in CIELAB space. Takes a vector of LCH weight coefficients to adjust
package/mix.d.ts CHANGED
@@ -27,8 +27,8 @@ export declare const mixH: FnN3;
27
27
  * @param t -
28
28
  */
29
29
  export declare const mixN: FnN3;
30
- export declare const mixHNNN: ColorMixFn<import("@thi.ng/vectors").ReadonlyVec>;
31
- export declare const mixNNHN: ColorMixFn<import("@thi.ng/vectors").ReadonlyVec>;
30
+ export declare const mixHNNN: ColorMixFn;
31
+ export declare const mixNNHN: ColorMixFn;
32
32
  /**
33
33
  * Channelwise linear interpolation between colors `a` and `b` using `t` [0..1]
34
34
  * as blend factor.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/color",
3
- "version": "5.4.4",
3
+ "version": "5.4.6",
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",
@@ -25,7 +25,7 @@
25
25
  "license": "Apache-2.0",
26
26
  "scripts": {
27
27
  "build": "yarn clean && tsc --declaration",
28
- "clean": "rimraf --glob '*.js' '*.d.ts' '*.map' doc api css hcy hsi hsl hsv int internal lab lch oklab rgb srgb xyy xyz ycc",
28
+ "clean": "rimraf --glob '*.js' '*.d.ts' '*.map' doc api css hcy hsi hsl hsv int internal lab lch oklab oklch rgb srgb xyy xyz ycc",
29
29
  "doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
30
30
  "doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
31
31
  "doc:readme": "yarn doc:stats && tools:readme",
@@ -38,27 +38,27 @@
38
38
  "tool:swatches": "tools:node-esm tools/index.ts"
39
39
  },
40
40
  "dependencies": {
41
- "@thi.ng/api": "^8.7.4",
42
- "@thi.ng/arrays": "^2.5.8",
43
- "@thi.ng/binary": "^3.3.21",
44
- "@thi.ng/checks": "^3.3.10",
45
- "@thi.ng/compare": "^2.1.27",
46
- "@thi.ng/compose": "^2.1.29",
47
- "@thi.ng/defmulti": "^2.1.33",
48
- "@thi.ng/errors": "^2.2.13",
49
- "@thi.ng/math": "^5.4.5",
50
- "@thi.ng/random": "^3.3.27",
51
- "@thi.ng/strings": "^3.4.2",
52
- "@thi.ng/transducers": "^8.3.38",
53
- "@thi.ng/vectors": "^7.6.8"
41
+ "@thi.ng/api": "^8.7.5",
42
+ "@thi.ng/arrays": "^2.5.9",
43
+ "@thi.ng/binary": "^3.3.22",
44
+ "@thi.ng/checks": "^3.3.11",
45
+ "@thi.ng/compare": "^2.1.28",
46
+ "@thi.ng/compose": "^2.1.30",
47
+ "@thi.ng/defmulti": "^2.1.34",
48
+ "@thi.ng/errors": "^2.2.14",
49
+ "@thi.ng/math": "^5.4.6",
50
+ "@thi.ng/random": "^3.3.28",
51
+ "@thi.ng/strings": "^3.4.3",
52
+ "@thi.ng/transducers": "^8.4.1",
53
+ "@thi.ng/vectors": "^7.6.10"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@microsoft/api-extractor": "^7.34.4",
57
- "@thi.ng/testament": "^0.3.13",
58
- "rimraf": "^4.4.0",
57
+ "@thi.ng/testament": "^0.3.14",
58
+ "rimraf": "^4.4.1",
59
59
  "tools": "^0.0.1",
60
- "typedoc": "^0.23.26",
61
- "typescript": "^4.9.5"
60
+ "typedoc": "^0.23.28",
61
+ "typescript": "^5.0.2"
62
62
  },
63
63
  "keywords": [
64
64
  "color",
@@ -445,5 +445,5 @@
445
445
  "vectors"
446
446
  ]
447
447
  },
448
- "gitHead": "cc46c097a3a173fb1ef41f57a858d03037063141\n"
448
+ "gitHead": "83b15b34326d480cbca0472b20390d4d3bbb792a\n"
449
449
  }
@@ -1,4 +1,4 @@
1
- import { SRGB } from "../srgb/srgb.js";
1
+ import { type SRGB } from "../srgb/srgb.js";
2
2
  /**
3
3
  * @remarks
4
4
  * Based on:
package/strategies.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { LCH } from "./lch/lch.js";
1
+ import { type LCH } from "./lch/lch.js";
2
2
  /**
3
3
  * Returns array of `src` color and its complementary color, possibly adjusted
4
4
  * via optional `deltaL` and `deltaC` args (offsets for L & C channels).
@@ -1,4 +1,4 @@
1
- import { XYZD65 } from "./xyz65.js";
1
+ import { type XYZD65 } from "./xyz65.js";
2
2
  /**
3
3
  * Computes XYZA for given wavelength (in nanometers) and optional alpha channel
4
4
  * (default: 1), writes result into `out` (or a new array if null).