@thi.ng/color 5.2.12 → 5.2.14
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 +7 -10
- package/analog.d.ts +9 -3
- package/analog.js +9 -3
- package/api/gradients.d.ts +4 -4
- package/api/names.d.ts +1 -1
- package/api/ranges.d.ts +4 -3
- package/api.d.ts +9 -9
- package/cosine-gradients.d.ts +2 -1
- package/cosine-gradients.js +2 -1
- package/defcolor.d.ts +1 -1
- package/gradients.d.ts +2 -1
- package/linear.d.ts +2 -2
- package/linear.js +2 -2
- package/mix.d.ts +2 -2
- package/mix.js +2 -2
- package/package.json +20 -20
- package/rgb/kelvin-rgba.d.ts +3 -2
- package/rgb/kelvin-rgba.js +3 -2
- package/rgb/rgb-hcv.d.ts +1 -1
- package/rgb/rgb-hcv.js +1 -1
- package/rgb/rgb-hcy.d.ts +1 -1
- package/rgb/rgb-hcy.js +1 -1
- package/rgb/rgb-xyz.d.ts +1 -1
- package/rgb/rgb-xyz.js +1 -1
- package/xyz/xyz-rgb.d.ts +1 -1
- package/xyz/xyz-rgb.js +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<!-- This file is generated - DO NOT EDIT! -->
|
|
2
2
|
|
|
3
|
-
# 
|
|
3
|
+
# 
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@thi.ng/color)
|
|
6
6
|

