@thi.ng/color 5.2.11 → 5.2.13
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 +8 -11
- package/api/gradients.d.ts +4 -4
- package/api/names.d.ts +1 -1
- package/api/ranges.d.ts +2 -2
- package/api.d.ts +9 -9
- package/defcolor.d.ts +1 -1
- package/package.json +20 -20
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,14 +594,11 @@ 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
|
-
Package sizes (
|
|
601
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 15.21 KB
|
|
605
602
|
|
|
606
603
|
## Dependencies
|
|
607
604
|
|
|
@@ -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/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
|
|
@@ -79,5 +79,5 @@ export interface ColorThemePart {
|
|
|
79
79
|
*/
|
|
80
80
|
weight?: number;
|
|
81
81
|
}
|
|
82
|
-
export
|
|
82
|
+
export type ColorThemePartTuple = [ColorRangePreset, CSSColorName, number?] | [ColorRangePreset | CSSColorName, number?] | ColorRangePreset | CSSColorName;
|
|
83
83
|
//# 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/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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/color",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.13",
|
|
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.0",
|
|
40
|
+
"@thi.ng/arrays": "^2.4.5",
|
|
41
|
+
"@thi.ng/binary": "^3.3.13",
|
|
42
|
+
"@thi.ng/checks": "^3.3.5",
|
|
43
|
+
"@thi.ng/compare": "^2.1.19",
|
|
44
|
+
"@thi.ng/compose": "^2.1.21",
|
|
45
|
+
"@thi.ng/defmulti": "^2.1.24",
|
|
46
|
+
"@thi.ng/errors": "^2.2.6",
|
|
47
|
+
"@thi.ng/math": "^5.3.16",
|
|
48
|
+
"@thi.ng/random": "^3.3.18",
|
|
49
|
+
"@thi.ng/strings": "^3.3.20",
|
|
50
|
+
"@thi.ng/transducers": "^8.3.26",
|
|
51
|
+
"@thi.ng/vectors": "^7.5.27"
|
|
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": "f445a9cc8022bcdebbf6ff91fd66ced016d72f01\n"
|
|
428
428
|
}
|