@thi.ng/color 5.7.32 → 5.7.34

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**: 2025-04-01T21:42:04Z
3
+ - **Last updated**: 2025-04-16T11:11:14Z
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.
@@ -11,6 +11,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
11
11
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
12
12
  and/or version bumps of transitive dependencies.
13
13
 
14
+ ### [5.7.33](https://github.com/thi-ng/umbrella/tree/@thi.ng/color@5.7.33) (2025-04-16)
15
+
16
+ #### ♻️ Refactoring
17
+
18
+ - minor internal updates (imports) ([269c8ae](https://github.com/thi-ng/umbrella/commit/269c8ae))
19
+
14
20
  ### [5.7.4](https://github.com/thi-ng/umbrella/tree/@thi.ng/color@5.7.4) (2024-09-16)
15
21
 
16
22
  #### 🩹 Bug fixes
package/README.md CHANGED
@@ -693,7 +693,7 @@ For Node.js REPL:
693
693
  const color = await import("@thi.ng/color");
694
694
  ```
695
695
 
696
- Package sizes (brotli'd, pre-treeshake): ESM: 15.79 KB
696
+ Package sizes (brotli'd, pre-treeshake): ESM: 15.84 KB
697
697
 
698
698
  ## Dependencies
699
699
 
package/alpha.d.ts CHANGED
@@ -8,5 +8,5 @@ export declare const alpha: (src: ReadonlyColor) => number;
8
8
  * @param src
9
9
  * @param alpha
10
10
  */
11
- export declare const setAlpha: (out: Color | null, src: ReadonlyColor, alpha: number) => import("@thi.ng/vectors").Vec;
11
+ export declare const setAlpha: (out: Color | null, src: ReadonlyColor, alpha: number) => import("@thi.ng/vectors").Vec<number>;
12
12
  //# sourceMappingURL=alpha.d.ts.map
package/analog.d.ts CHANGED
@@ -40,7 +40,7 @@ export declare const analog: AnalogFn;
40
40
  * @param deltaA -
41
41
  * @param rnd -
42
42
  */
43
- export declare const analogHsv: (out: Color | null, src: ReadonlyColor, deltaH: number, deltaS?: number, deltaV?: number, deltaA?: number, rnd?: IRandom) => import("@thi.ng/vectors").Vec;
43
+ export declare const analogHsv: (out: Color | null, src: ReadonlyColor, deltaH: number, deltaS?: number, deltaV?: number, deltaA?: number, rnd?: IRandom) => import("@thi.ng/vectors").Vec<number>;
44
44
  /**
45
45
  * Similar to {@link analogHsv}. Returns an analog color based on given RGBA
46
46
  * color, with each channel randomly varied by given delta amounts (and
@@ -59,5 +59,5 @@ export declare const analogHsv: (out: Color | null, src: ReadonlyColor, deltaH:
59
59
  * @param deltaA -
60
60
  * @param rnd -
61
61
  */
62
- export declare const analogRgb: (out: Color | null, src: ReadonlyColor, deltaR: number, deltaG?: number, deltaB?: number, deltaA?: number, rnd?: IRandom) => import("@thi.ng/vectors").Vec;
62
+ export declare const analogRgb: (out: Color | null, src: ReadonlyColor, deltaR: number, deltaG?: number, deltaB?: number, deltaA?: number, rnd?: IRandom) => import("@thi.ng/vectors").Vec<number>;
63
63
  //# sourceMappingURL=analog.d.ts.map
package/api.d.ts CHANGED
@@ -189,7 +189,7 @@ export declare class ParsedColor implements IParsedColor {
189
189
  readonly mode: ColorMode;
190
190
  value: Color;
191
191
  constructor(mode: ColorMode, value: Color);
192
- deref(): Vec;
192
+ deref(): Color;
193
193
  }
194
194
  /**
195
195
  * A 4x5 matrix in column-major order
package/clamp.d.ts CHANGED
@@ -15,7 +15,7 @@ import type { Color, ReadonlyColor } from "./api.js";
15
15
  * @param src - source color
16
16
  * @param alpha - alpha value
17
17
  */
18
- export declare const clamp: (out: Color | null, src: ReadonlyColor, alpha?: number) => import("@thi.ng/vectors").Vec;
18
+ export declare const clamp: (out: Color | null, src: ReadonlyColor, alpha?: number) => import("@thi.ng/vectors").Vec<number>;
19
19
  /**
20
20
  * Similar to {@link clamp}, but calls `ensureHue` to fold (instead of clamping)
21
21
  * the hue into the `[0,1]` interval.
@@ -27,5 +27,5 @@ export declare const clamp: (out: Color | null, src: ReadonlyColor, alpha?: numb
27
27
  * @param src - source color
28
28
  * @param alpha - alpha value
29
29
  */
30
- export declare const clampH: (out: Color | null, src: ReadonlyColor, alpha?: number) => import("@thi.ng/vectors").Vec;
30
+ export declare const clampH: (out: Color | null, src: ReadonlyColor, alpha?: number) => import("@thi.ng/vectors").Vec<number>;
31
31
  //# sourceMappingURL=clamp.d.ts.map
package/defcolor.js CHANGED
@@ -8,7 +8,7 @@ import { fract } from "@thi.ng/math/prec";
8
8
  import { vector } from "@thi.ng/strings/vector";
9
9
  import { mapStridedBuffer } from "@thi.ng/vectors/buffer";
10
10
  import { clamp4 } from "@thi.ng/vectors/clamp";
11
- import { declareIndices } from "@thi.ng/vectors/compile/accessors";
11
+ import { declareIndices } from "@thi.ng/vectors/accessors";
12
12
  import { eqDelta4 } from "@thi.ng/vectors/eqdelta";
13
13
  import { stridedValues } from "@thi.ng/vectors/iterator";
14
14
  import { randMinMax } from "@thi.ng/vectors/rand-minmax";
package/int/int-rgb.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { Color } from "../api.js";
2
- export declare const intArgb32Rgb: (out: Color | null, src: number) => import("@thi.ng/vectors").Vec;
3
- export declare const intRgb24Rgb: (out: Color | null, src: number) => import("@thi.ng/vectors").Vec;
4
- export declare const intAbgr32Rgb: (out: Color | null, src: number) => import("@thi.ng/vectors").Vec;
5
- export declare const intBgr24Rgb: (out: Color | null, src: number) => import("@thi.ng/vectors").Vec;
2
+ export declare const intArgb32Rgb: (out: Color | null, src: number) => Color;
3
+ export declare const intRgb24Rgb: (out: Color | null, src: number) => Color;
4
+ export declare const intAbgr32Rgb: (out: Color | null, src: number) => Color;
5
+ export declare const intBgr24Rgb: (out: Color | null, src: number) => Color;
6
6
  //# sourceMappingURL=int-rgb.d.ts.map
package/int/int-srgb.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { Color } from "../api.js";
2
- export declare const intArgb32Srgb: (out: Color | null, src: number) => import("@thi.ng/vectors").Vec;
3
- export declare const intAbgr32Srgb: (out: Color | null, src: number) => import("@thi.ng/vectors").Vec;
4
- export declare const intRgb24Srgb: (out: Color | null, src: number) => import("@thi.ng/vectors").Vec;
5
- export declare const intBgr24Srgb: (out: Color | null, src: number) => import("@thi.ng/vectors").Vec;
2
+ export declare const intArgb32Srgb: (out: Color | null, src: number) => import("@thi.ng/vectors").Vec<number>;
3
+ export declare const intAbgr32Srgb: (out: Color | null, src: number) => import("@thi.ng/vectors").Vec<number>;
4
+ export declare const intRgb24Srgb: (out: Color | null, src: number) => import("@thi.ng/vectors").Vec<number>;
5
+ export declare const intBgr24Srgb: (out: Color | null, src: number) => import("@thi.ng/vectors").Vec<number>;
6
6
  //# sourceMappingURL=int-srgb.d.ts.map
package/int/int.js CHANGED
@@ -5,7 +5,7 @@ import { isString } from "@thi.ng/checks/is-string";
5
5
  import { illegalArgs } from "@thi.ng/errors/illegal-arguments";
6
6
  import { SYSTEM } from "@thi.ng/random/system";
7
7
  import { mapStridedBuffer } from "@thi.ng/vectors/buffer";
8
- import { declareIndex } from "@thi.ng/vectors/compile/accessors";
8
+ import { declareIndex } from "@thi.ng/vectors/accessors";
9
9
  import { eqDelta4 } from "@thi.ng/vectors/eqdelta";
10
10
  import { parseCss } from "../css/parse-css.js";
11
11
  import { __scale8bit } from "../internal/scale.js";
@@ -1,9 +1,9 @@
1
1
  import type { ReadonlyVec } from "@thi.ng/vectors";
2
2
  import type { Color, ColorMatrix, ReadonlyColor } from "../api.js";
3
3
  /** @internal */
4
- export declare const __mulV33: (out: Color | null, mat: ReadonlyVec, src: ReadonlyColor, clampOut?: boolean) => import("@thi.ng/vectors").Vec;
4
+ export declare const __mulV33: (out: Color | null, mat: ReadonlyVec, src: ReadonlyColor, clampOut?: boolean) => import("@thi.ng/vectors").Vec<number>;
5
5
  /** @internal */
6
- export declare const __mulV45: (out: Color | null, mat: ColorMatrix, src: ReadonlyColor, clampOut?: boolean) => import("@thi.ng/vectors").Vec;
6
+ export declare const __mulV45: (out: Color | null, mat: ColorMatrix, src: ReadonlyColor, clampOut?: boolean) => import("@thi.ng/vectors").Vec<number>;
7
7
  /** @internal */
8
8
  export declare const __mulM45: (a: ColorMatrix, b: ColorMatrix) => ColorMatrix;
9
9
  //# sourceMappingURL=matrix-ops.d.ts.map
package/invert.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ColorOp, TypedColor } from "./api.js";
1
+ import type { Color, ColorOp, TypedColor } from "./api.js";
2
2
  /**
3
3
  * Inverts the RGB channels of an RGBA color.
4
4
  *
@@ -22,5 +22,5 @@ export declare const invertInt: (src: number) => number;
22
22
  * @param out
23
23
  * @param src
24
24
  */
25
- export declare const invert: import("@thi.ng/defmulti").MultiFn2<import("@thi.ng/vectors").Vec | null, TypedColor<any>, import("@thi.ng/vectors").Vec>;
25
+ export declare const invert: import("@thi.ng/defmulti").MultiFn2<Color | null, TypedColor<any>, Color>;
26
26
  //# sourceMappingURL=invert.d.ts.map
package/lab/lab-xyz.d.ts CHANGED
@@ -7,7 +7,7 @@ import type { Color, ColorOp, ReadonlyColor } from "../api.js";
7
7
  * @param src -
8
8
  * @param white -
9
9
  */
10
- export declare const labXyz: (out: Color | null, src: ReadonlyColor, white?: number[]) => import("@thi.ng/vectors").Vec;
10
+ export declare const labXyz: (out: Color | null, src: ReadonlyColor, white?: number[]) => import("@thi.ng/vectors").Vec<number>;
11
11
  /**
12
12
  * Same as {@link labXyz}, but using hardcoded {@link D65} white point.
13
13
  *
package/lighten.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { TypedColor } from "./api.js";
1
+ import type { Color, TypedColor } from "./api.js";
2
2
  /**
3
3
  * Adjust the "lightness" (luma, brightness etc.) channel of given `src` color
4
4
  * and `delta` offset. Writes result into `out` (or if null, back into `src`).
@@ -10,5 +10,5 @@ import type { TypedColor } from "./api.js";
10
10
  * @param src -
11
11
  * @param delta -
12
12
  */
13
- export declare const lighten: import("@thi.ng/defmulti").MultiFn3<import("@thi.ng/vectors").Vec | null, TypedColor<any>, number, import("@thi.ng/vectors").Vec>;
13
+ export declare const lighten: import("@thi.ng/defmulti").MultiFn3<Color | null, TypedColor<any>, number, Color>;
14
14
  //# sourceMappingURL=lighten.d.ts.map
package/mix.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { FnN3, FnU4 } from "@thi.ng/api";
2
- import type { ColorMixFn, TypedColor } from "./api.js";
2
+ import type { Color, ColorMixFn, TypedColor } from "./api.js";
3
3
  /**
4
4
  * HOF color mix function. Takes 4 scalar mix fns (one per color channel) and
5
5
  * returns new {@link ColorMixFn}.
@@ -74,5 +74,5 @@ export declare const mixNNNN: ColorMixFn;
74
74
  * @param b -
75
75
  * @param t -
76
76
  */
77
- export declare const mix: import("@thi.ng/defmulti").MultiFn4<import("@thi.ng/vectors").Vec | null, TypedColor<any>, TypedColor<any>, number, import("@thi.ng/vectors").Vec>;
77
+ export declare const mix: import("@thi.ng/defmulti").MultiFn4<Color | null, TypedColor<any>, TypedColor<any>, number, Color>;
78
78
  //# sourceMappingURL=mix.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/color",
3
- "version": "5.7.32",
3
+ "version": "5.7.34",
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",
@@ -43,24 +43,24 @@
43
43
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
44
44
  },
45
45
  "dependencies": {
46
- "@thi.ng/api": "^8.11.25",
47
- "@thi.ng/arrays": "^2.10.22",
48
- "@thi.ng/binary": "^3.4.48",
49
- "@thi.ng/checks": "^3.7.5",
50
- "@thi.ng/compare": "^2.4.17",
51
- "@thi.ng/compose": "^3.0.28",
52
- "@thi.ng/defmulti": "^3.0.65",
53
- "@thi.ng/errors": "^2.5.31",
54
- "@thi.ng/math": "^5.11.25",
55
- "@thi.ng/random": "^4.1.16",
56
- "@thi.ng/strings": "^3.9.10",
57
- "@thi.ng/transducers": "^9.2.25",
58
- "@thi.ng/vectors": "^7.13.1"
46
+ "@thi.ng/api": "^8.11.26",
47
+ "@thi.ng/arrays": "^2.10.23",
48
+ "@thi.ng/binary": "^3.4.49",
49
+ "@thi.ng/checks": "^3.7.6",
50
+ "@thi.ng/compare": "^2.4.18",
51
+ "@thi.ng/compose": "^3.0.29",
52
+ "@thi.ng/defmulti": "^3.0.66",
53
+ "@thi.ng/errors": "^2.5.32",
54
+ "@thi.ng/math": "^5.11.26",
55
+ "@thi.ng/random": "^4.1.17",
56
+ "@thi.ng/strings": "^3.9.11",
57
+ "@thi.ng/transducers": "^9.2.26",
58
+ "@thi.ng/vectors": "^8.0.1"
59
59
  },
60
60
  "devDependencies": {
61
61
  "esbuild": "^0.25.2",
62
- "typedoc": "^0.28.1",
63
- "typescript": "^5.8.2"
62
+ "typedoc": "^0.28.2",
63
+ "typescript": "^5.8.3"
64
64
  },
65
65
  "keywords": [
66
66
  "color",
@@ -446,5 +446,5 @@
446
446
  "vectors"
447
447
  ]
448
448
  },
449
- "gitHead": "c88a589f33207b02a43172313b38ea09571265f1\n"
449
+ "gitHead": "69080248c98f9555642384aed76a0431e9f44835\n"
450
450
  }
package/rgb/hue-rgb.d.ts CHANGED
@@ -7,5 +7,5 @@ import type { Color, Hue } from "../api.js";
7
7
  * @param hue - normalized hue
8
8
  */
9
9
  export declare const hueRgb: (out: Color | null, hue: number, alpha?: number) => Color;
10
- export declare const namedHueRgb: (out: Color | null, hue: Hue, alpha?: number) => import("@thi.ng/vectors").Vec;
10
+ export declare const namedHueRgb: (out: Color | null, hue: Hue, alpha?: number) => Color;
11
11
  //# sourceMappingURL=hue-rgb.d.ts.map
package/rgb/rgb-xyz.d.ts CHANGED
@@ -9,7 +9,7 @@ import type { Color, ColorOp, ReadonlyColor } from "../api.js";
9
9
  * @param src - source color
10
10
  * @param mat - transform matrix
11
11
  */
12
- export declare const rgbXyz: (out: Color | null, src: ReadonlyColor, mat?: number[]) => import("@thi.ng/vectors").Vec;
12
+ export declare const rgbXyz: (out: Color | null, src: ReadonlyColor, mat?: number[]) => import("@thi.ng/vectors").Vec<number>;
13
13
  /**
14
14
  * Same as {@link rgbXyz}, but hard coded to use {@link D65} white point (via
15
15
  * {@link RGB_XYZ_D65} matrix).
package/rgb/rgb-ycc.d.ts CHANGED
@@ -13,5 +13,5 @@ import type { Color, ReadonlyColor } from "../api.js";
13
13
  * @param src -
14
14
  * @param luma -
15
15
  */
16
- export declare const rgbYcc: (out: Color | null, src: ReadonlyColor, luma?: number[]) => import("@thi.ng/vectors").Vec;
16
+ export declare const rgbYcc: (out: Color | null, src: ReadonlyColor, luma?: number[]) => import("@thi.ng/vectors").Vec<number>;
17
17
  //# sourceMappingURL=rgb-ycc.d.ts.map
package/rotate.d.ts CHANGED
@@ -23,7 +23,7 @@ import type { Color, TypedColor } from "./api.js";
23
23
  * @param src
24
24
  * @param theta
25
25
  */
26
- export declare const rotate: import("@thi.ng/defmulti").MultiFn3<import("@thi.ng/vectors").Vec | null, TypedColor<any>, number, import("@thi.ng/vectors").Vec>;
26
+ export declare const rotate: import("@thi.ng/defmulti").MultiFn3<Color | null, TypedColor<any>, number, Color>;
27
27
  /**
28
28
  * Syntax sugar for {@link rotate} with 180 degree rotation.
29
29
  *
@@ -33,5 +33,5 @@ export declare const rotate: import("@thi.ng/defmulti").MultiFn3<import("@thi.ng
33
33
  * @param out
34
34
  * @param src
35
35
  */
36
- export declare const complementary: (out: Color | null, src: TypedColor<any>) => import("@thi.ng/vectors").Vec;
36
+ export declare const complementary: (out: Color | null, src: TypedColor<any>) => Color;
37
37
  //# sourceMappingURL=rotate.d.ts.map
package/tint.d.ts CHANGED
@@ -36,7 +36,7 @@ export declare const tint: MultiFn3O<Color | null, TypedColor<any>, number, numb
36
36
  * @param src
37
37
  * @param n
38
38
  */
39
- export declare const tone: (out: Color | null, src: TypedColor<any>, n: number) => import("@thi.ng/vectors").Vec;
39
+ export declare const tone: (out: Color | null, src: TypedColor<any>, n: number) => Color;
40
40
  /**
41
41
  * Version of {@link tint} with black as target.
42
42
  *
@@ -49,5 +49,5 @@ export declare const tone: (out: Color | null, src: TypedColor<any>, n: number)
49
49
  * @param src
50
50
  * @param n
51
51
  */
52
- export declare const shade: (out: Color | null, src: TypedColor<any>, n: number) => import("@thi.ng/vectors").Vec;
52
+ export declare const shade: (out: Color | null, src: TypedColor<any>, n: number) => Color;
53
53
  //# sourceMappingURL=tint.d.ts.map
package/transform.d.ts CHANGED
@@ -10,7 +10,7 @@ import type { ColorMatrix, ReadonlyColor } from "./api.js";
10
10
  * @param src - source color
11
11
  * @param clampOut - true, if result should be clamped to `[0,1]`
12
12
  */
13
- export declare const transform: (out: import("./api.js").Color | null, mat: ColorMatrix, src: ReadonlyColor, clampOut?: boolean) => import("@thi.ng/vectors").Vec;
13
+ export declare const transform: (out: import("./api.js").Color | null, mat: ColorMatrix, src: ReadonlyColor, clampOut?: boolean) => import("@thi.ng/vectors").Vec<number>;
14
14
  /**
15
15
  * Concatenates given color matrices by pairwise multiplying them in
16
16
  * left-right order. Returns combined result matrix to be used with
package/xyz/xyz-lab.d.ts CHANGED
@@ -11,7 +11,7 @@ import type { Color, ColorOp, ReadonlyColor } from "../api.js";
11
11
  * @param src -
12
12
  * @param white -
13
13
  */
14
- export declare const xyzLab: (out: Color | null, src: ReadonlyColor, white?: number[]) => import("@thi.ng/vectors").Vec;
14
+ export declare const xyzLab: (out: Color | null, src: ReadonlyColor, white?: number[]) => import("@thi.ng/vectors").Vec<number>;
15
15
  /**
16
16
  * Same as {@link xyzLab}, but hard coded to use {@link D65} white point.
17
17
  *
package/xyz/xyz-rgb.d.ts CHANGED
@@ -8,7 +8,7 @@ import type { Color, ColorOp, ReadonlyColor } from "../api.js";
8
8
  * @param out - result
9
9
  * @param src - source color
10
10
  */
11
- export declare const xyzRgb: (out: Color | null, src: ReadonlyColor, mat?: number[]) => import("@thi.ng/vectors").Vec;
11
+ export declare const xyzRgb: (out: Color | null, src: ReadonlyColor, mat?: number[]) => import("@thi.ng/vectors").Vec<number>;
12
12
  /**
13
13
  * Same as {@link xyzRgb}, but hard coded to use {@link D65} white point (via
14
14
  * {@link XYZ_RGB_D65} matrix).
package/ycc/ycc-rgb.d.ts CHANGED
@@ -13,5 +13,5 @@ import type { Color, ReadonlyColor } from "../api.js";
13
13
  * @param src -
14
14
  * @param luma -
15
15
  */
16
- export declare const yccRgb: (out: Color | null, src: ReadonlyColor, luma?: number[]) => import("@thi.ng/vectors").Vec;
16
+ export declare const yccRgb: (out: Color | null, src: ReadonlyColor, luma?: number[]) => import("@thi.ng/vectors").Vec<number>;
17
17
  //# sourceMappingURL=ycc-rgb.d.ts.map