|
|
7
|
-
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
This project is part of the
|
|
10
10
|
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
|
|
@@ -34,7 +34,7 @@ For the Clojure version, please visit: [thi.ng/color-clj](https://thi.ng/color-c
|
|
|
34
34
|
|
|
35
35
|
## About
|
|
36
36
|
|
|
37
|
-
Array-based color types, CSS parsing, conversions, transformations, declarative theme generation, gradients, presets
|
|
37
|
+
Array-based color types, CSS parsing, conversions, transformations, declarative theme generation, gradients, presets
|
|
38
38
|
|
|
39
39
|
---
|
|
40
40
|
|
|
@@ -594,11 +594,8 @@ ES module import:
|
|
|
594
594
|
|
|
595
595
|
For Node.js REPL:
|
|
596
596
|
|
|
597
|
-
```
|
|
598
|
-
|
|
599
|
-
node --experimental-repl-await
|
|
600
|
-
|
|
601
|
-
> const color = await import("@thi.ng/color");
|
|
597
|
+
```js
|
|
598
|
+
const color = await import("@thi.ng/color");
|
|
602
599
|
```
|
|
603
600
|
|
|
604
601
|
Package sizes (brotli'd, pre-treeshake): ESM: 15.21 KB
|
|
@@ -644,7 +641,7 @@ A selection:
|
|
|
644
641
|
|
|
645
642
|
## Authors
|
|
646
643
|
|
|
647
|
-
Karsten Schmidt
|
|
644
|
+
- [Karsten Schmidt](https://thi.ng)
|
|
648
645
|
|
|
649
646
|
If this project contributes to an academic publication, please cite it as:
|
|
650
647
|
|
|
@@ -659,4 +656,4 @@ If this project contributes to an academic publication, please cite it as:
|
|
|
659
656
|
|
|
660
657
|
## License
|
|
661
658
|
|
|
662
|
-
© 2016 - 2022 Karsten Schmidt // Apache
|
|
659
|
+
© 2016 - 2022 Karsten Schmidt // Apache License 2.0
|
package/analog.d.ts
CHANGED
|
@@ -5,13 +5,17 @@ export declare const defAnalog: FnU3<Fn3<number, number, IRandom, number>, Fn4<C
|
|
|
5
5
|
/**
|
|
6
6
|
* Returns a random analog color based on given `src` color and variance
|
|
7
7
|
* `delta`. Each channel will be randomized by +/- `delta`, optionally using
|
|
8
|
-
* provided
|
|
8
|
+
* provided
|
|
9
|
+
* [`IRandom`](https://docs.thi.ng/umbrella/random/interfaces/IRandom.html)
|
|
10
|
+
* PRNG.
|
|
9
11
|
*/
|
|
10
12
|
export declare const analog: import("@thi.ng/defmulti").MultiFn4<import("@thi.ng/vectors").Vec | null, TypedColor<any>, number, IRandom | undefined, import("@thi.ng/vectors").Vec>;
|
|
11
13
|
/**
|
|
12
14
|
* Similar to {@link analogRGB}. Returns an analog color based on given HSVA
|
|
13
15
|
* color, with each channel randomly varied by given channel-specific delta
|
|
14
|
-
* amounts (and optionally given
|
|
16
|
+
* amounts (and optionally given
|
|
17
|
+
* [`IRandom`](https://docs.thi.ng/umbrella/random/interfaces/IRandom.html)
|
|
18
|
+
* PRNG).
|
|
15
19
|
*
|
|
16
20
|
* @remarks
|
|
17
21
|
* This function provides more user control than {@link analog}, but the latter
|
|
@@ -32,7 +36,9 @@ export declare const analogHsv: (out: Color | null, src: ReadonlyColor, deltaH:
|
|
|
32
36
|
/**
|
|
33
37
|
* Similar to {@link analogHSV}. Returns an analog color based on given RGBA
|
|
34
38
|
* color, with each channel randomly varied by given delta amounts (and
|
|
35
|
-
* optionally given
|
|
39
|
+
* optionally given
|
|
40
|
+
* [`IRandom`](https://docs.thi.ng/umbrella/random/interfaces/IRandom.html)
|
|
41
|
+
* PRNG).
|
|
36
42
|
*
|
|
37
43
|
* @remarks
|
|
38
44
|
* By default the green and blue channel variance will be the same as `deltaR`.
|
package/analog.js
CHANGED
|
@@ -25,7 +25,9 @@ const analogNUU = defAnalog(analogN, analogU, analogU);
|
|
|
25
25
|
/**
|
|
26
26
|
* Returns a random analog color based on given `src` color and variance
|
|
27
27
|
* `delta`. Each channel will be randomized by +/- `delta`, optionally using
|
|
28
|
-
* provided
|
|
28
|
+
* provided
|
|
29
|
+
* [`IRandom`](https://docs.thi.ng/umbrella/random/interfaces/IRandom.html)
|
|
30
|
+
* PRNG.
|
|
29
31
|
*/
|
|
30
32
|
export const analog = defmulti(__dispatch1, {}, {
|
|
31
33
|
hcy: analogHNN,
|
|
@@ -41,7 +43,9 @@ export const analog = defmulti(__dispatch1, {}, {
|
|
|
41
43
|
/**
|
|
42
44
|
* Similar to {@link analogRGB}. Returns an analog color based on given HSVA
|
|
43
45
|
* color, with each channel randomly varied by given channel-specific delta
|
|
44
|
-
* amounts (and optionally given
|
|
46
|
+
* amounts (and optionally given
|
|
47
|
+
* [`IRandom`](https://docs.thi.ng/umbrella/random/interfaces/IRandom.html)
|
|
48
|
+
* PRNG).
|
|
45
49
|
*
|
|
46
50
|
* @remarks
|
|
47
51
|
* This function provides more user control than {@link analog}, but the latter
|
|
@@ -62,7 +66,9 @@ export const analogHsv = (out, src, deltaH, deltaS = 0, deltaV = 0, deltaA = 0,
|
|
|
62
66
|
/**
|
|
63
67
|
* Similar to {@link analogHSV}. Returns an analog color based on given RGBA
|
|
64
68
|
* color, with each channel randomly varied by given delta amounts (and
|
|
65
|
-
* optionally given
|
|
69
|
+
* optionally given
|
|
70
|
+
* [`IRandom`](https://docs.thi.ng/umbrella/random/interfaces/IRandom.html)
|
|
71
|
+
* PRNG).
|
|
66
72
|
*
|
|
67
73
|
* @remarks
|
|
68
74
|
* By default the green and blue channel variance will be the same as `deltaR`.
|
package/api/gradients.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { FnN, FnU, Tuple } from "@thi.ng/api";
|
|
2
2
|
import type { Color, ColorMixFn, ReadonlyColor } from "../api.js";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
3
|
+
export type CosineGradientPreset = "blue-cyan" | "blue-magenta-orange" | "blue-white-red" | "cyan-magenta" | "green-blue-orange" | "green-cyan" | "green-magenta" | "green-red" | "heat1" | "magenta-green" | "orange-blue" | "orange-magenta-blue" | "purple-orange-cyan" | "rainbow1" | "rainbow2" | "rainbow3" | "rainbow4" | "red-blue" | "yellow-green-blue" | "yellow-magenta-cyan" | "yellow-purple-magenta" | "yellow-red";
|
|
4
|
+
export type CosineCoeffs = Tuple<number, 4>;
|
|
5
|
+
export type CosGradientSpec = Tuple<CosineCoeffs, 4>;
|
|
6
6
|
/**
|
|
7
7
|
* A tuple of normalized position and color for a gradient stop.
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export type GradientColorStop<T> = [number, T];
|
|
10
10
|
export interface GradientOpts<T = ReadonlyColor> {
|
|
11
11
|
/**
|
|
12
12
|
* Number of colors to generate
|
package/api/names.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type CSSColorName = "aliceblue" | "antiquewhite" | "aqua" | "aquamarine" | "azure" | "beige" | "bisque" | "black" | "blanchedalmond" | "blue" | "blueviolet" | "brown" | "burlywood" | "cadetblue" | "chartreuse" | "chocolate" | "coral" | "cornflowerblue" | "cornsilk" | "crimson" | "cyan" | "darkblue" | "darkcyan" | "darkgoldenrod" | "darkgray" | "darkgreen" | "darkgrey" | "darkkhaki" | "darkmagenta" | "darkolivegreen" | "darkorange" | "darkorchid" | "darkred" | "darksalmon" | "darkseagreen" | "darkslateblue" | "darkslategray" | "darkslategrey" | "darkturquoise" | "darkviolet" | "deeppink" | "deepskyblue" | "dimgray" | "dimgrey" | "dodgerblue" | "firebrick" | "floralwhite" | "forestgreen" | "fuchsia" | "gainsboro" | "ghostwhite" | "gold" | "goldenrod" | "gray" | "grey" | "green" | "greenyellow" | "honeydew" | "hotpink" | "indianred" | "indigo" | "ivory" | "khaki" | "lavender" | "lavenderblush" | "lawngreen" | "lemonchiffon" | "lightblue" | "lightcoral" | "lightcyan" | "lightgoldenrodyellow" | "lightgray" | "lightgreen" | "lightgrey" | "lightpink" | "lightsalmon" | "lightseagreen" | "lightskyblue" | "lightslategray" | "lightslategrey" | "lightsteelblue" | "lightyellow" | "lime" | "limegreen" | "linen" | "magenta" | "maroon" | "mediumaquamarine" | "mediumblue" | "mediumorchid" | "mediumpurple" | "mediumseagreen" | "mediumslateblue" | "mediumspringgreen" | "mediumturquoise" | "mediumvioletred" | "midnightblue" | "mintcream" | "mistyrose" | "moccasin" | "navajowhite" | "navy" | "oldlace" | "olive" | "olivedrab" | "orange" | "orangered" | "orchid" | "palegoldenrod" | "palegreen" | "paleturquoise" | "palevioletred" | "papayawhip" | "peachpuff" | "peru" | "pink" | "plum" | "powderblue" | "purple" | "red" | "rosybrown" | "royalblue" | "saddlebrown" | "salmon" | "sandybrown" | "seagreen" | "seashell" | "sienna" | "silver" | "skyblue" | "slateblue" | "slategray" | "slategrey" | "snow" | "springgreen" | "steelblue" | "tan" | "teal" | "thistle" | "tomato" | "turquoise" | "violet" | "wheat" | "white" | "whitesmoke" | "yellow" | "yellowgreen" | "rebeccapurple" | "transparent";
|
|
2
2
|
export declare const CSS_NAMES: Record<CSSColorName, string>;
|
|
3
3
|
//# sourceMappingURL=names.d.ts.map
|
package/api/ranges.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Range } from "@thi.ng/api";
|
|
|
2
2
|
import type { IRandom } from "@thi.ng/random";
|
|
3
3
|
import type { ReadonlyColor } from "../api.js";
|
|
4
4
|
import type { CSSColorName } from "./names.js";
|
|
5
|
-
export
|
|
5
|
+
export type ColorRangePreset = "light" | "dark" | "bright" | "weak" | "neutral" | "fresh" | "soft" | "hard" | "warm" | "cool" | "intense";
|
|
6
6
|
export interface ColorRange {
|
|
7
7
|
/**
|
|
8
8
|
* Hue ranges
|
|
@@ -58,7 +58,8 @@ export interface ColorRangeOpts {
|
|
|
58
58
|
/**
|
|
59
59
|
* PRNG instance to use for randomized values
|
|
60
60
|
*
|
|
61
|
-
* @defaultValue
|
|
61
|
+
* @defaultValue
|
|
62
|
+
* [`SYSTEM`](https://docs.thi.ng/umbrella/random/variables/SYSTEM.html)
|
|
62
63
|
*/
|
|
63
64
|
rnd: IRandom;
|
|
64
65
|
}
|
|
@@ -79,5 +80,5 @@ export interface ColorThemePart {
|
|
|
79
80
|
*/
|
|
80
81
|
weight?: number;
|
|
81
82
|
}
|
|
82
|
-
export
|
|
83
|
+
export type ColorThemePartTuple = [ColorRangePreset, CSSColorName, number?] | [ColorRangePreset | CSSColorName, number?] | ColorRangePreset | CSSColorName;
|
|
83
84
|
//# sourceMappingURL=ranges.d.ts.map
|
package/api.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { FnU2, IDeref, IEqualsDelta, NumericArray, Range, Tuple } from "@thi.ng/api";
|
|
2
2
|
import type { IRandom } from "@thi.ng/random";
|
|
3
3
|
import type { IVector, ReadonlyVec, Vec } from "@thi.ng/vectors";
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
4
|
+
export type Color = Vec;
|
|
5
|
+
export type ReadonlyColor = ReadonlyVec;
|
|
6
|
+
export type MaybeColor = TypedColor<any> | IParsedColor | ReadonlyColor | string | number;
|
|
7
|
+
export type ColorOp = (out: Color | null, src: ReadonlyColor) => Color;
|
|
8
|
+
export type ColorMode = "argb32" | "abgr32" | "hcy" | "hsi" | "hsl" | "hsv" | "lab50" | "lab65" | "lch" | "oklab" | "rgb" | "srgb" | "xyy" | "xyz50" | "xyz65" | "ycc";
|
|
9
9
|
/**
|
|
10
10
|
* Hue names in radial order, e.g. used by {@link namedHueRgb}.
|
|
11
11
|
*/
|
|
@@ -65,7 +65,7 @@ export interface ColorSpec<M extends ColorMode, K extends string> {
|
|
|
65
65
|
*/
|
|
66
66
|
toRgb: ColorOp | Tuple<ColorOp, 2 | 3 | 4>;
|
|
67
67
|
}
|
|
68
|
-
export
|
|
68
|
+
export type Conversions = Partial<Record<ColorMode, ColorOp>> & {
|
|
69
69
|
rgb: ColorOp;
|
|
70
70
|
};
|
|
71
71
|
export interface ColorFactory<T extends TypedColor<any>> {
|
|
@@ -177,7 +177,7 @@ export declare class ParsedColor implements IParsedColor {
|
|
|
177
177
|
/**
|
|
178
178
|
* A 4x5 matrix in column-major order
|
|
179
179
|
*/
|
|
180
|
-
export
|
|
181
|
-
export
|
|
182
|
-
export
|
|
180
|
+
export type ColorMatrix = Tuple<number, 20>;
|
|
181
|
+
export type ColorDistance<T = ReadonlyColor> = FnU2<T, number>;
|
|
182
|
+
export type ColorMixFn<T = ReadonlyColor> = (out: Color | null, a: T, b: T, t: number) => Color;
|
|
183
183
|
//# sourceMappingURL=api.d.ts.map
|
package/cosine-gradients.d.ts
CHANGED
|
@@ -62,7 +62,8 @@ export declare const cosineCoeffs: FnU2<ReadonlyColor, CosGradientSpec>;
|
|
|
62
62
|
* an array of `n+1` linear RGBA color samples.
|
|
63
63
|
*
|
|
64
64
|
* @remarks
|
|
65
|
-
*
|
|
65
|
+
* See
|
|
66
|
+
* [`tween()`](https://docs.thi.ng/umbrella/transducers/functions/tween.html)
|
|
66
67
|
*
|
|
67
68
|
* @example
|
|
68
69
|
* ```ts
|
package/cosine-gradients.js
CHANGED
|
@@ -223,7 +223,8 @@ export const cosineCoeffs = (from, to) => {
|
|
|
223
223
|
* an array of `n+1` linear RGBA color samples.
|
|
224
224
|
*
|
|
225
225
|
* @remarks
|
|
226
|
-
*
|
|
226
|
+
* See
|
|
227
|
+
* [`tween()`](https://docs.thi.ng/umbrella/transducers/functions/tween.html)
|
|
227
228
|
*
|
|
228
229
|
* @example
|
|
229
230
|
* ```ts
|
package/defcolor.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IRandom } from "@thi.ng/random";
|
|
2
2
|
import type { ColorFactory, ColorMode, ColorSpec, ReadonlyColor, TypedColor } from "./api.js";
|
|
3
|
-
|
|
3
|
+
type $DefColor<M extends ColorMode, K extends string> = {
|
|
4
4
|
[k in K]: number;
|
|
5
5
|
} & {
|
|
6
6
|
readonly mode: M;
|
package/gradients.d.ts
CHANGED
|
@@ -9,7 +9,8 @@ import type { GradientOpts } from "./api/gradients.js";
|
|
|
9
9
|
* array of numbers will be returned.
|
|
10
10
|
*
|
|
11
11
|
* @remarks
|
|
12
|
-
*
|
|
12
|
+
* See
|
|
13
|
+
* [`tween()`](https://docs.thi.ng/umbrella/transducers/functions/tween.html)
|
|
13
14
|
*
|
|
14
15
|
* @example
|
|
15
16
|
* ```ts
|
package/linear.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Maps a single linear RGB channel value to sRGB.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* https://en.wikipedia.org/wiki/SRGB
|
|
5
5
|
*
|
|
6
6
|
* @param x - channel value
|
|
7
7
|
*/
|
|
@@ -9,7 +9,7 @@ export declare const linearSrgb: (x: number) => number;
|
|
|
9
9
|
/**
|
|
10
10
|
* Maps a single linear sRGB channel value to linear RGB.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
12
|
+
* https://en.wikipedia.org/wiki/SRGB
|
|
13
13
|
*
|
|
14
14
|
* @param x - channel value
|
|
15
15
|
*/
|
package/linear.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Maps a single linear RGB channel value to sRGB.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* https://en.wikipedia.org/wiki/SRGB
|
|
5
5
|
*
|
|
6
6
|
* @param x - channel value
|
|
7
7
|
*/
|
|
@@ -9,7 +9,7 @@ export const linearSrgb = (x) => x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x
|
|
|
9
9
|
/**
|
|
10
10
|
* Maps a single linear sRGB channel value to linear RGB.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
12
|
+
* https://en.wikipedia.org/wiki/SRGB
|
|
13
13
|
*
|
|
14
14
|
* @param x - channel value
|
|
15
15
|
*/
|
package/mix.d.ts
CHANGED
|
@@ -48,8 +48,8 @@ export declare const mixNNNN: ColorMixFn;
|
|
|
48
48
|
* Any hue channel will always be interpolated using the smallest angle
|
|
49
49
|
* difference (using {@link mixH}).
|
|
50
50
|
*
|
|
51
|
-
* The
|
|
52
|
-
* non-linear interpolations. For example:
|
|
51
|
+
* The [thi.ng/math](https://thi.ng/thi.ng/math) package provides various easing
|
|
52
|
+
* functions to create non-linear interpolations. For example:
|
|
53
53
|
*
|
|
54
54
|
* @example
|
|
55
55
|
* ```ts
|
package/mix.js
CHANGED
|
@@ -63,8 +63,8 @@ export const mixNNNN = mixN4;
|
|
|
63
63
|
* Any hue channel will always be interpolated using the smallest angle
|
|
64
64
|
* difference (using {@link mixH}).
|
|
65
65
|
*
|
|
66
|
-
* The
|
|
67
|
-
* non-linear interpolations. For example:
|
|
66
|
+
* The [thi.ng/math](https://thi.ng/thi.ng/math) package provides various easing
|
|
67
|
+
* functions to create non-linear interpolations. For example:
|
|
68
68
|
*
|
|
69
69
|
* @example
|
|
70
70
|
* ```ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/color",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.14",
|
|
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",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"url": "https://patreon.com/thing_umbrella"
|
|
22
22
|
}
|
|
23
23
|
],
|
|
24
|
-
"author": "Karsten Schmidt
|
|
24
|
+
"author": "Karsten Schmidt (https://thi.ng)",
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "yarn clean && tsc --declaration",
|
|
@@ -36,27 +36,27 @@
|
|
|
36
36
|
"tool:swatches": "tools:node-esm tools/index.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@thi.ng/api": "^8.
|
|
40
|
-
"@thi.ng/arrays": "^2.4.
|
|
41
|
-
"@thi.ng/binary": "^3.3.
|
|
42
|
-
"@thi.ng/checks": "^3.3.
|
|
43
|
-
"@thi.ng/compare": "^2.1.
|
|
44
|
-
"@thi.ng/compose": "^2.1.
|
|
45
|
-
"@thi.ng/defmulti": "^2.1.
|
|
46
|
-
"@thi.ng/errors": "^2.2.
|
|
47
|
-
"@thi.ng/math": "^5.3.
|
|
48
|
-
"@thi.ng/random": "^3.3.
|
|
49
|
-
"@thi.ng/strings": "^3.3.
|
|
50
|
-
"@thi.ng/transducers": "^8.3.
|
|
51
|
-
"@thi.ng/vectors": "^7.5.
|
|
39
|
+
"@thi.ng/api": "^8.6.1",
|
|
40
|
+
"@thi.ng/arrays": "^2.4.6",
|
|
41
|
+
"@thi.ng/binary": "^3.3.14",
|
|
42
|
+
"@thi.ng/checks": "^3.3.5",
|
|
43
|
+
"@thi.ng/compare": "^2.1.20",
|
|
44
|
+
"@thi.ng/compose": "^2.1.22",
|
|
45
|
+
"@thi.ng/defmulti": "^2.1.25",
|
|
46
|
+
"@thi.ng/errors": "^2.2.6",
|
|
47
|
+
"@thi.ng/math": "^5.3.17",
|
|
48
|
+
"@thi.ng/random": "^3.3.19",
|
|
49
|
+
"@thi.ng/strings": "^3.3.21",
|
|
50
|
+
"@thi.ng/transducers": "^8.3.27",
|
|
51
|
+
"@thi.ng/vectors": "^7.5.28"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@microsoft/api-extractor": "^7.33.
|
|
55
|
-
"@thi.ng/testament": "^0.3.
|
|
54
|
+
"@microsoft/api-extractor": "^7.33.7",
|
|
55
|
+
"@thi.ng/testament": "^0.3.7",
|
|
56
56
|
"rimraf": "^3.0.2",
|
|
57
57
|
"tools": "^0.0.1",
|
|
58
|
-
"typedoc": "^0.23.
|
|
59
|
-
"typescript": "^4.
|
|
58
|
+
"typedoc": "^0.23.22",
|
|
59
|
+
"typescript": "^4.9.4"
|
|
60
60
|
},
|
|
61
61
|
"keywords": [
|
|
62
62
|
"color",
|
|
@@ -424,5 +424,5 @@
|
|
|
424
424
|
"vectors"
|
|
425
425
|
]
|
|
426
426
|
},
|
|
427
|
-
"gitHead": "
|
|
427
|
+
"gitHead": "7b2af448da8a63fb21704a79cc4cdf1f3d7d7a64\n"
|
|
428
428
|
}
|
package/rgb/kelvin-rgba.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { SRGB } from "../srgb/srgb.js";
|
|
2
2
|
/**
|
|
3
|
+
* @remarks
|
|
3
4
|
* Based on:
|
|
4
|
-
* -
|
|
5
|
-
* -
|
|
5
|
+
* - https://github.com/neilbartlett/color-temperature/blob/develop/index.js
|
|
6
|
+
* - http://www.zombieprototypes.com/?p=210
|
|
6
7
|
*
|
|
7
8
|
* Uses adjusted coefficients to produce normalized sRGB values.
|
|
8
9
|
*
|
package/rgb/kelvin-rgba.js
CHANGED
|
@@ -14,9 +14,10 @@ const B1 = -0.9990954974165059;
|
|
|
14
14
|
const B2 = 0.0032447435545127036;
|
|
15
15
|
const B3 = 0.453646839257496;
|
|
16
16
|
/**
|
|
17
|
+
* @remarks
|
|
17
18
|
* Based on:
|
|
18
|
-
* -
|
|
19
|
-
* -
|
|
19
|
+
* - https://github.com/neilbartlett/color-temperature/blob/develop/index.js
|
|
20
|
+
* - http://www.zombieprototypes.com/?p=210
|
|
20
21
|
*
|
|
21
22
|
* Uses adjusted coefficients to produce normalized sRGB values.
|
|
22
23
|
*
|
package/rgb/rgb-hcv.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ColorOp } from "../api.js";
|
|
2
2
|
/**
|
|
3
3
|
* Based on:
|
|
4
|
-
*
|
|
4
|
+
* https://github.com/tobspr/GLSL-Color-Spaces/blob/develop/ColorSpaces.inc.glsl#L159
|
|
5
5
|
*
|
|
6
6
|
* @param out - result
|
|
7
7
|
* @param src - source color
|
package/rgb/rgb-hcv.js
CHANGED
|
@@ -4,7 +4,7 @@ import { setC3 } from "@thi.ng/vectors/setc";
|
|
|
4
4
|
import { clamp } from "../clamp.js";
|
|
5
5
|
/**
|
|
6
6
|
* Based on:
|
|
7
|
-
*
|
|
7
|
+
* https://github.com/tobspr/GLSL-Color-Spaces/blob/develop/ColorSpaces.inc.glsl#L159
|
|
8
8
|
*
|
|
9
9
|
* @param out - result
|
|
10
10
|
* @param src - source color
|
package/rgb/rgb-hcy.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ColorOp } from "../api.js";
|
|
2
2
|
/**
|
|
3
3
|
* Ported from:
|
|
4
|
-
*
|
|
4
|
+
* https://github.com/tobspr/GLSL-Color-Spaces/blob/develop/ColorSpaces.inc.glsl#L226
|
|
5
5
|
*
|
|
6
6
|
* @param out - result
|
|
7
7
|
* @param src - source color
|
package/rgb/rgb-hcy.js
CHANGED
|
@@ -4,7 +4,7 @@ import { hueRgb } from "./hue-rgb.js";
|
|
|
4
4
|
import { rgbHcv } from "./rgb-hcv.js";
|
|
5
5
|
/**
|
|
6
6
|
* Ported from:
|
|
7
|
-
*
|
|
7
|
+
* https://github.com/tobspr/GLSL-Color-Spaces/blob/develop/ColorSpaces.inc.glsl#L226
|
|
8
8
|
*
|
|
9
9
|
* @param out - result
|
|
10
10
|
* @param src - source color
|
package/rgb/rgb-xyz.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { Color, ColorOp, ReadonlyColor } from "../api.js";
|
|
|
3
3
|
* Converts RGB to XYZ using provided transformation matrix (default:
|
|
4
4
|
* {@link RGB_XYZ_D50}).
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* https://en.wikipedia.org/wiki/CIE_1931_color_space
|
|
7
7
|
*
|
|
8
8
|
* @param out - result
|
|
9
9
|
* @param src - source color
|
package/rgb/rgb-xyz.js
CHANGED
|
@@ -5,7 +5,7 @@ import { __mulV33 } from "../internal/matrix-ops.js";
|
|
|
5
5
|
* Converts RGB to XYZ using provided transformation matrix (default:
|
|
6
6
|
* {@link RGB_XYZ_D50}).
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* https://en.wikipedia.org/wiki/CIE_1931_color_space
|
|
9
9
|
*
|
|
10
10
|
* @param out - result
|
|
11
11
|
* @param src - source color
|
package/xyz/xyz-rgb.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { Color, ColorOp, ReadonlyColor } from "../api.js";
|
|
|
3
3
|
* Converts CIE XYZ to RGB using provided transformation/whitepoint matrix
|
|
4
4
|
* (default: {@link XYZ_RGB_D50}).
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* https://en.wikipedia.org/wiki/CIE_1931_color_space
|
|
7
7
|
*
|
|
8
8
|
* @param out - result
|
|
9
9
|
* @param src - source color
|
package/xyz/xyz-rgb.js
CHANGED
|
@@ -4,7 +4,7 @@ import { __mulV33 } from "../internal/matrix-ops.js";
|
|
|
4
4
|
* Converts CIE XYZ to RGB using provided transformation/whitepoint matrix
|
|
5
5
|
* (default: {@link XYZ_RGB_D50}).
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* https://en.wikipedia.org/wiki/CIE_1931_color_space
|
|
8
8
|
*
|
|
9
9
|
* @param out - result
|
|
10
10
|
* @param src - source color
|