chromonym 1.0.1 → 1.2.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/NOTICE.md +39 -0
- package/README.md +240 -3
- package/dist/colorspaces/index.d.ts +4 -0
- package/dist/colorspaces/index.d.ts.map +1 -0
- package/dist/colorspaces/index.js +4 -0
- package/dist/colorspaces/index.js.map +1 -0
- package/dist/colorspaces/pantone.d.ts +919 -0
- package/dist/colorspaces/pantone.d.ts.map +1 -0
- package/dist/colorspaces/pantone.js +918 -0
- package/dist/colorspaces/pantone.js.map +1 -0
- package/dist/colorspaces/registry.d.ts +26 -0
- package/dist/colorspaces/registry.d.ts.map +1 -0
- package/dist/colorspaces/registry.js +36 -0
- package/dist/colorspaces/registry.js.map +1 -0
- package/dist/colorspaces/web.d.ts +156 -0
- package/dist/colorspaces/web.d.ts.map +1 -0
- package/dist/colorspaces/web.js +155 -0
- package/dist/colorspaces/web.js.map +1 -0
- package/dist/colorspaces/x11.d.ts +667 -0
- package/dist/colorspaces/x11.d.ts.map +1 -0
- package/dist/colorspaces/x11.js +666 -0
- package/dist/colorspaces/x11.js.map +1 -0
- package/dist/conversions/hex.d.ts +13 -0
- package/dist/conversions/hex.d.ts.map +1 -0
- package/dist/conversions/hex.js +40 -0
- package/dist/conversions/hex.js.map +1 -0
- package/dist/conversions/hsl.d.ts +12 -0
- package/dist/conversions/hsl.d.ts.map +1 -0
- package/dist/conversions/hsl.js +72 -0
- package/dist/conversions/hsl.js.map +1 -0
- package/dist/conversions/hsv.d.ts +12 -0
- package/dist/conversions/hsv.d.ts.map +1 -0
- package/dist/conversions/hsv.js +67 -0
- package/dist/conversions/hsv.js.map +1 -0
- package/dist/conversions/index.d.ts +6 -0
- package/dist/conversions/index.d.ts.map +1 -0
- package/dist/conversions/index.js +6 -0
- package/dist/conversions/index.js.map +1 -0
- package/dist/conversions/pantone.d.ts +17 -0
- package/dist/conversions/pantone.d.ts.map +1 -0
- package/dist/conversions/pantone.js +27 -0
- package/dist/conversions/pantone.js.map +1 -0
- package/dist/conversions/rgb.d.ts +15 -0
- package/dist/conversions/rgb.d.ts.map +1 -0
- package/dist/conversions/rgb.js +57 -0
- package/dist/conversions/rgb.js.map +1 -0
- package/dist/convert.d.ts +21 -0
- package/dist/convert.d.ts.map +1 -0
- package/dist/convert.js +69 -0
- package/dist/convert.js.map +1 -0
- package/dist/detectFormat.d.ts +17 -0
- package/dist/detectFormat.d.ts.map +1 -0
- package/dist/detectFormat.js +59 -0
- package/dist/detectFormat.js.map +1 -0
- package/dist/identify.d.ts +20 -0
- package/dist/identify.d.ts.map +1 -0
- package/dist/identify.js +29 -0
- package/dist/identify.js.map +1 -0
- package/dist/index.d.ts +14 -337
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -267
- package/dist/index.js.map +1 -1
- package/dist/indexing.d.ts +44 -0
- package/dist/indexing.d.ts.map +1 -0
- package/dist/indexing.js +140 -0
- package/dist/indexing.js.map +1 -0
- package/dist/math/clamp.d.ts +11 -0
- package/dist/math/clamp.d.ts.map +1 -0
- package/dist/math/clamp.js +18 -0
- package/dist/math/clamp.js.map +1 -0
- package/dist/math/colorSpace.d.ts +39 -0
- package/dist/math/colorSpace.d.ts.map +1 -0
- package/dist/math/colorSpace.js +85 -0
- package/dist/math/colorSpace.js.map +1 -0
- package/dist/math/deltaE.d.ts +47 -0
- package/dist/math/deltaE.d.ts.map +1 -0
- package/dist/math/deltaE.js +185 -0
- package/dist/math/deltaE.js.map +1 -0
- package/dist/math/euclideanDistance.d.ts +16 -0
- package/dist/math/euclideanDistance.d.ts.map +1 -0
- package/dist/math/euclideanDistance.js +22 -0
- package/dist/math/euclideanDistance.js.map +1 -0
- package/dist/math/hueSector.d.ts +15 -0
- package/dist/math/hueSector.d.ts.map +1 -0
- package/dist/math/hueSector.js +27 -0
- package/dist/math/hueSector.js.map +1 -0
- package/dist/resolve.d.ts +14 -0
- package/dist/resolve.d.ts.map +1 -0
- package/dist/resolve.js +26 -0
- package/dist/resolve.js.map +1 -0
- package/dist/types.d.ts +43 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/package.json +69 -5
package/dist/identify.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { COLORSPACE_NAMES, COLORSPACES, DEFAULT_METRICS } from './colorspaces/registry';
|
|
2
|
+
import { toRgba } from './convert';
|
|
3
|
+
import { detectFormat } from './detectFormat';
|
|
4
|
+
import { nearest } from './indexing';
|
|
5
|
+
/**
|
|
6
|
+
* Identify the nearest-named color for any color input.
|
|
7
|
+
*
|
|
8
|
+
* The distance metric defaults to the colorspace's recommended choice
|
|
9
|
+
* (web/x11: `deltaE76`, pantone: `deltaE2000`). Override with the `metric`
|
|
10
|
+
* option — e.g. `{ metric: 'euclidean-srgb' }` for maximum speed, or
|
|
11
|
+
* `{ metric: 'deltaE2000' }` for strictest perceptual accuracy.
|
|
12
|
+
*
|
|
13
|
+
* Returns `null` if the input isn't a recognized color shape or the
|
|
14
|
+
* colorspace name isn't one of `web` / `x11` / `pantone`.
|
|
15
|
+
*
|
|
16
|
+
* Defaults: colorspace = 'web', metric = DEFAULT_METRICS[colorspace].
|
|
17
|
+
*/
|
|
18
|
+
export function identify(input, opts = {}) {
|
|
19
|
+
const format = detectFormat(input);
|
|
20
|
+
if (format === 'UNKNOWN')
|
|
21
|
+
return null;
|
|
22
|
+
const { colorspace = 'web', metric } = opts;
|
|
23
|
+
if (!COLORSPACE_NAMES.has(colorspace))
|
|
24
|
+
return null;
|
|
25
|
+
const rgba = toRgba(input, format);
|
|
26
|
+
const name = nearest(rgba, COLORSPACES[colorspace], metric ?? DEFAULT_METRICS[colorspace]);
|
|
27
|
+
return name || null;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=identify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identify.js","sourceRoot":"","sources":["../src/identify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACxF,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrC;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,QAAQ,CACtB,KAAmC,EACnC,IAAI,GAA6D,EAAE;IAEnE,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACnC,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAEtC,MAAM,EAAE,UAAU,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC5C,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,UAAU,CAAC;QAAE,OAAO,IAAI,CAAC;IAEnD,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACnC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,UAAU,CAAC,EAAE,MAAM,IAAI,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC;IAC3F,OAAO,IAAI,IAAI,IAAI,CAAC;AACtB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,338 +1,15 @@
|
|
|
1
|
-
export type
|
|
2
|
-
export type
|
|
3
|
-
export type
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
export
|
|
10
|
-
export type
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
readonly green: readonly ["rgb(124,252,0)", "rgb(127,255,0)", "rgb(50,205,50)", "rgb(0,255,0)", "rgb(34,139,34)", "rgb(0,128,0)", "rgb(0,100,0)", "rgb(173,255,47)", "rgb(154,205,50)", "rgb(0,255,127)", "rgb(0,250,154)", "rgb(144,238,144)", "rgb(152,251,152)", "rgb(143,188,143)", "rgb(60,179,113)", "rgb(46,139,87)", "rgb(128,128,0)", "rgb(85,107,47)", "rgb(107,142,35)", "rgb(2,166,165)", "rgb(13,125,126)"];
|
|
16
|
-
readonly blue: readonly ["rgb(0,0,102)", "rgb(0,0,153)", "rgb(0,0,255)", "rgb(51,51,255)", "rgb(102,102,255)", "rgb(0,51,102)", "rgb(0,76,153)", "rgb(0,102,204)", "rgb(0,128,255)", "rgb(51,153,255)", "rgb(102,178,255)", "rgb(0,204,204)", "rgb(0,255,255)", "rgb(51,255,255)", "rgb(153,255,255)", "rgb(204,229,255)", "rgb(196,218,242)"];
|
|
17
|
-
readonly white: readonly ["rgb(255,255,255)", "rgb(255,250,250)", "rgb(240,255,240)", "rgb(245,255,250)", "rgb(255,255,240)", "rgb(196,222,237)", "rgb(254,249,191)", "rgb(169,199,209)"];
|
|
18
|
-
readonly pink: readonly ["rgb(51,0,51)", "rgb(102,0,102)", "rgb(153,0,153)", "rgb(204,0,204)", "rgb(255,0,255)", "rgb(255,51,255)", "rgb(255,102,255)", "rgb(255,153,255)", "rgb(255,204,255)", "rgb(251,140,173)", "rgb(211,78,125)"];
|
|
19
|
-
readonly black: readonly ["rgb(0,0,0)", "rgb(32,32,32)"];
|
|
20
|
-
readonly grey: readonly ["rgb(64,64,64)", "rgb(96,96,96)", "rgb(128,128,128)", "rgb(160,160,160)", "rgb(192,192,192)"];
|
|
21
|
-
readonly purple: readonly ["rgb(51,0,102)", "rgb(76,0,153)", "rgb(102,0,204)", "rgb(127,0,255)", "rgb(153,51,255)", "rgb(178,102,255)", "rgb(204,153,255)"];
|
|
22
|
-
};
|
|
23
|
-
export type ColorGroupName = keyof typeof colorGroups;
|
|
24
|
-
export declare const cssColorList: {
|
|
25
|
-
readonly aliceblue: '#f0f8ff';
|
|
26
|
-
readonly antiquewhite: '#faebd7';
|
|
27
|
-
readonly aqua: '#00ffff';
|
|
28
|
-
readonly aquamarine: '#7fffd4';
|
|
29
|
-
readonly azure: '#f0ffff';
|
|
30
|
-
readonly beige: '#f5f5dc';
|
|
31
|
-
readonly bisque: '#ffe4c4';
|
|
32
|
-
readonly black: '#000000';
|
|
33
|
-
readonly blanchedalmond: '#ffebcd';
|
|
34
|
-
readonly blue: '#0000ff';
|
|
35
|
-
readonly blueviolet: '#8a2be2';
|
|
36
|
-
readonly brown: '#a52a2a';
|
|
37
|
-
readonly burlywood: '#deb887';
|
|
38
|
-
readonly cadetblue: '#5f9ea0';
|
|
39
|
-
readonly chartreuse: '#7fff00';
|
|
40
|
-
readonly chocolate: '#d2691e';
|
|
41
|
-
readonly coral: '#ff7f50';
|
|
42
|
-
readonly cornflowerblue: '#6495ed';
|
|
43
|
-
readonly cornsilk: '#fff8dc';
|
|
44
|
-
readonly crimson: '#dc143c';
|
|
45
|
-
readonly cyan: '#00ffff';
|
|
46
|
-
readonly darkblue: '#00008b';
|
|
47
|
-
readonly darkcyan: '#008b8b';
|
|
48
|
-
readonly darkgoldenrod: '#b8860b';
|
|
49
|
-
readonly darkgray: '#a9a9a9';
|
|
50
|
-
readonly darkgreen: '#006400';
|
|
51
|
-
readonly darkgrey: '#a9a9a9';
|
|
52
|
-
readonly darkkhaki: '#bdb76b';
|
|
53
|
-
readonly darkmagenta: '#8b008b';
|
|
54
|
-
readonly darkolivegreen: '#556b2f';
|
|
55
|
-
readonly darkorange: '#ff8c00';
|
|
56
|
-
readonly darkorchid: '#9932cc';
|
|
57
|
-
readonly darkred: '#8b0000';
|
|
58
|
-
readonly darksalmon: '#e9967a';
|
|
59
|
-
readonly darkseagreen: '#8fbc8f';
|
|
60
|
-
readonly darkslateblue: '#483d8b';
|
|
61
|
-
readonly darkslategray: '#2f4f4f';
|
|
62
|
-
readonly darkslategrey: '#2f4f4f';
|
|
63
|
-
readonly darkturquoise: '#00ced1';
|
|
64
|
-
readonly darkviolet: '#9400d3';
|
|
65
|
-
readonly deeppink: '#ff1493';
|
|
66
|
-
readonly deepskyblue: '#00bfff';
|
|
67
|
-
readonly dimgray: '#696969';
|
|
68
|
-
readonly dimgrey: '#696969';
|
|
69
|
-
readonly dodgerblue: '#1e90ff';
|
|
70
|
-
readonly firebrick: '#b22222';
|
|
71
|
-
readonly floralwhite: '#fffaf0';
|
|
72
|
-
readonly forestgreen: '#228b22';
|
|
73
|
-
readonly fuchsia: '#ff00ff';
|
|
74
|
-
readonly gainsboro: '#dcdcdc';
|
|
75
|
-
readonly ghostwhite: '#f8f8ff';
|
|
76
|
-
readonly goldenrod: '#daa520';
|
|
77
|
-
readonly gold: '#ffd700';
|
|
78
|
-
readonly gray: '#808080';
|
|
79
|
-
readonly green: '#008000';
|
|
80
|
-
readonly greenyellow: '#adff2f';
|
|
81
|
-
readonly grey: '#808080';
|
|
82
|
-
readonly honeydew: '#f0fff0';
|
|
83
|
-
readonly hotpink: '#ff69b4';
|
|
84
|
-
readonly indianred: '#cd5c5c';
|
|
85
|
-
readonly indigo: '#4b0082';
|
|
86
|
-
readonly ivory: '#fffff0';
|
|
87
|
-
readonly khaki: '#f0e68c';
|
|
88
|
-
readonly lavenderblush: '#fff0f5';
|
|
89
|
-
readonly lavender: '#e6e6fa';
|
|
90
|
-
readonly lawngreen: '#7cfc00';
|
|
91
|
-
readonly lemonchiffon: '#fffacd';
|
|
92
|
-
readonly lightblue: '#add8e6';
|
|
93
|
-
readonly lightcoral: '#f08080';
|
|
94
|
-
readonly lightcyan: '#e0ffff';
|
|
95
|
-
readonly lightgoldenrodyellow: '#fafad2';
|
|
96
|
-
readonly lightgray: '#d3d3d3';
|
|
97
|
-
readonly lightgreen: '#90ee90';
|
|
98
|
-
readonly lightgrey: '#d3d3d3';
|
|
99
|
-
readonly lightpink: '#ffb6c1';
|
|
100
|
-
readonly lightsalmon: '#ffa07a';
|
|
101
|
-
readonly lightseagreen: '#20b2aa';
|
|
102
|
-
readonly lightskyblue: '#87cefa';
|
|
103
|
-
readonly lightslategray: '#778899';
|
|
104
|
-
readonly lightslategrey: '#778899';
|
|
105
|
-
readonly lightsteelblue: '#b0c4de';
|
|
106
|
-
readonly lightyellow: '#ffffe0';
|
|
107
|
-
readonly lime: '#00ff00';
|
|
108
|
-
readonly limegreen: '#32cd32';
|
|
109
|
-
readonly linen: '#faf0e6';
|
|
110
|
-
readonly magenta: '#ff00ff';
|
|
111
|
-
readonly maroon: '#800000';
|
|
112
|
-
readonly mediumaquamarine: '#66cdaa';
|
|
113
|
-
readonly mediumblue: '#0000cd';
|
|
114
|
-
readonly mediumorchid: '#ba55d3';
|
|
115
|
-
readonly mediumpurple: '#9370db';
|
|
116
|
-
readonly mediumseagreen: '#3cb371';
|
|
117
|
-
readonly mediumslateblue: '#7b68ee';
|
|
118
|
-
readonly mediumspringgreen: '#00fa9a';
|
|
119
|
-
readonly mediumturquoise: '#48d1cc';
|
|
120
|
-
readonly mediumvioletred: '#c71585';
|
|
121
|
-
readonly midnightblue: '#191970';
|
|
122
|
-
readonly mintcream: '#f5fffa';
|
|
123
|
-
readonly mistyrose: '#ffe4e1';
|
|
124
|
-
readonly moccasin: '#ffe4b5';
|
|
125
|
-
readonly navajowhite: '#ffdead';
|
|
126
|
-
readonly navy: '#000080';
|
|
127
|
-
readonly oldlace: '#fdf5e6';
|
|
128
|
-
readonly olive: '#808000';
|
|
129
|
-
readonly olivedrab: '#6b8e23';
|
|
130
|
-
readonly orange: '#ffa500';
|
|
131
|
-
readonly orangered: '#ff4500';
|
|
132
|
-
readonly orchid: '#da70d6';
|
|
133
|
-
readonly palegoldenrod: '#eee8aa';
|
|
134
|
-
readonly palegreen: '#98fb98';
|
|
135
|
-
readonly paleturquoise: '#afeeee';
|
|
136
|
-
readonly palevioletred: '#db7093';
|
|
137
|
-
readonly papayawhip: '#ffefd5';
|
|
138
|
-
readonly peachpuff: '#ffdab9';
|
|
139
|
-
readonly peru: '#cd853f';
|
|
140
|
-
readonly pink: '#ffc0cb';
|
|
141
|
-
readonly plum: '#dda0dd';
|
|
142
|
-
readonly powderblue: '#b0e0e6';
|
|
143
|
-
readonly purple: '#800080';
|
|
144
|
-
readonly rebeccapurple: '#663399';
|
|
145
|
-
readonly red: '#ff0000';
|
|
146
|
-
readonly rosybrown: '#bc8f8f';
|
|
147
|
-
readonly royalblue: '#4169e1';
|
|
148
|
-
readonly saddlebrown: '#8b4513';
|
|
149
|
-
readonly salmon: '#fa8072';
|
|
150
|
-
readonly sandybrown: '#f4a460';
|
|
151
|
-
readonly seagreen: '#2e8b57';
|
|
152
|
-
readonly seashell: '#fff5ee';
|
|
153
|
-
readonly sienna: '#a0522d';
|
|
154
|
-
readonly silver: '#c0c0c0';
|
|
155
|
-
readonly skyblue: '#87ceeb';
|
|
156
|
-
readonly slateblue: '#6a5acd';
|
|
157
|
-
readonly slategray: '#708090';
|
|
158
|
-
readonly slategrey: '#708090';
|
|
159
|
-
readonly snow: '#fffafa';
|
|
160
|
-
readonly springgreen: '#00ff7f';
|
|
161
|
-
readonly steelblue: '#4682b4';
|
|
162
|
-
readonly tan: '#d2b48c';
|
|
163
|
-
readonly teal: '#008080';
|
|
164
|
-
readonly thistle: '#d8bfd8';
|
|
165
|
-
readonly tomato: '#ff6347';
|
|
166
|
-
readonly turquoise: '#40e0d0';
|
|
167
|
-
readonly violet: '#ee82ee';
|
|
168
|
-
readonly wheat: '#f5deb3';
|
|
169
|
-
readonly white: '#ffffff';
|
|
170
|
-
readonly whitesmoke: '#f5f5f5';
|
|
171
|
-
readonly yellow: '#ffff00';
|
|
172
|
-
readonly yellowgreen: '#9acd32';
|
|
173
|
-
};
|
|
174
|
-
export type CssColorName = keyof typeof cssColorList;
|
|
175
|
-
export declare const colors: {
|
|
176
|
-
readonly red: readonly ["rgb(102,0,0)", "rgb(153,0,0)", "rgb(204,0,0)", "rgb(255,0,0)", "rgb(255,51,51)", "rgb(255,102,102)", "rgb(255,153,153)"];
|
|
177
|
-
readonly orange: readonly ["rgb(102,51,0)", "rgb(153,76,0)", "rgb(204,102,0)", "rgb(255,128,0)", "rgb(255,153,51)", "rgb(255,178,102)", "rgb(255,204,153)"];
|
|
178
|
-
readonly yellow: readonly ["rgb(102,102,0)", "rgb(153,153,0)", "rgb(204,204,0)", "rgb(255,255,0)", "rgb(255,255,51)", "rgb(255,255,102)", "rgb(255,255,153)", "rgb(255,255,204)"];
|
|
179
|
-
readonly green: readonly ["rgb(124,252,0)", "rgb(127,255,0)", "rgb(50,205,50)", "rgb(0,255,0)", "rgb(34,139,34)", "rgb(0,128,0)", "rgb(0,100,0)", "rgb(173,255,47)", "rgb(154,205,50)", "rgb(0,255,127)", "rgb(0,250,154)", "rgb(144,238,144)", "rgb(152,251,152)", "rgb(143,188,143)", "rgb(60,179,113)", "rgb(46,139,87)", "rgb(128,128,0)", "rgb(85,107,47)", "rgb(107,142,35)", "rgb(2,166,165)", "rgb(13,125,126)"];
|
|
180
|
-
readonly blue: readonly ["rgb(0,0,102)", "rgb(0,0,153)", "rgb(0,0,255)", "rgb(51,51,255)", "rgb(102,102,255)", "rgb(0,51,102)", "rgb(0,76,153)", "rgb(0,102,204)", "rgb(0,128,255)", "rgb(51,153,255)", "rgb(102,178,255)", "rgb(0,204,204)", "rgb(0,255,255)", "rgb(51,255,255)", "rgb(153,255,255)", "rgb(204,229,255)", "rgb(196,218,242)"];
|
|
181
|
-
readonly white: readonly ["rgb(255,255,255)", "rgb(255,250,250)", "rgb(240,255,240)", "rgb(245,255,250)", "rgb(255,255,240)", "rgb(196,222,237)", "rgb(254,249,191)", "rgb(169,199,209)"];
|
|
182
|
-
readonly pink: readonly ["rgb(51,0,51)", "rgb(102,0,102)", "rgb(153,0,153)", "rgb(204,0,204)", "rgb(255,0,255)", "rgb(255,51,255)", "rgb(255,102,255)", "rgb(255,153,255)", "rgb(255,204,255)", "rgb(251,140,173)", "rgb(211,78,125)"];
|
|
183
|
-
readonly black: readonly ["rgb(0,0,0)", "rgb(32,32,32)"];
|
|
184
|
-
readonly grey: readonly ["rgb(64,64,64)", "rgb(96,96,96)", "rgb(128,128,128)", "rgb(160,160,160)", "rgb(192,192,192)"];
|
|
185
|
-
readonly purple: readonly ["rgb(51,0,102)", "rgb(76,0,153)", "rgb(102,0,204)", "rgb(127,0,255)", "rgb(153,51,255)", "rgb(178,102,255)", "rgb(204,153,255)"];
|
|
186
|
-
readonly cssColorList: {
|
|
187
|
-
readonly aliceblue: '#f0f8ff';
|
|
188
|
-
readonly antiquewhite: '#faebd7';
|
|
189
|
-
readonly aqua: '#00ffff';
|
|
190
|
-
readonly aquamarine: '#7fffd4';
|
|
191
|
-
readonly azure: '#f0ffff';
|
|
192
|
-
readonly beige: '#f5f5dc';
|
|
193
|
-
readonly bisque: '#ffe4c4';
|
|
194
|
-
readonly black: '#000000';
|
|
195
|
-
readonly blanchedalmond: '#ffebcd';
|
|
196
|
-
readonly blue: '#0000ff';
|
|
197
|
-
readonly blueviolet: '#8a2be2';
|
|
198
|
-
readonly brown: '#a52a2a';
|
|
199
|
-
readonly burlywood: '#deb887';
|
|
200
|
-
readonly cadetblue: '#5f9ea0';
|
|
201
|
-
readonly chartreuse: '#7fff00';
|
|
202
|
-
readonly chocolate: '#d2691e';
|
|
203
|
-
readonly coral: '#ff7f50';
|
|
204
|
-
readonly cornflowerblue: '#6495ed';
|
|
205
|
-
readonly cornsilk: '#fff8dc';
|
|
206
|
-
readonly crimson: '#dc143c';
|
|
207
|
-
readonly cyan: '#00ffff';
|
|
208
|
-
readonly darkblue: '#00008b';
|
|
209
|
-
readonly darkcyan: '#008b8b';
|
|
210
|
-
readonly darkgoldenrod: '#b8860b';
|
|
211
|
-
readonly darkgray: '#a9a9a9';
|
|
212
|
-
readonly darkgreen: '#006400';
|
|
213
|
-
readonly darkgrey: '#a9a9a9';
|
|
214
|
-
readonly darkkhaki: '#bdb76b';
|
|
215
|
-
readonly darkmagenta: '#8b008b';
|
|
216
|
-
readonly darkolivegreen: '#556b2f';
|
|
217
|
-
readonly darkorange: '#ff8c00';
|
|
218
|
-
readonly darkorchid: '#9932cc';
|
|
219
|
-
readonly darkred: '#8b0000';
|
|
220
|
-
readonly darksalmon: '#e9967a';
|
|
221
|
-
readonly darkseagreen: '#8fbc8f';
|
|
222
|
-
readonly darkslateblue: '#483d8b';
|
|
223
|
-
readonly darkslategray: '#2f4f4f';
|
|
224
|
-
readonly darkslategrey: '#2f4f4f';
|
|
225
|
-
readonly darkturquoise: '#00ced1';
|
|
226
|
-
readonly darkviolet: '#9400d3';
|
|
227
|
-
readonly deeppink: '#ff1493';
|
|
228
|
-
readonly deepskyblue: '#00bfff';
|
|
229
|
-
readonly dimgray: '#696969';
|
|
230
|
-
readonly dimgrey: '#696969';
|
|
231
|
-
readonly dodgerblue: '#1e90ff';
|
|
232
|
-
readonly firebrick: '#b22222';
|
|
233
|
-
readonly floralwhite: '#fffaf0';
|
|
234
|
-
readonly forestgreen: '#228b22';
|
|
235
|
-
readonly fuchsia: '#ff00ff';
|
|
236
|
-
readonly gainsboro: '#dcdcdc';
|
|
237
|
-
readonly ghostwhite: '#f8f8ff';
|
|
238
|
-
readonly goldenrod: '#daa520';
|
|
239
|
-
readonly gold: '#ffd700';
|
|
240
|
-
readonly gray: '#808080';
|
|
241
|
-
readonly green: '#008000';
|
|
242
|
-
readonly greenyellow: '#adff2f';
|
|
243
|
-
readonly grey: '#808080';
|
|
244
|
-
readonly honeydew: '#f0fff0';
|
|
245
|
-
readonly hotpink: '#ff69b4';
|
|
246
|
-
readonly indianred: '#cd5c5c';
|
|
247
|
-
readonly indigo: '#4b0082';
|
|
248
|
-
readonly ivory: '#fffff0';
|
|
249
|
-
readonly khaki: '#f0e68c';
|
|
250
|
-
readonly lavenderblush: '#fff0f5';
|
|
251
|
-
readonly lavender: '#e6e6fa';
|
|
252
|
-
readonly lawngreen: '#7cfc00';
|
|
253
|
-
readonly lemonchiffon: '#fffacd';
|
|
254
|
-
readonly lightblue: '#add8e6';
|
|
255
|
-
readonly lightcoral: '#f08080';
|
|
256
|
-
readonly lightcyan: '#e0ffff';
|
|
257
|
-
readonly lightgoldenrodyellow: '#fafad2';
|
|
258
|
-
readonly lightgray: '#d3d3d3';
|
|
259
|
-
readonly lightgreen: '#90ee90';
|
|
260
|
-
readonly lightgrey: '#d3d3d3';
|
|
261
|
-
readonly lightpink: '#ffb6c1';
|
|
262
|
-
readonly lightsalmon: '#ffa07a';
|
|
263
|
-
readonly lightseagreen: '#20b2aa';
|
|
264
|
-
readonly lightskyblue: '#87cefa';
|
|
265
|
-
readonly lightslategray: '#778899';
|
|
266
|
-
readonly lightslategrey: '#778899';
|
|
267
|
-
readonly lightsteelblue: '#b0c4de';
|
|
268
|
-
readonly lightyellow: '#ffffe0';
|
|
269
|
-
readonly lime: '#00ff00';
|
|
270
|
-
readonly limegreen: '#32cd32';
|
|
271
|
-
readonly linen: '#faf0e6';
|
|
272
|
-
readonly magenta: '#ff00ff';
|
|
273
|
-
readonly maroon: '#800000';
|
|
274
|
-
readonly mediumaquamarine: '#66cdaa';
|
|
275
|
-
readonly mediumblue: '#0000cd';
|
|
276
|
-
readonly mediumorchid: '#ba55d3';
|
|
277
|
-
readonly mediumpurple: '#9370db';
|
|
278
|
-
readonly mediumseagreen: '#3cb371';
|
|
279
|
-
readonly mediumslateblue: '#7b68ee';
|
|
280
|
-
readonly mediumspringgreen: '#00fa9a';
|
|
281
|
-
readonly mediumturquoise: '#48d1cc';
|
|
282
|
-
readonly mediumvioletred: '#c71585';
|
|
283
|
-
readonly midnightblue: '#191970';
|
|
284
|
-
readonly mintcream: '#f5fffa';
|
|
285
|
-
readonly mistyrose: '#ffe4e1';
|
|
286
|
-
readonly moccasin: '#ffe4b5';
|
|
287
|
-
readonly navajowhite: '#ffdead';
|
|
288
|
-
readonly navy: '#000080';
|
|
289
|
-
readonly oldlace: '#fdf5e6';
|
|
290
|
-
readonly olive: '#808000';
|
|
291
|
-
readonly olivedrab: '#6b8e23';
|
|
292
|
-
readonly orange: '#ffa500';
|
|
293
|
-
readonly orangered: '#ff4500';
|
|
294
|
-
readonly orchid: '#da70d6';
|
|
295
|
-
readonly palegoldenrod: '#eee8aa';
|
|
296
|
-
readonly palegreen: '#98fb98';
|
|
297
|
-
readonly paleturquoise: '#afeeee';
|
|
298
|
-
readonly palevioletred: '#db7093';
|
|
299
|
-
readonly papayawhip: '#ffefd5';
|
|
300
|
-
readonly peachpuff: '#ffdab9';
|
|
301
|
-
readonly peru: '#cd853f';
|
|
302
|
-
readonly pink: '#ffc0cb';
|
|
303
|
-
readonly plum: '#dda0dd';
|
|
304
|
-
readonly powderblue: '#b0e0e6';
|
|
305
|
-
readonly purple: '#800080';
|
|
306
|
-
readonly rebeccapurple: '#663399';
|
|
307
|
-
readonly red: '#ff0000';
|
|
308
|
-
readonly rosybrown: '#bc8f8f';
|
|
309
|
-
readonly royalblue: '#4169e1';
|
|
310
|
-
readonly saddlebrown: '#8b4513';
|
|
311
|
-
readonly salmon: '#fa8072';
|
|
312
|
-
readonly sandybrown: '#f4a460';
|
|
313
|
-
readonly seagreen: '#2e8b57';
|
|
314
|
-
readonly seashell: '#fff5ee';
|
|
315
|
-
readonly sienna: '#a0522d';
|
|
316
|
-
readonly silver: '#c0c0c0';
|
|
317
|
-
readonly skyblue: '#87ceeb';
|
|
318
|
-
readonly slateblue: '#6a5acd';
|
|
319
|
-
readonly slategray: '#708090';
|
|
320
|
-
readonly slategrey: '#708090';
|
|
321
|
-
readonly snow: '#fffafa';
|
|
322
|
-
readonly springgreen: '#00ff7f';
|
|
323
|
-
readonly steelblue: '#4682b4';
|
|
324
|
-
readonly tan: '#d2b48c';
|
|
325
|
-
readonly teal: '#008080';
|
|
326
|
-
readonly thistle: '#d8bfd8';
|
|
327
|
-
readonly tomato: '#ff6347';
|
|
328
|
-
readonly turquoise: '#40e0d0';
|
|
329
|
-
readonly violet: '#ee82ee';
|
|
330
|
-
readonly wheat: '#f5deb3';
|
|
331
|
-
readonly white: '#ffffff';
|
|
332
|
-
readonly whitesmoke: '#f5f5f5';
|
|
333
|
-
readonly yellow: '#ffff00';
|
|
334
|
-
readonly yellowgreen: '#9acd32';
|
|
335
|
-
};
|
|
336
|
-
};
|
|
337
|
-
export default colors;
|
|
1
|
+
export { type PantoneColorName, pantone } from './colorspaces/pantone';
|
|
2
|
+
export { type WebColorName, web } from './colorspaces/web';
|
|
3
|
+
export { type X11ColorName, x11 } from './colorspaces/x11';
|
|
4
|
+
export { hexToRgba, rgbaToHex } from './conversions/hex';
|
|
5
|
+
export { hslToRgba, rgbaToHsl } from './conversions/hsl';
|
|
6
|
+
export { hsvToRgba, rgbaToHsv } from './conversions/hsv';
|
|
7
|
+
export { pantoneToRgba, rgbaToPantone } from './conversions/pantone';
|
|
8
|
+
export { rgbaToRgb, rgbToRgba } from './conversions/rgb';
|
|
9
|
+
export { convert, fromRgba, toRgba } from './convert';
|
|
10
|
+
export { type DetectedFormat, detectFormat, isColor } from './detectFormat';
|
|
11
|
+
export { identify } from './identify';
|
|
12
|
+
export { resolve } from './resolve';
|
|
13
|
+
export type { ColorFormat, ColorInput, Colorspace, ColorspaceName, ColorValue, HexColor, HslInput, HslObject, HslString, HsvInput, HsvObject, HsvString, PantoneCode, Rgba, RgbaInput, RgbaString, RgbaTuple, RgbInput, RgbObject, RgbString, RgbTuple, } from './types';
|
|
14
|
+
export { COLOR_FORMATS } from './types';
|
|
338
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,gBAAgB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,KAAK,YAAY,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,KAAK,YAAY,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,KAAK,cAAc,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EACV,WAAW,EACX,UAAU,EACV,UAAU,EACV,cAAc,EACd,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,SAAS,EACT,QAAQ,EACR,SAAS,EACT,SAAS,EACT,WAAW,EACX,IAAI,EACJ,SAAS,EACT,UAAU,EACV,SAAS,EACT,QAAQ,EACR,SAAS,EACT,SAAS,EACT,QAAQ,GACT,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
|