proto-tinker-wc 0.1.14 → 0.1.16

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.
Files changed (47) hide show
  1. package/dist/cjs/{app-globals-3a1e7e63.js → app-globals-V2Kpy_OQ.js} +2 -0
  2. package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
  3. package/dist/cjs/{index-613064fc.js → index-B_32VWMZ.js} +11 -32
  4. package/dist/cjs/index-B_32VWMZ.js.map +1 -0
  5. package/dist/cjs/index.cjs.js +2 -0
  6. package/dist/cjs/index.cjs.js.map +1 -0
  7. package/dist/cjs/loader.cjs.js +4 -4
  8. package/dist/cjs/loader.cjs.js.map +1 -0
  9. package/dist/cjs/proto-tinker-wc.cjs.js +8 -6
  10. package/dist/cjs/proto-tinker-wc.cjs.js.map +1 -0
  11. package/dist/cjs/proto-tinker.cjs.entry.js +1839 -1761
  12. package/dist/cjs/proto-tinker.cjs.entry.js.map +1 -0
  13. package/dist/collection/collection-manifest.json +1 -1
  14. package/dist/collection/styles/shadow.css +1 -1
  15. package/dist/collection/tokens.css +1 -1
  16. package/dist/collection/utils/tw-version.js +1 -1
  17. package/dist/components/proto-tinker.js +1836 -1758
  18. package/dist/esm/{app-globals-0f993ce5.js → app-globals-DQuL1Twl.js} +2 -0
  19. package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
  20. package/dist/esm/{index-0073c860.js → index-BLmY_kFa.js} +9 -10
  21. package/dist/esm/index-BLmY_kFa.js.map +1 -0
  22. package/dist/esm/index.js +2 -0
  23. package/dist/esm/index.js.map +1 -0
  24. package/dist/esm/loader.js +5 -3
  25. package/dist/esm/loader.js.map +1 -0
  26. package/dist/esm/proto-tinker-wc.js +7 -4
  27. package/dist/esm/proto-tinker-wc.js.map +1 -0
  28. package/dist/esm/proto-tinker.entry.js +1839 -1759
  29. package/dist/esm/proto-tinker.entry.js.map +1 -0
  30. package/dist/proto-tinker-wc/index.esm.js +2 -0
  31. package/dist/proto-tinker-wc/index.esm.js.map +1 -0
  32. package/dist/proto-tinker-wc/{p-74a1838d.js → p-BLmY_kFa.js} +3 -2
  33. package/dist/proto-tinker-wc/p-BLmY_kFa.js.map +1 -0
  34. package/dist/proto-tinker-wc/p-DQuL1Twl.js +2 -0
  35. package/dist/proto-tinker-wc/p-DQuL1Twl.js.map +1 -0
  36. package/dist/proto-tinker-wc/p-f2fb71b2.entry.js +2 -0
  37. package/dist/proto-tinker-wc/p-f2fb71b2.entry.js.map +1 -0
  38. package/dist/proto-tinker-wc/proto-tinker-wc.esm.js +2 -1
  39. package/dist/proto-tinker-wc/proto-tinker-wc.esm.js.map +1 -0
  40. package/dist/proto-tinker-wc/tokens.css +1 -1
  41. package/dist/types/stencil-public-runtime.d.ts +1 -0
  42. package/dist/types/utils/tw-version.d.ts +1 -1
  43. package/package.json +6 -6
  44. package/dist/loader/package.json +0 -11
  45. package/dist/proto-tinker-wc/p-5aa4d74d.entry.js +0 -1
  46. package/dist/proto-tinker-wc/p-e1255160.js +0 -1
  47. package/loader/package.json +0 -11
@@ -1,4 +1,4 @@
1
- import { h, g as getRenderingRef, f as forceUpdate, r as registerInstance } from './index-0073c860.js';
1
+ import { h, g as getRenderingRef, f as forceUpdate, r as registerInstance } from './index-BLmY_kFa.js';
2
2
 
3
3
  const Radio = props => {
4
4
  const hex = props.hex || 'currentColor';
@@ -13,2121 +13,2200 @@ const Radio = props => {
13
13
  h("path", { d: "M0 0h24v24H0z", fill: "none" })));
14
14
  };
15
15
 
16
- var colorString$1 = {exports: {}};
17
-
18
- var colorName$1 = {
19
- "aliceblue": [240, 248, 255],
20
- "antiquewhite": [250, 235, 215],
21
- "aqua": [0, 255, 255],
22
- "aquamarine": [127, 255, 212],
23
- "azure": [240, 255, 255],
24
- "beige": [245, 245, 220],
25
- "bisque": [255, 228, 196],
26
- "black": [0, 0, 0],
27
- "blanchedalmond": [255, 235, 205],
28
- "blue": [0, 0, 255],
29
- "blueviolet": [138, 43, 226],
30
- "brown": [165, 42, 42],
31
- "burlywood": [222, 184, 135],
32
- "cadetblue": [95, 158, 160],
33
- "chartreuse": [127, 255, 0],
34
- "chocolate": [210, 105, 30],
35
- "coral": [255, 127, 80],
36
- "cornflowerblue": [100, 149, 237],
37
- "cornsilk": [255, 248, 220],
38
- "crimson": [220, 20, 60],
39
- "cyan": [0, 255, 255],
40
- "darkblue": [0, 0, 139],
41
- "darkcyan": [0, 139, 139],
42
- "darkgoldenrod": [184, 134, 11],
43
- "darkgray": [169, 169, 169],
44
- "darkgreen": [0, 100, 0],
45
- "darkgrey": [169, 169, 169],
46
- "darkkhaki": [189, 183, 107],
47
- "darkmagenta": [139, 0, 139],
48
- "darkolivegreen": [85, 107, 47],
49
- "darkorange": [255, 140, 0],
50
- "darkorchid": [153, 50, 204],
51
- "darkred": [139, 0, 0],
52
- "darksalmon": [233, 150, 122],
53
- "darkseagreen": [143, 188, 143],
54
- "darkslateblue": [72, 61, 139],
55
- "darkslategray": [47, 79, 79],
56
- "darkslategrey": [47, 79, 79],
57
- "darkturquoise": [0, 206, 209],
58
- "darkviolet": [148, 0, 211],
59
- "deeppink": [255, 20, 147],
60
- "deepskyblue": [0, 191, 255],
61
- "dimgray": [105, 105, 105],
62
- "dimgrey": [105, 105, 105],
63
- "dodgerblue": [30, 144, 255],
64
- "firebrick": [178, 34, 34],
65
- "floralwhite": [255, 250, 240],
66
- "forestgreen": [34, 139, 34],
67
- "fuchsia": [255, 0, 255],
68
- "gainsboro": [220, 220, 220],
69
- "ghostwhite": [248, 248, 255],
70
- "gold": [255, 215, 0],
71
- "goldenrod": [218, 165, 32],
72
- "gray": [128, 128, 128],
73
- "green": [0, 128, 0],
74
- "greenyellow": [173, 255, 47],
75
- "grey": [128, 128, 128],
76
- "honeydew": [240, 255, 240],
77
- "hotpink": [255, 105, 180],
78
- "indianred": [205, 92, 92],
79
- "indigo": [75, 0, 130],
80
- "ivory": [255, 255, 240],
81
- "khaki": [240, 230, 140],
82
- "lavender": [230, 230, 250],
83
- "lavenderblush": [255, 240, 245],
84
- "lawngreen": [124, 252, 0],
85
- "lemonchiffon": [255, 250, 205],
86
- "lightblue": [173, 216, 230],
87
- "lightcoral": [240, 128, 128],
88
- "lightcyan": [224, 255, 255],
89
- "lightgoldenrodyellow": [250, 250, 210],
90
- "lightgray": [211, 211, 211],
91
- "lightgreen": [144, 238, 144],
92
- "lightgrey": [211, 211, 211],
93
- "lightpink": [255, 182, 193],
94
- "lightsalmon": [255, 160, 122],
95
- "lightseagreen": [32, 178, 170],
96
- "lightskyblue": [135, 206, 250],
97
- "lightslategray": [119, 136, 153],
98
- "lightslategrey": [119, 136, 153],
99
- "lightsteelblue": [176, 196, 222],
100
- "lightyellow": [255, 255, 224],
101
- "lime": [0, 255, 0],
102
- "limegreen": [50, 205, 50],
103
- "linen": [250, 240, 230],
104
- "magenta": [255, 0, 255],
105
- "maroon": [128, 0, 0],
106
- "mediumaquamarine": [102, 205, 170],
107
- "mediumblue": [0, 0, 205],
108
- "mediumorchid": [186, 85, 211],
109
- "mediumpurple": [147, 112, 219],
110
- "mediumseagreen": [60, 179, 113],
111
- "mediumslateblue": [123, 104, 238],
112
- "mediumspringgreen": [0, 250, 154],
113
- "mediumturquoise": [72, 209, 204],
114
- "mediumvioletred": [199, 21, 133],
115
- "midnightblue": [25, 25, 112],
116
- "mintcream": [245, 255, 250],
117
- "mistyrose": [255, 228, 225],
118
- "moccasin": [255, 228, 181],
119
- "navajowhite": [255, 222, 173],
120
- "navy": [0, 0, 128],
121
- "oldlace": [253, 245, 230],
122
- "olive": [128, 128, 0],
123
- "olivedrab": [107, 142, 35],
124
- "orange": [255, 165, 0],
125
- "orangered": [255, 69, 0],
126
- "orchid": [218, 112, 214],
127
- "palegoldenrod": [238, 232, 170],
128
- "palegreen": [152, 251, 152],
129
- "paleturquoise": [175, 238, 238],
130
- "palevioletred": [219, 112, 147],
131
- "papayawhip": [255, 239, 213],
132
- "peachpuff": [255, 218, 185],
133
- "peru": [205, 133, 63],
134
- "pink": [255, 192, 203],
135
- "plum": [221, 160, 221],
136
- "powderblue": [176, 224, 230],
137
- "purple": [128, 0, 128],
138
- "rebeccapurple": [102, 51, 153],
139
- "red": [255, 0, 0],
140
- "rosybrown": [188, 143, 143],
141
- "royalblue": [65, 105, 225],
142
- "saddlebrown": [139, 69, 19],
143
- "salmon": [250, 128, 114],
144
- "sandybrown": [244, 164, 96],
145
- "seagreen": [46, 139, 87],
146
- "seashell": [255, 245, 238],
147
- "sienna": [160, 82, 45],
148
- "silver": [192, 192, 192],
149
- "skyblue": [135, 206, 235],
150
- "slateblue": [106, 90, 205],
151
- "slategray": [112, 128, 144],
152
- "slategrey": [112, 128, 144],
153
- "snow": [255, 250, 250],
154
- "springgreen": [0, 255, 127],
155
- "steelblue": [70, 130, 180],
156
- "tan": [210, 180, 140],
157
- "teal": [0, 128, 128],
158
- "thistle": [216, 191, 216],
159
- "tomato": [255, 99, 71],
160
- "turquoise": [64, 224, 208],
161
- "violet": [238, 130, 238],
162
- "wheat": [245, 222, 179],
163
- "white": [255, 255, 255],
164
- "whitesmoke": [245, 245, 245],
165
- "yellow": [255, 255, 0],
166
- "yellowgreen": [154, 205, 50]
167
- };
16
+ var colorString = {exports: {}};
17
+
18
+ var colorName$1;
19
+ var hasRequiredColorName$1;
20
+
21
+ function requireColorName$1 () {
22
+ if (hasRequiredColorName$1) return colorName$1;
23
+ hasRequiredColorName$1 = 1;
24
+
25
+ colorName$1 = {
26
+ "aliceblue": [240, 248, 255],
27
+ "antiquewhite": [250, 235, 215],
28
+ "aqua": [0, 255, 255],
29
+ "aquamarine": [127, 255, 212],
30
+ "azure": [240, 255, 255],
31
+ "beige": [245, 245, 220],
32
+ "bisque": [255, 228, 196],
33
+ "black": [0, 0, 0],
34
+ "blanchedalmond": [255, 235, 205],
35
+ "blue": [0, 0, 255],
36
+ "blueviolet": [138, 43, 226],
37
+ "brown": [165, 42, 42],
38
+ "burlywood": [222, 184, 135],
39
+ "cadetblue": [95, 158, 160],
40
+ "chartreuse": [127, 255, 0],
41
+ "chocolate": [210, 105, 30],
42
+ "coral": [255, 127, 80],
43
+ "cornflowerblue": [100, 149, 237],
44
+ "cornsilk": [255, 248, 220],
45
+ "crimson": [220, 20, 60],
46
+ "cyan": [0, 255, 255],
47
+ "darkblue": [0, 0, 139],
48
+ "darkcyan": [0, 139, 139],
49
+ "darkgoldenrod": [184, 134, 11],
50
+ "darkgray": [169, 169, 169],
51
+ "darkgreen": [0, 100, 0],
52
+ "darkgrey": [169, 169, 169],
53
+ "darkkhaki": [189, 183, 107],
54
+ "darkmagenta": [139, 0, 139],
55
+ "darkolivegreen": [85, 107, 47],
56
+ "darkorange": [255, 140, 0],
57
+ "darkorchid": [153, 50, 204],
58
+ "darkred": [139, 0, 0],
59
+ "darksalmon": [233, 150, 122],
60
+ "darkseagreen": [143, 188, 143],
61
+ "darkslateblue": [72, 61, 139],
62
+ "darkslategray": [47, 79, 79],
63
+ "darkslategrey": [47, 79, 79],
64
+ "darkturquoise": [0, 206, 209],
65
+ "darkviolet": [148, 0, 211],
66
+ "deeppink": [255, 20, 147],
67
+ "deepskyblue": [0, 191, 255],
68
+ "dimgray": [105, 105, 105],
69
+ "dimgrey": [105, 105, 105],
70
+ "dodgerblue": [30, 144, 255],
71
+ "firebrick": [178, 34, 34],
72
+ "floralwhite": [255, 250, 240],
73
+ "forestgreen": [34, 139, 34],
74
+ "fuchsia": [255, 0, 255],
75
+ "gainsboro": [220, 220, 220],
76
+ "ghostwhite": [248, 248, 255],
77
+ "gold": [255, 215, 0],
78
+ "goldenrod": [218, 165, 32],
79
+ "gray": [128, 128, 128],
80
+ "green": [0, 128, 0],
81
+ "greenyellow": [173, 255, 47],
82
+ "grey": [128, 128, 128],
83
+ "honeydew": [240, 255, 240],
84
+ "hotpink": [255, 105, 180],
85
+ "indianred": [205, 92, 92],
86
+ "indigo": [75, 0, 130],
87
+ "ivory": [255, 255, 240],
88
+ "khaki": [240, 230, 140],
89
+ "lavender": [230, 230, 250],
90
+ "lavenderblush": [255, 240, 245],
91
+ "lawngreen": [124, 252, 0],
92
+ "lemonchiffon": [255, 250, 205],
93
+ "lightblue": [173, 216, 230],
94
+ "lightcoral": [240, 128, 128],
95
+ "lightcyan": [224, 255, 255],
96
+ "lightgoldenrodyellow": [250, 250, 210],
97
+ "lightgray": [211, 211, 211],
98
+ "lightgreen": [144, 238, 144],
99
+ "lightgrey": [211, 211, 211],
100
+ "lightpink": [255, 182, 193],
101
+ "lightsalmon": [255, 160, 122],
102
+ "lightseagreen": [32, 178, 170],
103
+ "lightskyblue": [135, 206, 250],
104
+ "lightslategray": [119, 136, 153],
105
+ "lightslategrey": [119, 136, 153],
106
+ "lightsteelblue": [176, 196, 222],
107
+ "lightyellow": [255, 255, 224],
108
+ "lime": [0, 255, 0],
109
+ "limegreen": [50, 205, 50],
110
+ "linen": [250, 240, 230],
111
+ "magenta": [255, 0, 255],
112
+ "maroon": [128, 0, 0],
113
+ "mediumaquamarine": [102, 205, 170],
114
+ "mediumblue": [0, 0, 205],
115
+ "mediumorchid": [186, 85, 211],
116
+ "mediumpurple": [147, 112, 219],
117
+ "mediumseagreen": [60, 179, 113],
118
+ "mediumslateblue": [123, 104, 238],
119
+ "mediumspringgreen": [0, 250, 154],
120
+ "mediumturquoise": [72, 209, 204],
121
+ "mediumvioletred": [199, 21, 133],
122
+ "midnightblue": [25, 25, 112],
123
+ "mintcream": [245, 255, 250],
124
+ "mistyrose": [255, 228, 225],
125
+ "moccasin": [255, 228, 181],
126
+ "navajowhite": [255, 222, 173],
127
+ "navy": [0, 0, 128],
128
+ "oldlace": [253, 245, 230],
129
+ "olive": [128, 128, 0],
130
+ "olivedrab": [107, 142, 35],
131
+ "orange": [255, 165, 0],
132
+ "orangered": [255, 69, 0],
133
+ "orchid": [218, 112, 214],
134
+ "palegoldenrod": [238, 232, 170],
135
+ "palegreen": [152, 251, 152],
136
+ "paleturquoise": [175, 238, 238],
137
+ "palevioletred": [219, 112, 147],
138
+ "papayawhip": [255, 239, 213],
139
+ "peachpuff": [255, 218, 185],
140
+ "peru": [205, 133, 63],
141
+ "pink": [255, 192, 203],
142
+ "plum": [221, 160, 221],
143
+ "powderblue": [176, 224, 230],
144
+ "purple": [128, 0, 128],
145
+ "rebeccapurple": [102, 51, 153],
146
+ "red": [255, 0, 0],
147
+ "rosybrown": [188, 143, 143],
148
+ "royalblue": [65, 105, 225],
149
+ "saddlebrown": [139, 69, 19],
150
+ "salmon": [250, 128, 114],
151
+ "sandybrown": [244, 164, 96],
152
+ "seagreen": [46, 139, 87],
153
+ "seashell": [255, 245, 238],
154
+ "sienna": [160, 82, 45],
155
+ "silver": [192, 192, 192],
156
+ "skyblue": [135, 206, 235],
157
+ "slateblue": [106, 90, 205],
158
+ "slategray": [112, 128, 144],
159
+ "slategrey": [112, 128, 144],
160
+ "snow": [255, 250, 250],
161
+ "springgreen": [0, 255, 127],
162
+ "steelblue": [70, 130, 180],
163
+ "tan": [210, 180, 140],
164
+ "teal": [0, 128, 128],
165
+ "thistle": [216, 191, 216],
166
+ "tomato": [255, 99, 71],
167
+ "turquoise": [64, 224, 208],
168
+ "violet": [238, 130, 238],
169
+ "wheat": [245, 222, 179],
170
+ "white": [255, 255, 255],
171
+ "whitesmoke": [245, 245, 245],
172
+ "yellow": [255, 255, 0],
173
+ "yellowgreen": [154, 205, 50]
174
+ };
175
+ return colorName$1;
176
+ }
168
177
 
169
178
  var simpleSwizzle = {exports: {}};
170
179
 
171
- var isArrayish$1 = function isArrayish(obj) {
172
- if (!obj || typeof obj === 'string') {
173
- return false;
174
- }
180
+ var isArrayish;
181
+ var hasRequiredIsArrayish;
175
182
 
176
- return obj instanceof Array || Array.isArray(obj) ||
177
- (obj.length >= 0 && (obj.splice instanceof Function ||
178
- (Object.getOwnPropertyDescriptor(obj, (obj.length - 1)) && obj.constructor.name !== 'String')));
179
- };
183
+ function requireIsArrayish () {
184
+ if (hasRequiredIsArrayish) return isArrayish;
185
+ hasRequiredIsArrayish = 1;
186
+ isArrayish = function isArrayish(obj) {
187
+ if (!obj || typeof obj === 'string') {
188
+ return false;
189
+ }
190
+
191
+ return obj instanceof Array || Array.isArray(obj) ||
192
+ (obj.length >= 0 && (obj.splice instanceof Function ||
193
+ (Object.getOwnPropertyDescriptor(obj, (obj.length - 1)) && obj.constructor.name !== 'String')));
194
+ };
195
+ return isArrayish;
196
+ }
180
197
 
181
- var isArrayish = isArrayish$1;
198
+ var hasRequiredSimpleSwizzle;
182
199
 
183
- var concat = Array.prototype.concat;
184
- var slice = Array.prototype.slice;
200
+ function requireSimpleSwizzle () {
201
+ if (hasRequiredSimpleSwizzle) return simpleSwizzle.exports;
202
+ hasRequiredSimpleSwizzle = 1;
185
203
 
186
- var swizzle$1 = simpleSwizzle.exports = function swizzle(args) {
187
- var results = [];
204
+ var isArrayish = requireIsArrayish();
188
205
 
189
- for (var i = 0, len = args.length; i < len; i++) {
190
- var arg = args[i];
206
+ var concat = Array.prototype.concat;
207
+ var slice = Array.prototype.slice;
191
208
 
192
- if (isArrayish(arg)) {
193
- // http://jsperf.com/javascript-array-concat-vs-push/98
194
- results = concat.call(results, slice.call(arg));
195
- } else {
196
- results.push(arg);
209
+ var swizzle = simpleSwizzle.exports = function swizzle(args) {
210
+ var results = [];
211
+
212
+ for (var i = 0, len = args.length; i < len; i++) {
213
+ var arg = args[i];
214
+
215
+ if (isArrayish(arg)) {
216
+ // http://jsperf.com/javascript-array-concat-vs-push/98
217
+ results = concat.call(results, slice.call(arg));
218
+ } else {
219
+ results.push(arg);
220
+ }
197
221
  }
198
- }
199
222
 
200
- return results;
201
- };
223
+ return results;
224
+ };
202
225
 
203
- swizzle$1.wrap = function (fn) {
204
- return function () {
205
- return fn(swizzle$1(arguments));
226
+ swizzle.wrap = function (fn) {
227
+ return function () {
228
+ return fn(swizzle(arguments));
229
+ };
206
230
  };
207
- };
231
+ return simpleSwizzle.exports;
232
+ }
208
233
 
209
234
  /* MIT license */
210
235
 
211
- var colorNames = colorName$1;
212
- var swizzle = simpleSwizzle.exports;
213
- var hasOwnProperty = Object.hasOwnProperty;
236
+ var hasRequiredColorString;
214
237
 
215
- var reverseNames = Object.create(null);
238
+ function requireColorString () {
239
+ if (hasRequiredColorString) return colorString.exports;
240
+ hasRequiredColorString = 1;
241
+ var colorNames = requireColorName$1();
242
+ var swizzle = requireSimpleSwizzle();
243
+ var hasOwnProperty = Object.hasOwnProperty;
216
244
 
217
- // create a list of reverse color names
218
- for (var name in colorNames) {
219
- if (hasOwnProperty.call(colorNames, name)) {
220
- reverseNames[colorNames[name]] = name;
221
- }
222
- }
223
-
224
- var cs = colorString$1.exports = {
225
- to: {},
226
- get: {}
227
- };
245
+ var reverseNames = Object.create(null);
228
246
 
229
- cs.get = function (string) {
230
- var prefix = string.substring(0, 3).toLowerCase();
231
- var val;
232
- var model;
233
- switch (prefix) {
234
- case 'hsl':
235
- val = cs.get.hsl(string);
236
- model = 'hsl';
237
- break;
238
- case 'hwb':
239
- val = cs.get.hwb(string);
240
- model = 'hwb';
241
- break;
242
- default:
243
- val = cs.get.rgb(string);
244
- model = 'rgb';
245
- break;
247
+ // create a list of reverse color names
248
+ for (var name in colorNames) {
249
+ if (hasOwnProperty.call(colorNames, name)) {
250
+ reverseNames[colorNames[name]] = name;
251
+ }
246
252
  }
247
253
 
248
- if (!val) {
249
- return null;
250
- }
254
+ var cs = colorString.exports = {
255
+ to: {},
256
+ get: {}
257
+ };
251
258
 
252
- return {model: model, value: val};
253
- };
259
+ cs.get = function (string) {
260
+ var prefix = string.substring(0, 3).toLowerCase();
261
+ var val;
262
+ var model;
263
+ switch (prefix) {
264
+ case 'hsl':
265
+ val = cs.get.hsl(string);
266
+ model = 'hsl';
267
+ break;
268
+ case 'hwb':
269
+ val = cs.get.hwb(string);
270
+ model = 'hwb';
271
+ break;
272
+ default:
273
+ val = cs.get.rgb(string);
274
+ model = 'rgb';
275
+ break;
276
+ }
254
277
 
255
- cs.get.rgb = function (string) {
256
- if (!string) {
257
- return null;
258
- }
278
+ if (!val) {
279
+ return null;
280
+ }
259
281
 
260
- var abbr = /^#([a-f0-9]{3,4})$/i;
261
- var hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;
262
- var rgba = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
263
- var per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
264
- var keyword = /^(\w+)$/;
282
+ return {model: model, value: val};
283
+ };
265
284
 
266
- var rgb = [0, 0, 0, 1];
267
- var match;
268
- var i;
269
- var hexAlpha;
285
+ cs.get.rgb = function (string) {
286
+ if (!string) {
287
+ return null;
288
+ }
270
289
 
271
- if (match = string.match(hex)) {
272
- hexAlpha = match[2];
273
- match = match[1];
290
+ var abbr = /^#([a-f0-9]{3,4})$/i;
291
+ var hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;
292
+ var rgba = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
293
+ var per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
294
+ var keyword = /^(\w+)$/;
295
+
296
+ var rgb = [0, 0, 0, 1];
297
+ var match;
298
+ var i;
299
+ var hexAlpha;
300
+
301
+ if (match = string.match(hex)) {
302
+ hexAlpha = match[2];
303
+ match = match[1];
304
+
305
+ for (i = 0; i < 3; i++) {
306
+ // https://jsperf.com/slice-vs-substr-vs-substring-methods-long-string/19
307
+ var i2 = i * 2;
308
+ rgb[i] = parseInt(match.slice(i2, i2 + 2), 16);
309
+ }
274
310
 
275
- for (i = 0; i < 3; i++) {
276
- // https://jsperf.com/slice-vs-substr-vs-substring-methods-long-string/19
277
- var i2 = i * 2;
278
- rgb[i] = parseInt(match.slice(i2, i2 + 2), 16);
279
- }
311
+ if (hexAlpha) {
312
+ rgb[3] = parseInt(hexAlpha, 16) / 255;
313
+ }
314
+ } else if (match = string.match(abbr)) {
315
+ match = match[1];
316
+ hexAlpha = match[3];
280
317
 
281
- if (hexAlpha) {
282
- rgb[3] = parseInt(hexAlpha, 16) / 255;
283
- }
284
- } else if (match = string.match(abbr)) {
285
- match = match[1];
286
- hexAlpha = match[3];
318
+ for (i = 0; i < 3; i++) {
319
+ rgb[i] = parseInt(match[i] + match[i], 16);
320
+ }
287
321
 
288
- for (i = 0; i < 3; i++) {
289
- rgb[i] = parseInt(match[i] + match[i], 16);
290
- }
322
+ if (hexAlpha) {
323
+ rgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;
324
+ }
325
+ } else if (match = string.match(rgba)) {
326
+ for (i = 0; i < 3; i++) {
327
+ rgb[i] = parseInt(match[i + 1], 0);
328
+ }
291
329
 
292
- if (hexAlpha) {
293
- rgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;
294
- }
295
- } else if (match = string.match(rgba)) {
296
- for (i = 0; i < 3; i++) {
297
- rgb[i] = parseInt(match[i + 1], 0);
298
- }
330
+ if (match[4]) {
331
+ if (match[5]) {
332
+ rgb[3] = parseFloat(match[4]) * 0.01;
333
+ } else {
334
+ rgb[3] = parseFloat(match[4]);
335
+ }
336
+ }
337
+ } else if (match = string.match(per)) {
338
+ for (i = 0; i < 3; i++) {
339
+ rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);
340
+ }
299
341
 
300
- if (match[4]) {
301
- if (match[5]) {
302
- rgb[3] = parseFloat(match[4]) * 0.01;
303
- } else {
304
- rgb[3] = parseFloat(match[4]);
342
+ if (match[4]) {
343
+ if (match[5]) {
344
+ rgb[3] = parseFloat(match[4]) * 0.01;
345
+ } else {
346
+ rgb[3] = parseFloat(match[4]);
347
+ }
348
+ }
349
+ } else if (match = string.match(keyword)) {
350
+ if (match[1] === 'transparent') {
351
+ return [0, 0, 0, 0];
305
352
  }
306
- }
307
- } else if (match = string.match(per)) {
308
- for (i = 0; i < 3; i++) {
309
- rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);
310
- }
311
353
 
312
- if (match[4]) {
313
- if (match[5]) {
314
- rgb[3] = parseFloat(match[4]) * 0.01;
315
- } else {
316
- rgb[3] = parseFloat(match[4]);
354
+ if (!hasOwnProperty.call(colorNames, match[1])) {
355
+ return null;
317
356
  }
318
- }
319
- } else if (match = string.match(keyword)) {
320
- if (match[1] === 'transparent') {
321
- return [0, 0, 0, 0];
322
- }
323
357
 
324
- if (!hasOwnProperty.call(colorNames, match[1])) {
358
+ rgb = colorNames[match[1]];
359
+ rgb[3] = 1;
360
+
361
+ return rgb;
362
+ } else {
325
363
  return null;
326
364
  }
327
365
 
328
- rgb = colorNames[match[1]];
329
- rgb[3] = 1;
366
+ for (i = 0; i < 3; i++) {
367
+ rgb[i] = clamp(rgb[i], 0, 255);
368
+ }
369
+ rgb[3] = clamp(rgb[3], 0, 1);
330
370
 
331
371
  return rgb;
332
- } else {
333
- return null;
334
- }
372
+ };
335
373
 
336
- for (i = 0; i < 3; i++) {
337
- rgb[i] = clamp(rgb[i], 0, 255);
338
- }
339
- rgb[3] = clamp(rgb[3], 0, 1);
374
+ cs.get.hsl = function (string) {
375
+ if (!string) {
376
+ return null;
377
+ }
340
378
 
341
- return rgb;
342
- };
379
+ var hsl = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
380
+ var match = string.match(hsl);
343
381
 
344
- cs.get.hsl = function (string) {
345
- if (!string) {
346
- return null;
347
- }
382
+ if (match) {
383
+ var alpha = parseFloat(match[4]);
384
+ var h = ((parseFloat(match[1]) % 360) + 360) % 360;
385
+ var s = clamp(parseFloat(match[2]), 0, 100);
386
+ var l = clamp(parseFloat(match[3]), 0, 100);
387
+ var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
348
388
 
349
- var hsl = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
350
- var match = string.match(hsl);
389
+ return [h, s, l, a];
390
+ }
351
391
 
352
- if (match) {
353
- var alpha = parseFloat(match[4]);
354
- var h = ((parseFloat(match[1]) % 360) + 360) % 360;
355
- var s = clamp(parseFloat(match[2]), 0, 100);
356
- var l = clamp(parseFloat(match[3]), 0, 100);
357
- var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
392
+ return null;
393
+ };
358
394
 
359
- return [h, s, l, a];
360
- }
395
+ cs.get.hwb = function (string) {
396
+ if (!string) {
397
+ return null;
398
+ }
361
399
 
362
- return null;
363
- };
400
+ var hwb = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
401
+ var match = string.match(hwb);
402
+
403
+ if (match) {
404
+ var alpha = parseFloat(match[4]);
405
+ var h = ((parseFloat(match[1]) % 360) + 360) % 360;
406
+ var w = clamp(parseFloat(match[2]), 0, 100);
407
+ var b = clamp(parseFloat(match[3]), 0, 100);
408
+ var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
409
+ return [h, w, b, a];
410
+ }
364
411
 
365
- cs.get.hwb = function (string) {
366
- if (!string) {
367
412
  return null;
368
- }
413
+ };
369
414
 
370
- var hwb = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
371
- var match = string.match(hwb);
415
+ cs.to.hex = function () {
416
+ var rgba = swizzle(arguments);
417
+
418
+ return (
419
+ '#' +
420
+ hexDouble(rgba[0]) +
421
+ hexDouble(rgba[1]) +
422
+ hexDouble(rgba[2]) +
423
+ (rgba[3] < 1
424
+ ? (hexDouble(Math.round(rgba[3] * 255)))
425
+ : '')
426
+ );
427
+ };
372
428
 
373
- if (match) {
374
- var alpha = parseFloat(match[4]);
375
- var h = ((parseFloat(match[1]) % 360) + 360) % 360;
376
- var w = clamp(parseFloat(match[2]), 0, 100);
377
- var b = clamp(parseFloat(match[3]), 0, 100);
378
- var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
379
- return [h, w, b, a];
380
- }
429
+ cs.to.rgb = function () {
430
+ var rgba = swizzle(arguments);
381
431
 
382
- return null;
383
- };
432
+ return rgba.length < 4 || rgba[3] === 1
433
+ ? 'rgb(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ')'
434
+ : 'rgba(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ', ' + rgba[3] + ')';
435
+ };
384
436
 
385
- cs.to.hex = function () {
386
- var rgba = swizzle(arguments);
387
-
388
- return (
389
- '#' +
390
- hexDouble(rgba[0]) +
391
- hexDouble(rgba[1]) +
392
- hexDouble(rgba[2]) +
393
- (rgba[3] < 1
394
- ? (hexDouble(Math.round(rgba[3] * 255)))
395
- : '')
396
- );
397
- };
437
+ cs.to.rgb.percent = function () {
438
+ var rgba = swizzle(arguments);
398
439
 
399
- cs.to.rgb = function () {
400
- var rgba = swizzle(arguments);
440
+ var r = Math.round(rgba[0] / 255 * 100);
441
+ var g = Math.round(rgba[1] / 255 * 100);
442
+ var b = Math.round(rgba[2] / 255 * 100);
401
443
 
402
- return rgba.length < 4 || rgba[3] === 1
403
- ? 'rgb(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ')'
404
- : 'rgba(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ', ' + rgba[3] + ')';
405
- };
444
+ return rgba.length < 4 || rgba[3] === 1
445
+ ? 'rgb(' + r + '%, ' + g + '%, ' + b + '%)'
446
+ : 'rgba(' + r + '%, ' + g + '%, ' + b + '%, ' + rgba[3] + ')';
447
+ };
406
448
 
407
- cs.to.rgb.percent = function () {
408
- var rgba = swizzle(arguments);
449
+ cs.to.hsl = function () {
450
+ var hsla = swizzle(arguments);
451
+ return hsla.length < 4 || hsla[3] === 1
452
+ ? 'hsl(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%)'
453
+ : 'hsla(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%, ' + hsla[3] + ')';
454
+ };
409
455
 
410
- var r = Math.round(rgba[0] / 255 * 100);
411
- var g = Math.round(rgba[1] / 255 * 100);
412
- var b = Math.round(rgba[2] / 255 * 100);
456
+ // hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax
457
+ // (hwb have alpha optional & 1 is default value)
458
+ cs.to.hwb = function () {
459
+ var hwba = swizzle(arguments);
413
460
 
414
- return rgba.length < 4 || rgba[3] === 1
415
- ? 'rgb(' + r + '%, ' + g + '%, ' + b + '%)'
416
- : 'rgba(' + r + '%, ' + g + '%, ' + b + '%, ' + rgba[3] + ')';
417
- };
461
+ var a = '';
462
+ if (hwba.length >= 4 && hwba[3] !== 1) {
463
+ a = ', ' + hwba[3];
464
+ }
418
465
 
419
- cs.to.hsl = function () {
420
- var hsla = swizzle(arguments);
421
- return hsla.length < 4 || hsla[3] === 1
422
- ? 'hsl(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%)'
423
- : 'hsla(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%, ' + hsla[3] + ')';
424
- };
466
+ return 'hwb(' + hwba[0] + ', ' + hwba[1] + '%, ' + hwba[2] + '%' + a + ')';
467
+ };
425
468
 
426
- // hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax
427
- // (hwb have alpha optional & 1 is default value)
428
- cs.to.hwb = function () {
429
- var hwba = swizzle(arguments);
469
+ cs.to.keyword = function (rgb) {
470
+ return reverseNames[rgb.slice(0, 3)];
471
+ };
430
472
 
431
- var a = '';
432
- if (hwba.length >= 4 && hwba[3] !== 1) {
433
- a = ', ' + hwba[3];
473
+ // helpers
474
+ function clamp(num, min, max) {
475
+ return Math.min(Math.max(min, num), max);
434
476
  }
435
477
 
436
- return 'hwb(' + hwba[0] + ', ' + hwba[1] + '%, ' + hwba[2] + '%' + a + ')';
437
- };
438
-
439
- cs.to.keyword = function (rgb) {
440
- return reverseNames[rgb.slice(0, 3)];
441
- };
442
-
443
- // helpers
444
- function clamp(num, min, max) {
445
- return Math.min(Math.max(min, num), max);
478
+ function hexDouble(num) {
479
+ var str = Math.round(num).toString(16).toUpperCase();
480
+ return (str.length < 2) ? '0' + str : str;
481
+ }
482
+ return colorString.exports;
446
483
  }
447
484
 
448
- function hexDouble(num) {
449
- var str = Math.round(num).toString(16).toUpperCase();
450
- return (str.length < 2) ? '0' + str : str;
485
+ var conversions = {exports: {}};
486
+
487
+ var colorName;
488
+ var hasRequiredColorName;
489
+
490
+ function requireColorName () {
491
+ if (hasRequiredColorName) return colorName;
492
+ hasRequiredColorName = 1;
493
+
494
+ colorName = {
495
+ "aliceblue": [240, 248, 255],
496
+ "antiquewhite": [250, 235, 215],
497
+ "aqua": [0, 255, 255],
498
+ "aquamarine": [127, 255, 212],
499
+ "azure": [240, 255, 255],
500
+ "beige": [245, 245, 220],
501
+ "bisque": [255, 228, 196],
502
+ "black": [0, 0, 0],
503
+ "blanchedalmond": [255, 235, 205],
504
+ "blue": [0, 0, 255],
505
+ "blueviolet": [138, 43, 226],
506
+ "brown": [165, 42, 42],
507
+ "burlywood": [222, 184, 135],
508
+ "cadetblue": [95, 158, 160],
509
+ "chartreuse": [127, 255, 0],
510
+ "chocolate": [210, 105, 30],
511
+ "coral": [255, 127, 80],
512
+ "cornflowerblue": [100, 149, 237],
513
+ "cornsilk": [255, 248, 220],
514
+ "crimson": [220, 20, 60],
515
+ "cyan": [0, 255, 255],
516
+ "darkblue": [0, 0, 139],
517
+ "darkcyan": [0, 139, 139],
518
+ "darkgoldenrod": [184, 134, 11],
519
+ "darkgray": [169, 169, 169],
520
+ "darkgreen": [0, 100, 0],
521
+ "darkgrey": [169, 169, 169],
522
+ "darkkhaki": [189, 183, 107],
523
+ "darkmagenta": [139, 0, 139],
524
+ "darkolivegreen": [85, 107, 47],
525
+ "darkorange": [255, 140, 0],
526
+ "darkorchid": [153, 50, 204],
527
+ "darkred": [139, 0, 0],
528
+ "darksalmon": [233, 150, 122],
529
+ "darkseagreen": [143, 188, 143],
530
+ "darkslateblue": [72, 61, 139],
531
+ "darkslategray": [47, 79, 79],
532
+ "darkslategrey": [47, 79, 79],
533
+ "darkturquoise": [0, 206, 209],
534
+ "darkviolet": [148, 0, 211],
535
+ "deeppink": [255, 20, 147],
536
+ "deepskyblue": [0, 191, 255],
537
+ "dimgray": [105, 105, 105],
538
+ "dimgrey": [105, 105, 105],
539
+ "dodgerblue": [30, 144, 255],
540
+ "firebrick": [178, 34, 34],
541
+ "floralwhite": [255, 250, 240],
542
+ "forestgreen": [34, 139, 34],
543
+ "fuchsia": [255, 0, 255],
544
+ "gainsboro": [220, 220, 220],
545
+ "ghostwhite": [248, 248, 255],
546
+ "gold": [255, 215, 0],
547
+ "goldenrod": [218, 165, 32],
548
+ "gray": [128, 128, 128],
549
+ "green": [0, 128, 0],
550
+ "greenyellow": [173, 255, 47],
551
+ "grey": [128, 128, 128],
552
+ "honeydew": [240, 255, 240],
553
+ "hotpink": [255, 105, 180],
554
+ "indianred": [205, 92, 92],
555
+ "indigo": [75, 0, 130],
556
+ "ivory": [255, 255, 240],
557
+ "khaki": [240, 230, 140],
558
+ "lavender": [230, 230, 250],
559
+ "lavenderblush": [255, 240, 245],
560
+ "lawngreen": [124, 252, 0],
561
+ "lemonchiffon": [255, 250, 205],
562
+ "lightblue": [173, 216, 230],
563
+ "lightcoral": [240, 128, 128],
564
+ "lightcyan": [224, 255, 255],
565
+ "lightgoldenrodyellow": [250, 250, 210],
566
+ "lightgray": [211, 211, 211],
567
+ "lightgreen": [144, 238, 144],
568
+ "lightgrey": [211, 211, 211],
569
+ "lightpink": [255, 182, 193],
570
+ "lightsalmon": [255, 160, 122],
571
+ "lightseagreen": [32, 178, 170],
572
+ "lightskyblue": [135, 206, 250],
573
+ "lightslategray": [119, 136, 153],
574
+ "lightslategrey": [119, 136, 153],
575
+ "lightsteelblue": [176, 196, 222],
576
+ "lightyellow": [255, 255, 224],
577
+ "lime": [0, 255, 0],
578
+ "limegreen": [50, 205, 50],
579
+ "linen": [250, 240, 230],
580
+ "magenta": [255, 0, 255],
581
+ "maroon": [128, 0, 0],
582
+ "mediumaquamarine": [102, 205, 170],
583
+ "mediumblue": [0, 0, 205],
584
+ "mediumorchid": [186, 85, 211],
585
+ "mediumpurple": [147, 112, 219],
586
+ "mediumseagreen": [60, 179, 113],
587
+ "mediumslateblue": [123, 104, 238],
588
+ "mediumspringgreen": [0, 250, 154],
589
+ "mediumturquoise": [72, 209, 204],
590
+ "mediumvioletred": [199, 21, 133],
591
+ "midnightblue": [25, 25, 112],
592
+ "mintcream": [245, 255, 250],
593
+ "mistyrose": [255, 228, 225],
594
+ "moccasin": [255, 228, 181],
595
+ "navajowhite": [255, 222, 173],
596
+ "navy": [0, 0, 128],
597
+ "oldlace": [253, 245, 230],
598
+ "olive": [128, 128, 0],
599
+ "olivedrab": [107, 142, 35],
600
+ "orange": [255, 165, 0],
601
+ "orangered": [255, 69, 0],
602
+ "orchid": [218, 112, 214],
603
+ "palegoldenrod": [238, 232, 170],
604
+ "palegreen": [152, 251, 152],
605
+ "paleturquoise": [175, 238, 238],
606
+ "palevioletred": [219, 112, 147],
607
+ "papayawhip": [255, 239, 213],
608
+ "peachpuff": [255, 218, 185],
609
+ "peru": [205, 133, 63],
610
+ "pink": [255, 192, 203],
611
+ "plum": [221, 160, 221],
612
+ "powderblue": [176, 224, 230],
613
+ "purple": [128, 0, 128],
614
+ "rebeccapurple": [102, 51, 153],
615
+ "red": [255, 0, 0],
616
+ "rosybrown": [188, 143, 143],
617
+ "royalblue": [65, 105, 225],
618
+ "saddlebrown": [139, 69, 19],
619
+ "salmon": [250, 128, 114],
620
+ "sandybrown": [244, 164, 96],
621
+ "seagreen": [46, 139, 87],
622
+ "seashell": [255, 245, 238],
623
+ "sienna": [160, 82, 45],
624
+ "silver": [192, 192, 192],
625
+ "skyblue": [135, 206, 235],
626
+ "slateblue": [106, 90, 205],
627
+ "slategray": [112, 128, 144],
628
+ "slategrey": [112, 128, 144],
629
+ "snow": [255, 250, 250],
630
+ "springgreen": [0, 255, 127],
631
+ "steelblue": [70, 130, 180],
632
+ "tan": [210, 180, 140],
633
+ "teal": [0, 128, 128],
634
+ "thistle": [216, 191, 216],
635
+ "tomato": [255, 99, 71],
636
+ "turquoise": [64, 224, 208],
637
+ "violet": [238, 130, 238],
638
+ "wheat": [245, 222, 179],
639
+ "white": [255, 255, 255],
640
+ "whitesmoke": [245, 245, 245],
641
+ "yellow": [255, 255, 0],
642
+ "yellowgreen": [154, 205, 50]
643
+ };
644
+ return colorName;
451
645
  }
452
646
 
453
- var conversions$2 = {exports: {}};
454
-
455
- var colorName = {
456
- "aliceblue": [240, 248, 255],
457
- "antiquewhite": [250, 235, 215],
458
- "aqua": [0, 255, 255],
459
- "aquamarine": [127, 255, 212],
460
- "azure": [240, 255, 255],
461
- "beige": [245, 245, 220],
462
- "bisque": [255, 228, 196],
463
- "black": [0, 0, 0],
464
- "blanchedalmond": [255, 235, 205],
465
- "blue": [0, 0, 255],
466
- "blueviolet": [138, 43, 226],
467
- "brown": [165, 42, 42],
468
- "burlywood": [222, 184, 135],
469
- "cadetblue": [95, 158, 160],
470
- "chartreuse": [127, 255, 0],
471
- "chocolate": [210, 105, 30],
472
- "coral": [255, 127, 80],
473
- "cornflowerblue": [100, 149, 237],
474
- "cornsilk": [255, 248, 220],
475
- "crimson": [220, 20, 60],
476
- "cyan": [0, 255, 255],
477
- "darkblue": [0, 0, 139],
478
- "darkcyan": [0, 139, 139],
479
- "darkgoldenrod": [184, 134, 11],
480
- "darkgray": [169, 169, 169],
481
- "darkgreen": [0, 100, 0],
482
- "darkgrey": [169, 169, 169],
483
- "darkkhaki": [189, 183, 107],
484
- "darkmagenta": [139, 0, 139],
485
- "darkolivegreen": [85, 107, 47],
486
- "darkorange": [255, 140, 0],
487
- "darkorchid": [153, 50, 204],
488
- "darkred": [139, 0, 0],
489
- "darksalmon": [233, 150, 122],
490
- "darkseagreen": [143, 188, 143],
491
- "darkslateblue": [72, 61, 139],
492
- "darkslategray": [47, 79, 79],
493
- "darkslategrey": [47, 79, 79],
494
- "darkturquoise": [0, 206, 209],
495
- "darkviolet": [148, 0, 211],
496
- "deeppink": [255, 20, 147],
497
- "deepskyblue": [0, 191, 255],
498
- "dimgray": [105, 105, 105],
499
- "dimgrey": [105, 105, 105],
500
- "dodgerblue": [30, 144, 255],
501
- "firebrick": [178, 34, 34],
502
- "floralwhite": [255, 250, 240],
503
- "forestgreen": [34, 139, 34],
504
- "fuchsia": [255, 0, 255],
505
- "gainsboro": [220, 220, 220],
506
- "ghostwhite": [248, 248, 255],
507
- "gold": [255, 215, 0],
508
- "goldenrod": [218, 165, 32],
509
- "gray": [128, 128, 128],
510
- "green": [0, 128, 0],
511
- "greenyellow": [173, 255, 47],
512
- "grey": [128, 128, 128],
513
- "honeydew": [240, 255, 240],
514
- "hotpink": [255, 105, 180],
515
- "indianred": [205, 92, 92],
516
- "indigo": [75, 0, 130],
517
- "ivory": [255, 255, 240],
518
- "khaki": [240, 230, 140],
519
- "lavender": [230, 230, 250],
520
- "lavenderblush": [255, 240, 245],
521
- "lawngreen": [124, 252, 0],
522
- "lemonchiffon": [255, 250, 205],
523
- "lightblue": [173, 216, 230],
524
- "lightcoral": [240, 128, 128],
525
- "lightcyan": [224, 255, 255],
526
- "lightgoldenrodyellow": [250, 250, 210],
527
- "lightgray": [211, 211, 211],
528
- "lightgreen": [144, 238, 144],
529
- "lightgrey": [211, 211, 211],
530
- "lightpink": [255, 182, 193],
531
- "lightsalmon": [255, 160, 122],
532
- "lightseagreen": [32, 178, 170],
533
- "lightskyblue": [135, 206, 250],
534
- "lightslategray": [119, 136, 153],
535
- "lightslategrey": [119, 136, 153],
536
- "lightsteelblue": [176, 196, 222],
537
- "lightyellow": [255, 255, 224],
538
- "lime": [0, 255, 0],
539
- "limegreen": [50, 205, 50],
540
- "linen": [250, 240, 230],
541
- "magenta": [255, 0, 255],
542
- "maroon": [128, 0, 0],
543
- "mediumaquamarine": [102, 205, 170],
544
- "mediumblue": [0, 0, 205],
545
- "mediumorchid": [186, 85, 211],
546
- "mediumpurple": [147, 112, 219],
547
- "mediumseagreen": [60, 179, 113],
548
- "mediumslateblue": [123, 104, 238],
549
- "mediumspringgreen": [0, 250, 154],
550
- "mediumturquoise": [72, 209, 204],
551
- "mediumvioletred": [199, 21, 133],
552
- "midnightblue": [25, 25, 112],
553
- "mintcream": [245, 255, 250],
554
- "mistyrose": [255, 228, 225],
555
- "moccasin": [255, 228, 181],
556
- "navajowhite": [255, 222, 173],
557
- "navy": [0, 0, 128],
558
- "oldlace": [253, 245, 230],
559
- "olive": [128, 128, 0],
560
- "olivedrab": [107, 142, 35],
561
- "orange": [255, 165, 0],
562
- "orangered": [255, 69, 0],
563
- "orchid": [218, 112, 214],
564
- "palegoldenrod": [238, 232, 170],
565
- "palegreen": [152, 251, 152],
566
- "paleturquoise": [175, 238, 238],
567
- "palevioletred": [219, 112, 147],
568
- "papayawhip": [255, 239, 213],
569
- "peachpuff": [255, 218, 185],
570
- "peru": [205, 133, 63],
571
- "pink": [255, 192, 203],
572
- "plum": [221, 160, 221],
573
- "powderblue": [176, 224, 230],
574
- "purple": [128, 0, 128],
575
- "rebeccapurple": [102, 51, 153],
576
- "red": [255, 0, 0],
577
- "rosybrown": [188, 143, 143],
578
- "royalblue": [65, 105, 225],
579
- "saddlebrown": [139, 69, 19],
580
- "salmon": [250, 128, 114],
581
- "sandybrown": [244, 164, 96],
582
- "seagreen": [46, 139, 87],
583
- "seashell": [255, 245, 238],
584
- "sienna": [160, 82, 45],
585
- "silver": [192, 192, 192],
586
- "skyblue": [135, 206, 235],
587
- "slateblue": [106, 90, 205],
588
- "slategray": [112, 128, 144],
589
- "slategrey": [112, 128, 144],
590
- "snow": [255, 250, 250],
591
- "springgreen": [0, 255, 127],
592
- "steelblue": [70, 130, 180],
593
- "tan": [210, 180, 140],
594
- "teal": [0, 128, 128],
595
- "thistle": [216, 191, 216],
596
- "tomato": [255, 99, 71],
597
- "turquoise": [64, 224, 208],
598
- "violet": [238, 130, 238],
599
- "wheat": [245, 222, 179],
600
- "white": [255, 255, 255],
601
- "whitesmoke": [245, 245, 245],
602
- "yellow": [255, 255, 0],
603
- "yellowgreen": [154, 205, 50]
604
- };
605
-
606
647
  /* MIT license */
607
648
 
608
- var cssKeywords = colorName;
609
-
610
- // NOTE: conversions should only return primitive values (i.e. arrays, or
611
- // values that give correct `typeof` results).
612
- // do not use box values types (i.e. Number(), String(), etc.)
613
-
614
- var reverseKeywords = {};
615
- for (var key in cssKeywords) {
616
- if (cssKeywords.hasOwnProperty(key)) {
617
- reverseKeywords[cssKeywords[key]] = key;
618
- }
619
- }
649
+ var hasRequiredConversions;
620
650
 
621
- var convert$2 = conversions$2.exports = {
622
- rgb: {channels: 3, labels: 'rgb'},
623
- hsl: {channels: 3, labels: 'hsl'},
624
- hsv: {channels: 3, labels: 'hsv'},
625
- hwb: {channels: 3, labels: 'hwb'},
626
- cmyk: {channels: 4, labels: 'cmyk'},
627
- xyz: {channels: 3, labels: 'xyz'},
628
- lab: {channels: 3, labels: 'lab'},
629
- lch: {channels: 3, labels: 'lch'},
630
- hex: {channels: 1, labels: ['hex']},
631
- keyword: {channels: 1, labels: ['keyword']},
632
- ansi16: {channels: 1, labels: ['ansi16']},
633
- ansi256: {channels: 1, labels: ['ansi256']},
634
- hcg: {channels: 3, labels: ['h', 'c', 'g']},
635
- apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
636
- gray: {channels: 1, labels: ['gray']}
637
- };
651
+ function requireConversions () {
652
+ if (hasRequiredConversions) return conversions.exports;
653
+ hasRequiredConversions = 1;
654
+ var cssKeywords = requireColorName();
638
655
 
639
- // hide .channels and .labels properties
640
- for (var model in convert$2) {
641
- if (convert$2.hasOwnProperty(model)) {
642
- if (!('channels' in convert$2[model])) {
643
- throw new Error('missing channels property: ' + model);
644
- }
656
+ // NOTE: conversions should only return primitive values (i.e. arrays, or
657
+ // values that give correct `typeof` results).
658
+ // do not use box values types (i.e. Number(), String(), etc.)
645
659
 
646
- if (!('labels' in convert$2[model])) {
647
- throw new Error('missing channel labels property: ' + model);
660
+ var reverseKeywords = {};
661
+ for (var key in cssKeywords) {
662
+ if (cssKeywords.hasOwnProperty(key)) {
663
+ reverseKeywords[cssKeywords[key]] = key;
648
664
  }
649
-
650
- if (convert$2[model].labels.length !== convert$2[model].channels) {
651
- throw new Error('channel and label counts mismatch: ' + model);
652
- }
653
-
654
- var channels = convert$2[model].channels;
655
- var labels = convert$2[model].labels;
656
- delete convert$2[model].channels;
657
- delete convert$2[model].labels;
658
- Object.defineProperty(convert$2[model], 'channels', {value: channels});
659
- Object.defineProperty(convert$2[model], 'labels', {value: labels});
660
665
  }
661
- }
662
666
 
663
- convert$2.rgb.hsl = function (rgb) {
664
- var r = rgb[0] / 255;
665
- var g = rgb[1] / 255;
666
- var b = rgb[2] / 255;
667
- var min = Math.min(r, g, b);
668
- var max = Math.max(r, g, b);
669
- var delta = max - min;
670
- var h;
671
- var s;
672
- var l;
673
-
674
- if (max === min) {
675
- h = 0;
676
- } else if (r === max) {
677
- h = (g - b) / delta;
678
- } else if (g === max) {
679
- h = 2 + (b - r) / delta;
680
- } else if (b === max) {
681
- h = 4 + (r - g) / delta;
682
- }
667
+ var convert = conversions.exports = {
668
+ rgb: {channels: 3, labels: 'rgb'},
669
+ hsl: {channels: 3, labels: 'hsl'},
670
+ hsv: {channels: 3, labels: 'hsv'},
671
+ hwb: {channels: 3, labels: 'hwb'},
672
+ cmyk: {channels: 4, labels: 'cmyk'},
673
+ xyz: {channels: 3, labels: 'xyz'},
674
+ lab: {channels: 3, labels: 'lab'},
675
+ lch: {channels: 3, labels: 'lch'},
676
+ hex: {channels: 1, labels: ['hex']},
677
+ keyword: {channels: 1, labels: ['keyword']},
678
+ ansi16: {channels: 1, labels: ['ansi16']},
679
+ ansi256: {channels: 1, labels: ['ansi256']},
680
+ hcg: {channels: 3, labels: ['h', 'c', 'g']},
681
+ apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
682
+ gray: {channels: 1, labels: ['gray']}
683
+ };
683
684
 
684
- h = Math.min(h * 60, 360);
685
+ // hide .channels and .labels properties
686
+ for (var model in convert) {
687
+ if (convert.hasOwnProperty(model)) {
688
+ if (!('channels' in convert[model])) {
689
+ throw new Error('missing channels property: ' + model);
690
+ }
685
691
 
686
- if (h < 0) {
687
- h += 360;
688
- }
692
+ if (!('labels' in convert[model])) {
693
+ throw new Error('missing channel labels property: ' + model);
694
+ }
689
695
 
690
- l = (min + max) / 2;
696
+ if (convert[model].labels.length !== convert[model].channels) {
697
+ throw new Error('channel and label counts mismatch: ' + model);
698
+ }
691
699
 
692
- if (max === min) {
693
- s = 0;
694
- } else if (l <= 0.5) {
695
- s = delta / (max + min);
696
- } else {
697
- s = delta / (2 - max - min);
700
+ var channels = convert[model].channels;
701
+ var labels = convert[model].labels;
702
+ delete convert[model].channels;
703
+ delete convert[model].labels;
704
+ Object.defineProperty(convert[model], 'channels', {value: channels});
705
+ Object.defineProperty(convert[model], 'labels', {value: labels});
706
+ }
698
707
  }
699
708
 
700
- return [h, s * 100, l * 100];
701
- };
709
+ convert.rgb.hsl = function (rgb) {
710
+ var r = rgb[0] / 255;
711
+ var g = rgb[1] / 255;
712
+ var b = rgb[2] / 255;
713
+ var min = Math.min(r, g, b);
714
+ var max = Math.max(r, g, b);
715
+ var delta = max - min;
716
+ var h;
717
+ var s;
718
+ var l;
719
+
720
+ if (max === min) {
721
+ h = 0;
722
+ } else if (r === max) {
723
+ h = (g - b) / delta;
724
+ } else if (g === max) {
725
+ h = 2 + (b - r) / delta;
726
+ } else if (b === max) {
727
+ h = 4 + (r - g) / delta;
728
+ }
702
729
 
703
- convert$2.rgb.hsv = function (rgb) {
704
- var rdif;
705
- var gdif;
706
- var bdif;
707
- var h;
708
- var s;
709
-
710
- var r = rgb[0] / 255;
711
- var g = rgb[1] / 255;
712
- var b = rgb[2] / 255;
713
- var v = Math.max(r, g, b);
714
- var diff = v - Math.min(r, g, b);
715
- var diffc = function (c) {
716
- return (v - c) / 6 / diff + 1 / 2;
717
- };
730
+ h = Math.min(h * 60, 360);
718
731
 
719
- if (diff === 0) {
720
- h = s = 0;
721
- } else {
722
- s = diff / v;
723
- rdif = diffc(r);
724
- gdif = diffc(g);
725
- bdif = diffc(b);
726
-
727
- if (r === v) {
728
- h = bdif - gdif;
729
- } else if (g === v) {
730
- h = (1 / 3) + rdif - bdif;
731
- } else if (b === v) {
732
- h = (2 / 3) + gdif - rdif;
733
- }
734
732
  if (h < 0) {
735
- h += 1;
736
- } else if (h > 1) {
737
- h -= 1;
733
+ h += 360;
738
734
  }
739
- }
740
735
 
741
- return [
742
- h * 360,
743
- s * 100,
744
- v * 100
745
- ];
746
- };
736
+ l = (min + max) / 2;
747
737
 
748
- convert$2.rgb.hwb = function (rgb) {
749
- var r = rgb[0];
750
- var g = rgb[1];
751
- var b = rgb[2];
752
- var h = convert$2.rgb.hsl(rgb)[0];
753
- var w = 1 / 255 * Math.min(r, Math.min(g, b));
738
+ if (max === min) {
739
+ s = 0;
740
+ } else if (l <= 0.5) {
741
+ s = delta / (max + min);
742
+ } else {
743
+ s = delta / (2 - max - min);
744
+ }
754
745
 
755
- b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
746
+ return [h, s * 100, l * 100];
747
+ };
756
748
 
757
- return [h, w * 100, b * 100];
758
- };
749
+ convert.rgb.hsv = function (rgb) {
750
+ var rdif;
751
+ var gdif;
752
+ var bdif;
753
+ var h;
754
+ var s;
755
+
756
+ var r = rgb[0] / 255;
757
+ var g = rgb[1] / 255;
758
+ var b = rgb[2] / 255;
759
+ var v = Math.max(r, g, b);
760
+ var diff = v - Math.min(r, g, b);
761
+ var diffc = function (c) {
762
+ return (v - c) / 6 / diff + 1 / 2;
763
+ };
759
764
 
760
- convert$2.rgb.cmyk = function (rgb) {
761
- var r = rgb[0] / 255;
762
- var g = rgb[1] / 255;
763
- var b = rgb[2] / 255;
764
- var c;
765
- var m;
766
- var y;
767
- var k;
768
-
769
- k = Math.min(1 - r, 1 - g, 1 - b);
770
- c = (1 - r - k) / (1 - k) || 0;
771
- m = (1 - g - k) / (1 - k) || 0;
772
- y = (1 - b - k) / (1 - k) || 0;
773
-
774
- return [c * 100, m * 100, y * 100, k * 100];
775
- };
765
+ if (diff === 0) {
766
+ h = s = 0;
767
+ } else {
768
+ s = diff / v;
769
+ rdif = diffc(r);
770
+ gdif = diffc(g);
771
+ bdif = diffc(b);
772
+
773
+ if (r === v) {
774
+ h = bdif - gdif;
775
+ } else if (g === v) {
776
+ h = (1 / 3) + rdif - bdif;
777
+ } else if (b === v) {
778
+ h = (2 / 3) + gdif - rdif;
779
+ }
780
+ if (h < 0) {
781
+ h += 1;
782
+ } else if (h > 1) {
783
+ h -= 1;
784
+ }
785
+ }
776
786
 
777
- /**
778
- * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
779
- * */
780
- function comparativeDistance(x, y) {
781
- return (
782
- Math.pow(x[0] - y[0], 2) +
783
- Math.pow(x[1] - y[1], 2) +
784
- Math.pow(x[2] - y[2], 2)
785
- );
786
- }
787
+ return [
788
+ h * 360,
789
+ s * 100,
790
+ v * 100
791
+ ];
792
+ };
787
793
 
788
- convert$2.rgb.keyword = function (rgb) {
789
- var reversed = reverseKeywords[rgb];
790
- if (reversed) {
791
- return reversed;
792
- }
794
+ convert.rgb.hwb = function (rgb) {
795
+ var r = rgb[0];
796
+ var g = rgb[1];
797
+ var b = rgb[2];
798
+ var h = convert.rgb.hsl(rgb)[0];
799
+ var w = 1 / 255 * Math.min(r, Math.min(g, b));
793
800
 
794
- var currentClosestDistance = Infinity;
795
- var currentClosestKeyword;
801
+ b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
796
802
 
797
- for (var keyword in cssKeywords) {
798
- if (cssKeywords.hasOwnProperty(keyword)) {
799
- var value = cssKeywords[keyword];
803
+ return [h, w * 100, b * 100];
804
+ };
800
805
 
801
- // Compute comparative distance
802
- var distance = comparativeDistance(rgb, value);
806
+ convert.rgb.cmyk = function (rgb) {
807
+ var r = rgb[0] / 255;
808
+ var g = rgb[1] / 255;
809
+ var b = rgb[2] / 255;
810
+ var c;
811
+ var m;
812
+ var y;
813
+ var k;
814
+
815
+ k = Math.min(1 - r, 1 - g, 1 - b);
816
+ c = (1 - r - k) / (1 - k) || 0;
817
+ m = (1 - g - k) / (1 - k) || 0;
818
+ y = (1 - b - k) / (1 - k) || 0;
819
+
820
+ return [c * 100, m * 100, y * 100, k * 100];
821
+ };
803
822
 
804
- // Check if its less, if so set as closest
805
- if (distance < currentClosestDistance) {
806
- currentClosestDistance = distance;
807
- currentClosestKeyword = keyword;
808
- }
809
- }
823
+ /**
824
+ * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
825
+ * */
826
+ function comparativeDistance(x, y) {
827
+ return (
828
+ Math.pow(x[0] - y[0], 2) +
829
+ Math.pow(x[1] - y[1], 2) +
830
+ Math.pow(x[2] - y[2], 2)
831
+ );
810
832
  }
811
833
 
812
- return currentClosestKeyword;
813
- };
834
+ convert.rgb.keyword = function (rgb) {
835
+ var reversed = reverseKeywords[rgb];
836
+ if (reversed) {
837
+ return reversed;
838
+ }
814
839
 
815
- convert$2.keyword.rgb = function (keyword) {
816
- return cssKeywords[keyword];
817
- };
840
+ var currentClosestDistance = Infinity;
841
+ var currentClosestKeyword;
818
842
 
819
- convert$2.rgb.xyz = function (rgb) {
820
- var r = rgb[0] / 255;
821
- var g = rgb[1] / 255;
822
- var b = rgb[2] / 255;
843
+ for (var keyword in cssKeywords) {
844
+ if (cssKeywords.hasOwnProperty(keyword)) {
845
+ var value = cssKeywords[keyword];
823
846
 
824
- // assume sRGB
825
- r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);
826
- g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);
827
- b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);
847
+ // Compute comparative distance
848
+ var distance = comparativeDistance(rgb, value);
828
849
 
829
- var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
830
- var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
831
- var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);
850
+ // Check if its less, if so set as closest
851
+ if (distance < currentClosestDistance) {
852
+ currentClosestDistance = distance;
853
+ currentClosestKeyword = keyword;
854
+ }
855
+ }
856
+ }
832
857
 
833
- return [x * 100, y * 100, z * 100];
834
- };
858
+ return currentClosestKeyword;
859
+ };
835
860
 
836
- convert$2.rgb.lab = function (rgb) {
837
- var xyz = convert$2.rgb.xyz(rgb);
838
- var x = xyz[0];
839
- var y = xyz[1];
840
- var z = xyz[2];
841
- var l;
842
- var a;
843
- var b;
861
+ convert.keyword.rgb = function (keyword) {
862
+ return cssKeywords[keyword];
863
+ };
844
864
 
845
- x /= 95.047;
846
- y /= 100;
847
- z /= 108.883;
865
+ convert.rgb.xyz = function (rgb) {
866
+ var r = rgb[0] / 255;
867
+ var g = rgb[1] / 255;
868
+ var b = rgb[2] / 255;
848
869
 
849
- x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);
850
- y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);
851
- z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);
870
+ // assume sRGB
871
+ r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);
872
+ g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);
873
+ b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);
852
874
 
853
- l = (116 * y) - 16;
854
- a = 500 * (x - y);
855
- b = 200 * (y - z);
875
+ var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
876
+ var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
877
+ var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);
856
878
 
857
- return [l, a, b];
858
- };
879
+ return [x * 100, y * 100, z * 100];
880
+ };
859
881
 
860
- convert$2.hsl.rgb = function (hsl) {
861
- var h = hsl[0] / 360;
862
- var s = hsl[1] / 100;
863
- var l = hsl[2] / 100;
864
- var t1;
865
- var t2;
866
- var t3;
867
- var rgb;
868
- var val;
869
-
870
- if (s === 0) {
871
- val = l * 255;
872
- return [val, val, val];
873
- }
882
+ convert.rgb.lab = function (rgb) {
883
+ var xyz = convert.rgb.xyz(rgb);
884
+ var x = xyz[0];
885
+ var y = xyz[1];
886
+ var z = xyz[2];
887
+ var l;
888
+ var a;
889
+ var b;
874
890
 
875
- if (l < 0.5) {
876
- t2 = l * (1 + s);
877
- } else {
878
- t2 = l + s - l * s;
879
- }
891
+ x /= 95.047;
892
+ y /= 100;
893
+ z /= 108.883;
880
894
 
881
- t1 = 2 * l - t2;
895
+ x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);
896
+ y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);
897
+ z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);
882
898
 
883
- rgb = [0, 0, 0];
884
- for (var i = 0; i < 3; i++) {
885
- t3 = h + 1 / 3 * -(i - 1);
886
- if (t3 < 0) {
887
- t3++;
888
- }
889
- if (t3 > 1) {
890
- t3--;
899
+ l = (116 * y) - 16;
900
+ a = 500 * (x - y);
901
+ b = 200 * (y - z);
902
+
903
+ return [l, a, b];
904
+ };
905
+
906
+ convert.hsl.rgb = function (hsl) {
907
+ var h = hsl[0] / 360;
908
+ var s = hsl[1] / 100;
909
+ var l = hsl[2] / 100;
910
+ var t1;
911
+ var t2;
912
+ var t3;
913
+ var rgb;
914
+ var val;
915
+
916
+ if (s === 0) {
917
+ val = l * 255;
918
+ return [val, val, val];
891
919
  }
892
920
 
893
- if (6 * t3 < 1) {
894
- val = t1 + (t2 - t1) * 6 * t3;
895
- } else if (2 * t3 < 1) {
896
- val = t2;
897
- } else if (3 * t3 < 2) {
898
- val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
921
+ if (l < 0.5) {
922
+ t2 = l * (1 + s);
899
923
  } else {
900
- val = t1;
924
+ t2 = l + s - l * s;
901
925
  }
902
926
 
903
- rgb[i] = val * 255;
904
- }
927
+ t1 = 2 * l - t2;
905
928
 
906
- return rgb;
907
- };
908
-
909
- convert$2.hsl.hsv = function (hsl) {
910
- var h = hsl[0];
911
- var s = hsl[1] / 100;
912
- var l = hsl[2] / 100;
913
- var smin = s;
914
- var lmin = Math.max(l, 0.01);
915
- var sv;
916
- var v;
917
-
918
- l *= 2;
919
- s *= (l <= 1) ? l : 2 - l;
920
- smin *= lmin <= 1 ? lmin : 2 - lmin;
921
- v = (l + s) / 2;
922
- sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
923
-
924
- return [h, sv * 100, v * 100];
925
- };
929
+ rgb = [0, 0, 0];
930
+ for (var i = 0; i < 3; i++) {
931
+ t3 = h + 1 / 3 * -(i - 1);
932
+ if (t3 < 0) {
933
+ t3++;
934
+ }
935
+ if (t3 > 1) {
936
+ t3--;
937
+ }
926
938
 
927
- convert$2.hsv.rgb = function (hsv) {
928
- var h = hsv[0] / 60;
929
- var s = hsv[1] / 100;
930
- var v = hsv[2] / 100;
931
- var hi = Math.floor(h) % 6;
932
-
933
- var f = h - Math.floor(h);
934
- var p = 255 * v * (1 - s);
935
- var q = 255 * v * (1 - (s * f));
936
- var t = 255 * v * (1 - (s * (1 - f)));
937
- v *= 255;
938
-
939
- switch (hi) {
940
- case 0:
941
- return [v, t, p];
942
- case 1:
943
- return [q, v, p];
944
- case 2:
945
- return [p, v, t];
946
- case 3:
947
- return [p, q, v];
948
- case 4:
949
- return [t, p, v];
950
- case 5:
951
- return [v, p, q];
952
- }
953
- };
939
+ if (6 * t3 < 1) {
940
+ val = t1 + (t2 - t1) * 6 * t3;
941
+ } else if (2 * t3 < 1) {
942
+ val = t2;
943
+ } else if (3 * t3 < 2) {
944
+ val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
945
+ } else {
946
+ val = t1;
947
+ }
954
948
 
955
- convert$2.hsv.hsl = function (hsv) {
956
- var h = hsv[0];
957
- var s = hsv[1] / 100;
958
- var v = hsv[2] / 100;
959
- var vmin = Math.max(v, 0.01);
960
- var lmin;
961
- var sl;
962
- var l;
963
-
964
- l = (2 - s) * v;
965
- lmin = (2 - s) * vmin;
966
- sl = s * vmin;
967
- sl /= (lmin <= 1) ? lmin : 2 - lmin;
968
- sl = sl || 0;
969
- l /= 2;
970
-
971
- return [h, sl * 100, l * 100];
972
- };
949
+ rgb[i] = val * 255;
950
+ }
973
951
 
974
- // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
975
- convert$2.hwb.rgb = function (hwb) {
976
- var h = hwb[0] / 360;
977
- var wh = hwb[1] / 100;
978
- var bl = hwb[2] / 100;
979
- var ratio = wh + bl;
980
- var i;
981
- var v;
982
- var f;
983
- var n;
984
-
985
- // wh + bl cant be > 1
986
- if (ratio > 1) {
987
- wh /= ratio;
988
- bl /= ratio;
989
- }
952
+ return rgb;
953
+ };
990
954
 
991
- i = Math.floor(6 * h);
992
- v = 1 - bl;
993
- f = 6 * h - i;
955
+ convert.hsl.hsv = function (hsl) {
956
+ var h = hsl[0];
957
+ var s = hsl[1] / 100;
958
+ var l = hsl[2] / 100;
959
+ var smin = s;
960
+ var lmin = Math.max(l, 0.01);
961
+ var sv;
962
+ var v;
963
+
964
+ l *= 2;
965
+ s *= (l <= 1) ? l : 2 - l;
966
+ smin *= lmin <= 1 ? lmin : 2 - lmin;
967
+ v = (l + s) / 2;
968
+ sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
969
+
970
+ return [h, sv * 100, v * 100];
971
+ };
994
972
 
995
- if ((i & 0x01) !== 0) {
996
- f = 1 - f;
997
- }
973
+ convert.hsv.rgb = function (hsv) {
974
+ var h = hsv[0] / 60;
975
+ var s = hsv[1] / 100;
976
+ var v = hsv[2] / 100;
977
+ var hi = Math.floor(h) % 6;
978
+
979
+ var f = h - Math.floor(h);
980
+ var p = 255 * v * (1 - s);
981
+ var q = 255 * v * (1 - (s * f));
982
+ var t = 255 * v * (1 - (s * (1 - f)));
983
+ v *= 255;
984
+
985
+ switch (hi) {
986
+ case 0:
987
+ return [v, t, p];
988
+ case 1:
989
+ return [q, v, p];
990
+ case 2:
991
+ return [p, v, t];
992
+ case 3:
993
+ return [p, q, v];
994
+ case 4:
995
+ return [t, p, v];
996
+ case 5:
997
+ return [v, p, q];
998
+ }
999
+ };
998
1000
 
999
- n = wh + f * (v - wh); // linear interpolation
1000
-
1001
- var r;
1002
- var g;
1003
- var b;
1004
- switch (i) {
1005
- default:
1006
- case 6:
1007
- case 0: r = v; g = n; b = wh; break;
1008
- case 1: r = n; g = v; b = wh; break;
1009
- case 2: r = wh; g = v; b = n; break;
1010
- case 3: r = wh; g = n; b = v; break;
1011
- case 4: r = n; g = wh; b = v; break;
1012
- case 5: r = v; g = wh; b = n; break;
1013
- }
1001
+ convert.hsv.hsl = function (hsv) {
1002
+ var h = hsv[0];
1003
+ var s = hsv[1] / 100;
1004
+ var v = hsv[2] / 100;
1005
+ var vmin = Math.max(v, 0.01);
1006
+ var lmin;
1007
+ var sl;
1008
+ var l;
1009
+
1010
+ l = (2 - s) * v;
1011
+ lmin = (2 - s) * vmin;
1012
+ sl = s * vmin;
1013
+ sl /= (lmin <= 1) ? lmin : 2 - lmin;
1014
+ sl = sl || 0;
1015
+ l /= 2;
1016
+
1017
+ return [h, sl * 100, l * 100];
1018
+ };
1014
1019
 
1015
- return [r * 255, g * 255, b * 255];
1016
- };
1020
+ // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
1021
+ convert.hwb.rgb = function (hwb) {
1022
+ var h = hwb[0] / 360;
1023
+ var wh = hwb[1] / 100;
1024
+ var bl = hwb[2] / 100;
1025
+ var ratio = wh + bl;
1026
+ var i;
1027
+ var v;
1028
+ var f;
1029
+ var n;
1030
+
1031
+ // wh + bl cant be > 1
1032
+ if (ratio > 1) {
1033
+ wh /= ratio;
1034
+ bl /= ratio;
1035
+ }
1017
1036
 
1018
- convert$2.cmyk.rgb = function (cmyk) {
1019
- var c = cmyk[0] / 100;
1020
- var m = cmyk[1] / 100;
1021
- var y = cmyk[2] / 100;
1022
- var k = cmyk[3] / 100;
1023
- var r;
1024
- var g;
1025
- var b;
1037
+ i = Math.floor(6 * h);
1038
+ v = 1 - bl;
1039
+ f = 6 * h - i;
1026
1040
 
1027
- r = 1 - Math.min(1, c * (1 - k) + k);
1028
- g = 1 - Math.min(1, m * (1 - k) + k);
1029
- b = 1 - Math.min(1, y * (1 - k) + k);
1041
+ if ((i & 0x01) !== 0) {
1042
+ f = 1 - f;
1043
+ }
1030
1044
 
1031
- return [r * 255, g * 255, b * 255];
1032
- };
1045
+ n = wh + f * (v - wh); // linear interpolation
1046
+
1047
+ var r;
1048
+ var g;
1049
+ var b;
1050
+ switch (i) {
1051
+ default:
1052
+ case 6:
1053
+ case 0: r = v; g = n; b = wh; break;
1054
+ case 1: r = n; g = v; b = wh; break;
1055
+ case 2: r = wh; g = v; b = n; break;
1056
+ case 3: r = wh; g = n; b = v; break;
1057
+ case 4: r = n; g = wh; b = v; break;
1058
+ case 5: r = v; g = wh; b = n; break;
1059
+ }
1033
1060
 
1034
- convert$2.xyz.rgb = function (xyz) {
1035
- var x = xyz[0] / 100;
1036
- var y = xyz[1] / 100;
1037
- var z = xyz[2] / 100;
1038
- var r;
1039
- var g;
1040
- var b;
1061
+ return [r * 255, g * 255, b * 255];
1062
+ };
1041
1063
 
1042
- r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
1043
- g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
1044
- b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);
1064
+ convert.cmyk.rgb = function (cmyk) {
1065
+ var c = cmyk[0] / 100;
1066
+ var m = cmyk[1] / 100;
1067
+ var y = cmyk[2] / 100;
1068
+ var k = cmyk[3] / 100;
1069
+ var r;
1070
+ var g;
1071
+ var b;
1045
1072
 
1046
- // assume sRGB
1047
- r = r > 0.0031308
1048
- ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)
1049
- : r * 12.92;
1073
+ r = 1 - Math.min(1, c * (1 - k) + k);
1074
+ g = 1 - Math.min(1, m * (1 - k) + k);
1075
+ b = 1 - Math.min(1, y * (1 - k) + k);
1050
1076
 
1051
- g = g > 0.0031308
1052
- ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)
1053
- : g * 12.92;
1077
+ return [r * 255, g * 255, b * 255];
1078
+ };
1054
1079
 
1055
- b = b > 0.0031308
1056
- ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)
1057
- : b * 12.92;
1080
+ convert.xyz.rgb = function (xyz) {
1081
+ var x = xyz[0] / 100;
1082
+ var y = xyz[1] / 100;
1083
+ var z = xyz[2] / 100;
1084
+ var r;
1085
+ var g;
1086
+ var b;
1058
1087
 
1059
- r = Math.min(Math.max(0, r), 1);
1060
- g = Math.min(Math.max(0, g), 1);
1061
- b = Math.min(Math.max(0, b), 1);
1088
+ r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
1089
+ g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
1090
+ b = (x * 0.0557) + (y * -0.204) + (z * 1.0570);
1062
1091
 
1063
- return [r * 255, g * 255, b * 255];
1064
- };
1092
+ // assume sRGB
1093
+ r = r > 0.0031308
1094
+ ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)
1095
+ : r * 12.92;
1065
1096
 
1066
- convert$2.xyz.lab = function (xyz) {
1067
- var x = xyz[0];
1068
- var y = xyz[1];
1069
- var z = xyz[2];
1070
- var l;
1071
- var a;
1072
- var b;
1097
+ g = g > 0.0031308
1098
+ ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)
1099
+ : g * 12.92;
1073
1100
 
1074
- x /= 95.047;
1075
- y /= 100;
1076
- z /= 108.883;
1101
+ b = b > 0.0031308
1102
+ ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)
1103
+ : b * 12.92;
1077
1104
 
1078
- x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);
1079
- y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);
1080
- z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);
1105
+ r = Math.min(Math.max(0, r), 1);
1106
+ g = Math.min(Math.max(0, g), 1);
1107
+ b = Math.min(Math.max(0, b), 1);
1081
1108
 
1082
- l = (116 * y) - 16;
1083
- a = 500 * (x - y);
1084
- b = 200 * (y - z);
1109
+ return [r * 255, g * 255, b * 255];
1110
+ };
1085
1111
 
1086
- return [l, a, b];
1087
- };
1112
+ convert.xyz.lab = function (xyz) {
1113
+ var x = xyz[0];
1114
+ var y = xyz[1];
1115
+ var z = xyz[2];
1116
+ var l;
1117
+ var a;
1118
+ var b;
1088
1119
 
1089
- convert$2.lab.xyz = function (lab) {
1090
- var l = lab[0];
1091
- var a = lab[1];
1092
- var b = lab[2];
1093
- var x;
1094
- var y;
1095
- var z;
1096
-
1097
- y = (l + 16) / 116;
1098
- x = a / 500 + y;
1099
- z = y - b / 200;
1100
-
1101
- var y2 = Math.pow(y, 3);
1102
- var x2 = Math.pow(x, 3);
1103
- var z2 = Math.pow(z, 3);
1104
- y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
1105
- x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
1106
- z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
1107
-
1108
- x *= 95.047;
1109
- y *= 100;
1110
- z *= 108.883;
1111
-
1112
- return [x, y, z];
1113
- };
1120
+ x /= 95.047;
1121
+ y /= 100;
1122
+ z /= 108.883;
1114
1123
 
1115
- convert$2.lab.lch = function (lab) {
1116
- var l = lab[0];
1117
- var a = lab[1];
1118
- var b = lab[2];
1119
- var hr;
1120
- var h;
1121
- var c;
1124
+ x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);
1125
+ y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);
1126
+ z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);
1122
1127
 
1123
- hr = Math.atan2(b, a);
1124
- h = hr * 360 / 2 / Math.PI;
1128
+ l = (116 * y) - 16;
1129
+ a = 500 * (x - y);
1130
+ b = 200 * (y - z);
1125
1131
 
1126
- if (h < 0) {
1127
- h += 360;
1128
- }
1132
+ return [l, a, b];
1133
+ };
1129
1134
 
1130
- c = Math.sqrt(a * a + b * b);
1135
+ convert.lab.xyz = function (lab) {
1136
+ var l = lab[0];
1137
+ var a = lab[1];
1138
+ var b = lab[2];
1139
+ var x;
1140
+ var y;
1141
+ var z;
1142
+
1143
+ y = (l + 16) / 116;
1144
+ x = a / 500 + y;
1145
+ z = y - b / 200;
1146
+
1147
+ var y2 = Math.pow(y, 3);
1148
+ var x2 = Math.pow(x, 3);
1149
+ var z2 = Math.pow(z, 3);
1150
+ y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
1151
+ x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
1152
+ z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
1153
+
1154
+ x *= 95.047;
1155
+ y *= 100;
1156
+ z *= 108.883;
1157
+
1158
+ return [x, y, z];
1159
+ };
1131
1160
 
1132
- return [l, c, h];
1133
- };
1161
+ convert.lab.lch = function (lab) {
1162
+ var l = lab[0];
1163
+ var a = lab[1];
1164
+ var b = lab[2];
1165
+ var hr;
1166
+ var h;
1167
+ var c;
1134
1168
 
1135
- convert$2.lch.lab = function (lch) {
1136
- var l = lch[0];
1137
- var c = lch[1];
1138
- var h = lch[2];
1139
- var a;
1140
- var b;
1141
- var hr;
1169
+ hr = Math.atan2(b, a);
1170
+ h = hr * 360 / 2 / Math.PI;
1142
1171
 
1143
- hr = h / 360 * 2 * Math.PI;
1144
- a = c * Math.cos(hr);
1145
- b = c * Math.sin(hr);
1172
+ if (h < 0) {
1173
+ h += 360;
1174
+ }
1146
1175
 
1147
- return [l, a, b];
1148
- };
1176
+ c = Math.sqrt(a * a + b * b);
1149
1177
 
1150
- convert$2.rgb.ansi16 = function (args) {
1151
- var r = args[0];
1152
- var g = args[1];
1153
- var b = args[2];
1154
- var value = 1 in arguments ? arguments[1] : convert$2.rgb.hsv(args)[2]; // hsv -> ansi16 optimization
1178
+ return [l, c, h];
1179
+ };
1155
1180
 
1156
- value = Math.round(value / 50);
1181
+ convert.lch.lab = function (lch) {
1182
+ var l = lch[0];
1183
+ var c = lch[1];
1184
+ var h = lch[2];
1185
+ var a;
1186
+ var b;
1187
+ var hr;
1157
1188
 
1158
- if (value === 0) {
1159
- return 30;
1160
- }
1189
+ hr = h / 360 * 2 * Math.PI;
1190
+ a = c * Math.cos(hr);
1191
+ b = c * Math.sin(hr);
1161
1192
 
1162
- var ansi = 30
1163
- + ((Math.round(b / 255) << 2)
1164
- | (Math.round(g / 255) << 1)
1165
- | Math.round(r / 255));
1193
+ return [l, a, b];
1194
+ };
1166
1195
 
1167
- if (value === 2) {
1168
- ansi += 60;
1169
- }
1196
+ convert.rgb.ansi16 = function (args) {
1197
+ var r = args[0];
1198
+ var g = args[1];
1199
+ var b = args[2];
1200
+ var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization
1170
1201
 
1171
- return ansi;
1172
- };
1202
+ value = Math.round(value / 50);
1173
1203
 
1174
- convert$2.hsv.ansi16 = function (args) {
1175
- // optimization here; we already know the value and don't need to get
1176
- // it converted for us.
1177
- return convert$2.rgb.ansi16(convert$2.hsv.rgb(args), args[2]);
1178
- };
1204
+ if (value === 0) {
1205
+ return 30;
1206
+ }
1179
1207
 
1180
- convert$2.rgb.ansi256 = function (args) {
1181
- var r = args[0];
1182
- var g = args[1];
1183
- var b = args[2];
1208
+ var ansi = 30
1209
+ + ((Math.round(b / 255) << 2)
1210
+ | (Math.round(g / 255) << 1)
1211
+ | Math.round(r / 255));
1184
1212
 
1185
- // we use the extended greyscale palette here, with the exception of
1186
- // black and white. normal palette only has 4 greyscale shades.
1187
- if (r === g && g === b) {
1188
- if (r < 8) {
1189
- return 16;
1213
+ if (value === 2) {
1214
+ ansi += 60;
1190
1215
  }
1191
1216
 
1192
- if (r > 248) {
1193
- return 231;
1194
- }
1217
+ return ansi;
1218
+ };
1195
1219
 
1196
- return Math.round(((r - 8) / 247) * 24) + 232;
1197
- }
1220
+ convert.hsv.ansi16 = function (args) {
1221
+ // optimization here; we already know the value and don't need to get
1222
+ // it converted for us.
1223
+ return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
1224
+ };
1198
1225
 
1199
- var ansi = 16
1200
- + (36 * Math.round(r / 255 * 5))
1201
- + (6 * Math.round(g / 255 * 5))
1202
- + Math.round(b / 255 * 5);
1226
+ convert.rgb.ansi256 = function (args) {
1227
+ var r = args[0];
1228
+ var g = args[1];
1229
+ var b = args[2];
1203
1230
 
1204
- return ansi;
1205
- };
1231
+ // we use the extended greyscale palette here, with the exception of
1232
+ // black and white. normal palette only has 4 greyscale shades.
1233
+ if (r === g && g === b) {
1234
+ if (r < 8) {
1235
+ return 16;
1236
+ }
1206
1237
 
1207
- convert$2.ansi16.rgb = function (args) {
1208
- var color = args % 10;
1238
+ if (r > 248) {
1239
+ return 231;
1240
+ }
1209
1241
 
1210
- // handle greyscale
1211
- if (color === 0 || color === 7) {
1212
- if (args > 50) {
1213
- color += 3.5;
1242
+ return Math.round(((r - 8) / 247) * 24) + 232;
1214
1243
  }
1215
1244
 
1216
- color = color / 10.5 * 255;
1245
+ var ansi = 16
1246
+ + (36 * Math.round(r / 255 * 5))
1247
+ + (6 * Math.round(g / 255 * 5))
1248
+ + Math.round(b / 255 * 5);
1217
1249
 
1218
- return [color, color, color];
1219
- }
1250
+ return ansi;
1251
+ };
1220
1252
 
1221
- var mult = (~~(args > 50) + 1) * 0.5;
1222
- var r = ((color & 1) * mult) * 255;
1223
- var g = (((color >> 1) & 1) * mult) * 255;
1224
- var b = (((color >> 2) & 1) * mult) * 255;
1253
+ convert.ansi16.rgb = function (args) {
1254
+ var color = args % 10;
1225
1255
 
1226
- return [r, g, b];
1227
- };
1256
+ // handle greyscale
1257
+ if (color === 0 || color === 7) {
1258
+ if (args > 50) {
1259
+ color += 3.5;
1260
+ }
1228
1261
 
1229
- convert$2.ansi256.rgb = function (args) {
1230
- // handle greyscale
1231
- if (args >= 232) {
1232
- var c = (args - 232) * 10 + 8;
1233
- return [c, c, c];
1234
- }
1262
+ color = color / 10.5 * 255;
1235
1263
 
1236
- args -= 16;
1264
+ return [color, color, color];
1265
+ }
1237
1266
 
1238
- var rem;
1239
- var r = Math.floor(args / 36) / 5 * 255;
1240
- var g = Math.floor((rem = args % 36) / 6) / 5 * 255;
1241
- var b = (rem % 6) / 5 * 255;
1267
+ var mult = (~~(args > 50) + 1) * 0.5;
1268
+ var r = ((color & 1) * mult) * 255;
1269
+ var g = (((color >> 1) & 1) * mult) * 255;
1270
+ var b = (((color >> 2) & 1) * mult) * 255;
1242
1271
 
1243
- return [r, g, b];
1244
- };
1272
+ return [r, g, b];
1273
+ };
1245
1274
 
1246
- convert$2.rgb.hex = function (args) {
1247
- var integer = ((Math.round(args[0]) & 0xFF) << 16)
1248
- + ((Math.round(args[1]) & 0xFF) << 8)
1249
- + (Math.round(args[2]) & 0xFF);
1275
+ convert.ansi256.rgb = function (args) {
1276
+ // handle greyscale
1277
+ if (args >= 232) {
1278
+ var c = (args - 232) * 10 + 8;
1279
+ return [c, c, c];
1280
+ }
1250
1281
 
1251
- var string = integer.toString(16).toUpperCase();
1252
- return '000000'.substring(string.length) + string;
1253
- };
1282
+ args -= 16;
1254
1283
 
1255
- convert$2.hex.rgb = function (args) {
1256
- var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
1257
- if (!match) {
1258
- return [0, 0, 0];
1259
- }
1284
+ var rem;
1285
+ var r = Math.floor(args / 36) / 5 * 255;
1286
+ var g = Math.floor((rem = args % 36) / 6) / 5 * 255;
1287
+ var b = (rem % 6) / 5 * 255;
1260
1288
 
1261
- var colorString = match[0];
1289
+ return [r, g, b];
1290
+ };
1262
1291
 
1263
- if (match[0].length === 3) {
1264
- colorString = colorString.split('').map(function (char) {
1265
- return char + char;
1266
- }).join('');
1267
- }
1292
+ convert.rgb.hex = function (args) {
1293
+ var integer = ((Math.round(args[0]) & 0xFF) << 16)
1294
+ + ((Math.round(args[1]) & 0xFF) << 8)
1295
+ + (Math.round(args[2]) & 0xFF);
1268
1296
 
1269
- var integer = parseInt(colorString, 16);
1270
- var r = (integer >> 16) & 0xFF;
1271
- var g = (integer >> 8) & 0xFF;
1272
- var b = integer & 0xFF;
1297
+ var string = integer.toString(16).toUpperCase();
1298
+ return '000000'.substring(string.length) + string;
1299
+ };
1273
1300
 
1274
- return [r, g, b];
1275
- };
1301
+ convert.hex.rgb = function (args) {
1302
+ var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
1303
+ if (!match) {
1304
+ return [0, 0, 0];
1305
+ }
1276
1306
 
1277
- convert$2.rgb.hcg = function (rgb) {
1278
- var r = rgb[0] / 255;
1279
- var g = rgb[1] / 255;
1280
- var b = rgb[2] / 255;
1281
- var max = Math.max(Math.max(r, g), b);
1282
- var min = Math.min(Math.min(r, g), b);
1283
- var chroma = (max - min);
1284
- var grayscale;
1285
- var hue;
1286
-
1287
- if (chroma < 1) {
1288
- grayscale = min / (1 - chroma);
1289
- } else {
1290
- grayscale = 0;
1291
- }
1307
+ var colorString = match[0];
1292
1308
 
1293
- if (chroma <= 0) {
1294
- hue = 0;
1295
- } else
1296
- if (max === r) {
1297
- hue = ((g - b) / chroma) % 6;
1298
- } else
1299
- if (max === g) {
1300
- hue = 2 + (b - r) / chroma;
1301
- } else {
1302
- hue = 4 + (r - g) / chroma + 4;
1303
- }
1309
+ if (match[0].length === 3) {
1310
+ colorString = colorString.split('').map(function (char) {
1311
+ return char + char;
1312
+ }).join('');
1313
+ }
1304
1314
 
1305
- hue /= 6;
1306
- hue %= 1;
1315
+ var integer = parseInt(colorString, 16);
1316
+ var r = (integer >> 16) & 0xFF;
1317
+ var g = (integer >> 8) & 0xFF;
1318
+ var b = integer & 0xFF;
1307
1319
 
1308
- return [hue * 360, chroma * 100, grayscale * 100];
1309
- };
1320
+ return [r, g, b];
1321
+ };
1310
1322
 
1311
- convert$2.hsl.hcg = function (hsl) {
1312
- var s = hsl[1] / 100;
1313
- var l = hsl[2] / 100;
1314
- var c = 1;
1315
- var f = 0;
1323
+ convert.rgb.hcg = function (rgb) {
1324
+ var r = rgb[0] / 255;
1325
+ var g = rgb[1] / 255;
1326
+ var b = rgb[2] / 255;
1327
+ var max = Math.max(Math.max(r, g), b);
1328
+ var min = Math.min(Math.min(r, g), b);
1329
+ var chroma = (max - min);
1330
+ var grayscale;
1331
+ var hue;
1332
+
1333
+ if (chroma < 1) {
1334
+ grayscale = min / (1 - chroma);
1335
+ } else {
1336
+ grayscale = 0;
1337
+ }
1316
1338
 
1317
- if (l < 0.5) {
1318
- c = 2.0 * s * l;
1319
- } else {
1320
- c = 2.0 * s * (1.0 - l);
1321
- }
1339
+ if (chroma <= 0) {
1340
+ hue = 0;
1341
+ } else
1342
+ if (max === r) {
1343
+ hue = ((g - b) / chroma) % 6;
1344
+ } else
1345
+ if (max === g) {
1346
+ hue = 2 + (b - r) / chroma;
1347
+ } else {
1348
+ hue = 4 + (r - g) / chroma + 4;
1349
+ }
1322
1350
 
1323
- if (c < 1.0) {
1324
- f = (l - 0.5 * c) / (1.0 - c);
1325
- }
1351
+ hue /= 6;
1352
+ hue %= 1;
1326
1353
 
1327
- return [hsl[0], c * 100, f * 100];
1328
- };
1354
+ return [hue * 360, chroma * 100, grayscale * 100];
1355
+ };
1329
1356
 
1330
- convert$2.hsv.hcg = function (hsv) {
1331
- var s = hsv[1] / 100;
1332
- var v = hsv[2] / 100;
1357
+ convert.hsl.hcg = function (hsl) {
1358
+ var s = hsl[1] / 100;
1359
+ var l = hsl[2] / 100;
1360
+ var c = 1;
1361
+ var f = 0;
1333
1362
 
1334
- var c = s * v;
1335
- var f = 0;
1363
+ if (l < 0.5) {
1364
+ c = 2.0 * s * l;
1365
+ } else {
1366
+ c = 2.0 * s * (1.0 - l);
1367
+ }
1336
1368
 
1337
- if (c < 1.0) {
1338
- f = (v - c) / (1 - c);
1339
- }
1369
+ if (c < 1.0) {
1370
+ f = (l - 0.5 * c) / (1.0 - c);
1371
+ }
1340
1372
 
1341
- return [hsv[0], c * 100, f * 100];
1342
- };
1373
+ return [hsl[0], c * 100, f * 100];
1374
+ };
1343
1375
 
1344
- convert$2.hcg.rgb = function (hcg) {
1345
- var h = hcg[0] / 360;
1346
- var c = hcg[1] / 100;
1347
- var g = hcg[2] / 100;
1376
+ convert.hsv.hcg = function (hsv) {
1377
+ var s = hsv[1] / 100;
1378
+ var v = hsv[2] / 100;
1348
1379
 
1349
- if (c === 0.0) {
1350
- return [g * 255, g * 255, g * 255];
1351
- }
1380
+ var c = s * v;
1381
+ var f = 0;
1352
1382
 
1353
- var pure = [0, 0, 0];
1354
- var hi = (h % 1) * 6;
1355
- var v = hi % 1;
1356
- var w = 1 - v;
1357
- var mg = 0;
1358
-
1359
- switch (Math.floor(hi)) {
1360
- case 0:
1361
- pure[0] = 1; pure[1] = v; pure[2] = 0; break;
1362
- case 1:
1363
- pure[0] = w; pure[1] = 1; pure[2] = 0; break;
1364
- case 2:
1365
- pure[0] = 0; pure[1] = 1; pure[2] = v; break;
1366
- case 3:
1367
- pure[0] = 0; pure[1] = w; pure[2] = 1; break;
1368
- case 4:
1369
- pure[0] = v; pure[1] = 0; pure[2] = 1; break;
1370
- default:
1371
- pure[0] = 1; pure[1] = 0; pure[2] = w;
1372
- }
1383
+ if (c < 1.0) {
1384
+ f = (v - c) / (1 - c);
1385
+ }
1373
1386
 
1374
- mg = (1.0 - c) * g;
1387
+ return [hsv[0], c * 100, f * 100];
1388
+ };
1375
1389
 
1376
- return [
1377
- (c * pure[0] + mg) * 255,
1378
- (c * pure[1] + mg) * 255,
1379
- (c * pure[2] + mg) * 255
1380
- ];
1381
- };
1390
+ convert.hcg.rgb = function (hcg) {
1391
+ var h = hcg[0] / 360;
1392
+ var c = hcg[1] / 100;
1393
+ var g = hcg[2] / 100;
1382
1394
 
1383
- convert$2.hcg.hsv = function (hcg) {
1384
- var c = hcg[1] / 100;
1385
- var g = hcg[2] / 100;
1395
+ if (c === 0.0) {
1396
+ return [g * 255, g * 255, g * 255];
1397
+ }
1386
1398
 
1387
- var v = c + g * (1.0 - c);
1388
- var f = 0;
1399
+ var pure = [0, 0, 0];
1400
+ var hi = (h % 1) * 6;
1401
+ var v = hi % 1;
1402
+ var w = 1 - v;
1403
+ var mg = 0;
1404
+
1405
+ switch (Math.floor(hi)) {
1406
+ case 0:
1407
+ pure[0] = 1; pure[1] = v; pure[2] = 0; break;
1408
+ case 1:
1409
+ pure[0] = w; pure[1] = 1; pure[2] = 0; break;
1410
+ case 2:
1411
+ pure[0] = 0; pure[1] = 1; pure[2] = v; break;
1412
+ case 3:
1413
+ pure[0] = 0; pure[1] = w; pure[2] = 1; break;
1414
+ case 4:
1415
+ pure[0] = v; pure[1] = 0; pure[2] = 1; break;
1416
+ default:
1417
+ pure[0] = 1; pure[1] = 0; pure[2] = w;
1418
+ }
1389
1419
 
1390
- if (v > 0.0) {
1391
- f = c / v;
1392
- }
1420
+ mg = (1.0 - c) * g;
1393
1421
 
1394
- return [hcg[0], f * 100, v * 100];
1395
- };
1422
+ return [
1423
+ (c * pure[0] + mg) * 255,
1424
+ (c * pure[1] + mg) * 255,
1425
+ (c * pure[2] + mg) * 255
1426
+ ];
1427
+ };
1396
1428
 
1397
- convert$2.hcg.hsl = function (hcg) {
1398
- var c = hcg[1] / 100;
1399
- var g = hcg[2] / 100;
1429
+ convert.hcg.hsv = function (hcg) {
1430
+ var c = hcg[1] / 100;
1431
+ var g = hcg[2] / 100;
1400
1432
 
1401
- var l = g * (1.0 - c) + 0.5 * c;
1402
- var s = 0;
1433
+ var v = c + g * (1.0 - c);
1434
+ var f = 0;
1403
1435
 
1404
- if (l > 0.0 && l < 0.5) {
1405
- s = c / (2 * l);
1406
- } else
1407
- if (l >= 0.5 && l < 1.0) {
1408
- s = c / (2 * (1 - l));
1409
- }
1436
+ if (v > 0.0) {
1437
+ f = c / v;
1438
+ }
1410
1439
 
1411
- return [hcg[0], s * 100, l * 100];
1412
- };
1440
+ return [hcg[0], f * 100, v * 100];
1441
+ };
1413
1442
 
1414
- convert$2.hcg.hwb = function (hcg) {
1415
- var c = hcg[1] / 100;
1416
- var g = hcg[2] / 100;
1417
- var v = c + g * (1.0 - c);
1418
- return [hcg[0], (v - c) * 100, (1 - v) * 100];
1419
- };
1443
+ convert.hcg.hsl = function (hcg) {
1444
+ var c = hcg[1] / 100;
1445
+ var g = hcg[2] / 100;
1420
1446
 
1421
- convert$2.hwb.hcg = function (hwb) {
1422
- var w = hwb[1] / 100;
1423
- var b = hwb[2] / 100;
1424
- var v = 1 - b;
1425
- var c = v - w;
1426
- var g = 0;
1447
+ var l = g * (1.0 - c) + 0.5 * c;
1448
+ var s = 0;
1427
1449
 
1428
- if (c < 1) {
1429
- g = (v - c) / (1 - c);
1430
- }
1450
+ if (l > 0.0 && l < 0.5) {
1451
+ s = c / (2 * l);
1452
+ } else
1453
+ if (l >= 0.5 && l < 1.0) {
1454
+ s = c / (2 * (1 - l));
1455
+ }
1431
1456
 
1432
- return [hwb[0], c * 100, g * 100];
1433
- };
1457
+ return [hcg[0], s * 100, l * 100];
1458
+ };
1434
1459
 
1435
- convert$2.apple.rgb = function (apple) {
1436
- return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];
1437
- };
1460
+ convert.hcg.hwb = function (hcg) {
1461
+ var c = hcg[1] / 100;
1462
+ var g = hcg[2] / 100;
1463
+ var v = c + g * (1.0 - c);
1464
+ return [hcg[0], (v - c) * 100, (1 - v) * 100];
1465
+ };
1438
1466
 
1439
- convert$2.rgb.apple = function (rgb) {
1440
- return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];
1441
- };
1467
+ convert.hwb.hcg = function (hwb) {
1468
+ var w = hwb[1] / 100;
1469
+ var b = hwb[2] / 100;
1470
+ var v = 1 - b;
1471
+ var c = v - w;
1472
+ var g = 0;
1442
1473
 
1443
- convert$2.gray.rgb = function (args) {
1444
- return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
1445
- };
1474
+ if (c < 1) {
1475
+ g = (v - c) / (1 - c);
1476
+ }
1446
1477
 
1447
- convert$2.gray.hsl = convert$2.gray.hsv = function (args) {
1448
- return [0, 0, args[0]];
1449
- };
1478
+ return [hwb[0], c * 100, g * 100];
1479
+ };
1450
1480
 
1451
- convert$2.gray.hwb = function (gray) {
1452
- return [0, 100, gray[0]];
1453
- };
1481
+ convert.apple.rgb = function (apple) {
1482
+ return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];
1483
+ };
1454
1484
 
1455
- convert$2.gray.cmyk = function (gray) {
1456
- return [0, 0, 0, gray[0]];
1457
- };
1485
+ convert.rgb.apple = function (rgb) {
1486
+ return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];
1487
+ };
1458
1488
 
1459
- convert$2.gray.lab = function (gray) {
1460
- return [gray[0], 0, 0];
1461
- };
1489
+ convert.gray.rgb = function (args) {
1490
+ return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
1491
+ };
1462
1492
 
1463
- convert$2.gray.hex = function (gray) {
1464
- var val = Math.round(gray[0] / 100 * 255) & 0xFF;
1465
- var integer = (val << 16) + (val << 8) + val;
1493
+ convert.gray.hsl = convert.gray.hsv = function (args) {
1494
+ return [0, 0, args[0]];
1495
+ };
1466
1496
 
1467
- var string = integer.toString(16).toUpperCase();
1468
- return '000000'.substring(string.length) + string;
1469
- };
1497
+ convert.gray.hwb = function (gray) {
1498
+ return [0, 100, gray[0]];
1499
+ };
1470
1500
 
1471
- convert$2.rgb.gray = function (rgb) {
1472
- var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
1473
- return [val / 255 * 100];
1474
- };
1501
+ convert.gray.cmyk = function (gray) {
1502
+ return [0, 0, 0, gray[0]];
1503
+ };
1475
1504
 
1476
- var conversions$1 = conversions$2.exports;
1505
+ convert.gray.lab = function (gray) {
1506
+ return [gray[0], 0, 0];
1507
+ };
1477
1508
 
1478
- /*
1479
- this function routes a model to all other models.
1509
+ convert.gray.hex = function (gray) {
1510
+ var val = Math.round(gray[0] / 100 * 255) & 0xFF;
1511
+ var integer = (val << 16) + (val << 8) + val;
1480
1512
 
1481
- all functions that are routed have a property `.conversion` attached
1482
- to the returned synthetic function. This property is an array
1483
- of strings, each with the steps in between the 'from' and 'to'
1484
- color models (inclusive).
1513
+ var string = integer.toString(16).toUpperCase();
1514
+ return '000000'.substring(string.length) + string;
1515
+ };
1485
1516
 
1486
- conversions that are not possible simply are not included.
1487
- */
1517
+ convert.rgb.gray = function (rgb) {
1518
+ var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
1519
+ return [val / 255 * 100];
1520
+ };
1521
+ return conversions.exports;
1522
+ }
1488
1523
 
1489
- function buildGraph() {
1490
- var graph = {};
1491
- // https://jsperf.com/object-keys-vs-for-in-with-closure/3
1492
- var models = Object.keys(conversions$1);
1524
+ var route;
1525
+ var hasRequiredRoute;
1526
+
1527
+ function requireRoute () {
1528
+ if (hasRequiredRoute) return route;
1529
+ hasRequiredRoute = 1;
1530
+ var conversions = requireConversions();
1531
+
1532
+ /*
1533
+ this function routes a model to all other models.
1534
+
1535
+ all functions that are routed have a property `.conversion` attached
1536
+ to the returned synthetic function. This property is an array
1537
+ of strings, each with the steps in between the 'from' and 'to'
1538
+ color models (inclusive).
1539
+
1540
+ conversions that are not possible simply are not included.
1541
+ */
1542
+
1543
+ function buildGraph() {
1544
+ var graph = {};
1545
+ // https://jsperf.com/object-keys-vs-for-in-with-closure/3
1546
+ var models = Object.keys(conversions);
1547
+
1548
+ for (var len = models.length, i = 0; i < len; i++) {
1549
+ graph[models[i]] = {
1550
+ // http://jsperf.com/1-vs-infinity
1551
+ // micro-opt, but this is simple.
1552
+ distance: -1,
1553
+ parent: null
1554
+ };
1555
+ }
1493
1556
 
1494
- for (var len = models.length, i = 0; i < len; i++) {
1495
- graph[models[i]] = {
1496
- // http://jsperf.com/1-vs-infinity
1497
- // micro-opt, but this is simple.
1498
- distance: -1,
1499
- parent: null
1500
- };
1557
+ return graph;
1501
1558
  }
1502
1559
 
1503
- return graph;
1504
- }
1560
+ // https://en.wikipedia.org/wiki/Breadth-first_search
1561
+ function deriveBFS(fromModel) {
1562
+ var graph = buildGraph();
1563
+ var queue = [fromModel]; // unshift -> queue -> pop
1505
1564
 
1506
- // https://en.wikipedia.org/wiki/Breadth-first_search
1507
- function deriveBFS(fromModel) {
1508
- var graph = buildGraph();
1509
- var queue = [fromModel]; // unshift -> queue -> pop
1565
+ graph[fromModel].distance = 0;
1510
1566
 
1511
- graph[fromModel].distance = 0;
1567
+ while (queue.length) {
1568
+ var current = queue.pop();
1569
+ var adjacents = Object.keys(conversions[current]);
1512
1570
 
1513
- while (queue.length) {
1514
- var current = queue.pop();
1515
- var adjacents = Object.keys(conversions$1[current]);
1571
+ for (var len = adjacents.length, i = 0; i < len; i++) {
1572
+ var adjacent = adjacents[i];
1573
+ var node = graph[adjacent];
1516
1574
 
1517
- for (var len = adjacents.length, i = 0; i < len; i++) {
1518
- var adjacent = adjacents[i];
1519
- var node = graph[adjacent];
1520
-
1521
- if (node.distance === -1) {
1522
- node.distance = graph[current].distance + 1;
1523
- node.parent = current;
1524
- queue.unshift(adjacent);
1575
+ if (node.distance === -1) {
1576
+ node.distance = graph[current].distance + 1;
1577
+ node.parent = current;
1578
+ queue.unshift(adjacent);
1579
+ }
1525
1580
  }
1526
1581
  }
1582
+
1583
+ return graph;
1527
1584
  }
1528
1585
 
1529
- return graph;
1530
- }
1586
+ function link(from, to) {
1587
+ return function (args) {
1588
+ return to(from(args));
1589
+ };
1590
+ }
1531
1591
 
1532
- function link(from, to) {
1533
- return function (args) {
1534
- return to(from(args));
1535
- };
1536
- }
1592
+ function wrapConversion(toModel, graph) {
1593
+ var path = [graph[toModel].parent, toModel];
1594
+ var fn = conversions[graph[toModel].parent][toModel];
1537
1595
 
1538
- function wrapConversion(toModel, graph) {
1539
- var path = [graph[toModel].parent, toModel];
1540
- var fn = conversions$1[graph[toModel].parent][toModel];
1596
+ var cur = graph[toModel].parent;
1597
+ while (graph[cur].parent) {
1598
+ path.unshift(graph[cur].parent);
1599
+ fn = link(conversions[graph[cur].parent][cur], fn);
1600
+ cur = graph[cur].parent;
1601
+ }
1541
1602
 
1542
- var cur = graph[toModel].parent;
1543
- while (graph[cur].parent) {
1544
- path.unshift(graph[cur].parent);
1545
- fn = link(conversions$1[graph[cur].parent][cur], fn);
1546
- cur = graph[cur].parent;
1603
+ fn.conversion = path;
1604
+ return fn;
1547
1605
  }
1548
1606
 
1549
- fn.conversion = path;
1550
- return fn;
1551
- }
1607
+ route = function (fromModel) {
1608
+ var graph = deriveBFS(fromModel);
1609
+ var conversion = {};
1552
1610
 
1553
- var route$1 = function (fromModel) {
1554
- var graph = deriveBFS(fromModel);
1555
- var conversion = {};
1611
+ var models = Object.keys(graph);
1612
+ for (var len = models.length, i = 0; i < len; i++) {
1613
+ var toModel = models[i];
1614
+ var node = graph[toModel];
1556
1615
 
1557
- var models = Object.keys(graph);
1558
- for (var len = models.length, i = 0; i < len; i++) {
1559
- var toModel = models[i];
1560
- var node = graph[toModel];
1616
+ if (node.parent === null) {
1617
+ // no possible conversion, or this node is the source model.
1618
+ continue;
1619
+ }
1561
1620
 
1562
- if (node.parent === null) {
1563
- // no possible conversion, or this node is the source model.
1564
- continue;
1621
+ conversion[toModel] = wrapConversion(toModel, graph);
1565
1622
  }
1566
1623
 
1567
- conversion[toModel] = wrapConversion(toModel, graph);
1568
- }
1624
+ return conversion;
1625
+ };
1626
+ return route;
1627
+ }
1569
1628
 
1570
- return conversion;
1571
- };
1629
+ var colorConvert;
1630
+ var hasRequiredColorConvert;
1572
1631
 
1573
- var conversions = conversions$2.exports;
1574
- var route = route$1;
1632
+ function requireColorConvert () {
1633
+ if (hasRequiredColorConvert) return colorConvert;
1634
+ hasRequiredColorConvert = 1;
1635
+ var conversions = requireConversions();
1636
+ var route = requireRoute();
1575
1637
 
1576
- var convert$1 = {};
1638
+ var convert = {};
1577
1639
 
1578
- var models = Object.keys(conversions);
1640
+ var models = Object.keys(conversions);
1579
1641
 
1580
- function wrapRaw(fn) {
1581
- var wrappedFn = function (args) {
1582
- if (args === undefined || args === null) {
1583
- return args;
1584
- }
1642
+ function wrapRaw(fn) {
1643
+ var wrappedFn = function (args) {
1644
+ if (args === undefined || args === null) {
1645
+ return args;
1646
+ }
1585
1647
 
1586
- if (arguments.length > 1) {
1587
- args = Array.prototype.slice.call(arguments);
1588
- }
1648
+ if (arguments.length > 1) {
1649
+ args = Array.prototype.slice.call(arguments);
1650
+ }
1589
1651
 
1590
- return fn(args);
1591
- };
1652
+ return fn(args);
1653
+ };
1592
1654
 
1593
- // preserve .conversion property if there is one
1594
- if ('conversion' in fn) {
1595
- wrappedFn.conversion = fn.conversion;
1596
- }
1655
+ // preserve .conversion property if there is one
1656
+ if ('conversion' in fn) {
1657
+ wrappedFn.conversion = fn.conversion;
1658
+ }
1597
1659
 
1598
- return wrappedFn;
1599
- }
1660
+ return wrappedFn;
1661
+ }
1600
1662
 
1601
- function wrapRounded(fn) {
1602
- var wrappedFn = function (args) {
1603
- if (args === undefined || args === null) {
1604
- return args;
1605
- }
1663
+ function wrapRounded(fn) {
1664
+ var wrappedFn = function (args) {
1665
+ if (args === undefined || args === null) {
1666
+ return args;
1667
+ }
1606
1668
 
1607
- if (arguments.length > 1) {
1608
- args = Array.prototype.slice.call(arguments);
1609
- }
1669
+ if (arguments.length > 1) {
1670
+ args = Array.prototype.slice.call(arguments);
1671
+ }
1610
1672
 
1611
- var result = fn(args);
1673
+ var result = fn(args);
1612
1674
 
1613
- // we're assuming the result is an array here.
1614
- // see notice in conversions.js; don't use box types
1615
- // in conversion functions.
1616
- if (typeof result === 'object') {
1617
- for (var len = result.length, i = 0; i < len; i++) {
1618
- result[i] = Math.round(result[i]);
1675
+ // we're assuming the result is an array here.
1676
+ // see notice in conversions.js; don't use box types
1677
+ // in conversion functions.
1678
+ if (typeof result === 'object') {
1679
+ for (var len = result.length, i = 0; i < len; i++) {
1680
+ result[i] = Math.round(result[i]);
1681
+ }
1619
1682
  }
1620
- }
1621
1683
 
1622
- return result;
1623
- };
1684
+ return result;
1685
+ };
1624
1686
 
1625
- // preserve .conversion property if there is one
1626
- if ('conversion' in fn) {
1627
- wrappedFn.conversion = fn.conversion;
1628
- }
1687
+ // preserve .conversion property if there is one
1688
+ if ('conversion' in fn) {
1689
+ wrappedFn.conversion = fn.conversion;
1690
+ }
1629
1691
 
1630
- return wrappedFn;
1631
- }
1692
+ return wrappedFn;
1693
+ }
1632
1694
 
1633
- models.forEach(function (fromModel) {
1634
- convert$1[fromModel] = {};
1695
+ models.forEach(function (fromModel) {
1696
+ convert[fromModel] = {};
1635
1697
 
1636
- Object.defineProperty(convert$1[fromModel], 'channels', {value: conversions[fromModel].channels});
1637
- Object.defineProperty(convert$1[fromModel], 'labels', {value: conversions[fromModel].labels});
1698
+ Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
1699
+ Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
1638
1700
 
1639
- var routes = route(fromModel);
1640
- var routeModels = Object.keys(routes);
1701
+ var routes = route(fromModel);
1702
+ var routeModels = Object.keys(routes);
1641
1703
 
1642
- routeModels.forEach(function (toModel) {
1643
- var fn = routes[toModel];
1704
+ routeModels.forEach(function (toModel) {
1705
+ var fn = routes[toModel];
1644
1706
 
1645
- convert$1[fromModel][toModel] = wrapRounded(fn);
1646
- convert$1[fromModel][toModel].raw = wrapRaw(fn);
1707
+ convert[fromModel][toModel] = wrapRounded(fn);
1708
+ convert[fromModel][toModel].raw = wrapRaw(fn);
1709
+ });
1647
1710
  });
1648
- });
1649
1711
 
1650
- var colorConvert = convert$1;
1712
+ colorConvert = convert;
1713
+ return colorConvert;
1714
+ }
1651
1715
 
1652
- var colorString = colorString$1.exports;
1653
- var convert = colorConvert;
1716
+ var color;
1717
+ var hasRequiredColor;
1654
1718
 
1655
- var _slice = [].slice;
1719
+ function requireColor () {
1720
+ if (hasRequiredColor) return color;
1721
+ hasRequiredColor = 1;
1656
1722
 
1657
- var skippedModels = [
1658
- // to be honest, I don't really feel like keyword belongs in color convert, but eh.
1659
- 'keyword',
1723
+ var colorString = requireColorString();
1724
+ var convert = requireColorConvert();
1660
1725
 
1661
- // gray conflicts with some method names, and has its own method defined.
1662
- 'gray',
1726
+ var _slice = [].slice;
1663
1727
 
1664
- // shouldn't really be in color-convert either...
1665
- 'hex'
1666
- ];
1728
+ var skippedModels = [
1729
+ // to be honest, I don't really feel like keyword belongs in color convert, but eh.
1730
+ 'keyword',
1667
1731
 
1668
- var hashedModelKeys = {};
1669
- Object.keys(convert).forEach(function (model) {
1670
- hashedModelKeys[_slice.call(convert[model].labels).sort().join('')] = model;
1671
- });
1732
+ // gray conflicts with some method names, and has its own method defined.
1733
+ 'gray',
1672
1734
 
1673
- var limiters = {};
1735
+ // shouldn't really be in color-convert either...
1736
+ 'hex'
1737
+ ];
1674
1738
 
1675
- function Color(obj, model) {
1676
- if (!(this instanceof Color)) {
1677
- return new Color(obj, model);
1678
- }
1739
+ var hashedModelKeys = {};
1740
+ Object.keys(convert).forEach(function (model) {
1741
+ hashedModelKeys[_slice.call(convert[model].labels).sort().join('')] = model;
1742
+ });
1679
1743
 
1680
- if (model && model in skippedModels) {
1681
- model = null;
1682
- }
1744
+ var limiters = {};
1683
1745
 
1684
- if (model && !(model in convert)) {
1685
- throw new Error('Unknown model: ' + model);
1686
- }
1687
-
1688
- var i;
1689
- var channels;
1690
-
1691
- if (obj == null) { // eslint-disable-line no-eq-null,eqeqeq
1692
- this.model = 'rgb';
1693
- this.color = [0, 0, 0];
1694
- this.valpha = 1;
1695
- } else if (obj instanceof Color) {
1696
- this.model = obj.model;
1697
- this.color = obj.color.slice();
1698
- this.valpha = obj.valpha;
1699
- } else if (typeof obj === 'string') {
1700
- var result = colorString.get(obj);
1701
- if (result === null) {
1702
- throw new Error('Unable to parse color from string: ' + obj);
1746
+ function Color(obj, model) {
1747
+ if (!(this instanceof Color)) {
1748
+ return new Color(obj, model);
1703
1749
  }
1704
1750
 
1705
- this.model = result.model;
1706
- channels = convert[this.model].channels;
1707
- this.color = result.value.slice(0, channels);
1708
- this.valpha = typeof result.value[channels] === 'number' ? result.value[channels] : 1;
1709
- } else if (obj.length) {
1710
- this.model = model || 'rgb';
1711
- channels = convert[this.model].channels;
1712
- var newArr = _slice.call(obj, 0, channels);
1713
- this.color = zeroArray(newArr, channels);
1714
- this.valpha = typeof obj[channels] === 'number' ? obj[channels] : 1;
1715
- } else if (typeof obj === 'number') {
1716
- // this is always RGB - can be converted later on.
1717
- obj &= 0xFFFFFF;
1718
- this.model = 'rgb';
1719
- this.color = [
1720
- (obj >> 16) & 0xFF,
1721
- (obj >> 8) & 0xFF,
1722
- obj & 0xFF
1723
- ];
1724
- this.valpha = 1;
1725
- } else {
1726
- this.valpha = 1;
1727
-
1728
- var keys = Object.keys(obj);
1729
- if ('alpha' in obj) {
1730
- keys.splice(keys.indexOf('alpha'), 1);
1731
- this.valpha = typeof obj.alpha === 'number' ? obj.alpha : 0;
1751
+ if (model && model in skippedModels) {
1752
+ model = null;
1732
1753
  }
1733
1754
 
1734
- var hashedKeys = keys.sort().join('');
1735
- if (!(hashedKeys in hashedModelKeys)) {
1736
- throw new Error('Unable to parse color from object: ' + JSON.stringify(obj));
1755
+ if (model && !(model in convert)) {
1756
+ throw new Error('Unknown model: ' + model);
1737
1757
  }
1738
1758
 
1739
- this.model = hashedModelKeys[hashedKeys];
1759
+ var i;
1760
+ var channels;
1761
+
1762
+ if (obj == null) { // eslint-disable-line no-eq-null,eqeqeq
1763
+ this.model = 'rgb';
1764
+ this.color = [0, 0, 0];
1765
+ this.valpha = 1;
1766
+ } else if (obj instanceof Color) {
1767
+ this.model = obj.model;
1768
+ this.color = obj.color.slice();
1769
+ this.valpha = obj.valpha;
1770
+ } else if (typeof obj === 'string') {
1771
+ var result = colorString.get(obj);
1772
+ if (result === null) {
1773
+ throw new Error('Unable to parse color from string: ' + obj);
1774
+ }
1740
1775
 
1741
- var labels = convert[this.model].labels;
1742
- var color = [];
1743
- for (i = 0; i < labels.length; i++) {
1744
- color.push(obj[labels[i]]);
1745
- }
1776
+ this.model = result.model;
1777
+ channels = convert[this.model].channels;
1778
+ this.color = result.value.slice(0, channels);
1779
+ this.valpha = typeof result.value[channels] === 'number' ? result.value[channels] : 1;
1780
+ } else if (obj.length) {
1781
+ this.model = model || 'rgb';
1782
+ channels = convert[this.model].channels;
1783
+ var newArr = _slice.call(obj, 0, channels);
1784
+ this.color = zeroArray(newArr, channels);
1785
+ this.valpha = typeof obj[channels] === 'number' ? obj[channels] : 1;
1786
+ } else if (typeof obj === 'number') {
1787
+ // this is always RGB - can be converted later on.
1788
+ obj &= 0xFFFFFF;
1789
+ this.model = 'rgb';
1790
+ this.color = [
1791
+ (obj >> 16) & 0xFF,
1792
+ (obj >> 8) & 0xFF,
1793
+ obj & 0xFF
1794
+ ];
1795
+ this.valpha = 1;
1796
+ } else {
1797
+ this.valpha = 1;
1746
1798
 
1747
- this.color = zeroArray(color);
1748
- }
1799
+ var keys = Object.keys(obj);
1800
+ if ('alpha' in obj) {
1801
+ keys.splice(keys.indexOf('alpha'), 1);
1802
+ this.valpha = typeof obj.alpha === 'number' ? obj.alpha : 0;
1803
+ }
1749
1804
 
1750
- // perform limitations (clamping, etc.)
1751
- if (limiters[this.model]) {
1752
- channels = convert[this.model].channels;
1753
- for (i = 0; i < channels; i++) {
1754
- var limit = limiters[this.model][i];
1755
- if (limit) {
1756
- this.color[i] = limit(this.color[i]);
1805
+ var hashedKeys = keys.sort().join('');
1806
+ if (!(hashedKeys in hashedModelKeys)) {
1807
+ throw new Error('Unable to parse color from object: ' + JSON.stringify(obj));
1757
1808
  }
1758
- }
1759
- }
1760
1809
 
1761
- this.valpha = Math.max(0, Math.min(1, this.valpha));
1810
+ this.model = hashedModelKeys[hashedKeys];
1762
1811
 
1763
- if (Object.freeze) {
1764
- Object.freeze(this);
1765
- }
1766
- }
1812
+ var labels = convert[this.model].labels;
1813
+ var color = [];
1814
+ for (i = 0; i < labels.length; i++) {
1815
+ color.push(obj[labels[i]]);
1816
+ }
1767
1817
 
1768
- Color.prototype = {
1769
- toString: function () {
1770
- return this.string();
1771
- },
1772
-
1773
- toJSON: function () {
1774
- return this[this.model]();
1775
- },
1776
-
1777
- string: function (places) {
1778
- var self = this.model in colorString.to ? this : this.rgb();
1779
- self = self.round(typeof places === 'number' ? places : 1);
1780
- var args = self.valpha === 1 ? self.color : self.color.concat(this.valpha);
1781
- return colorString.to[self.model](args);
1782
- },
1783
-
1784
- percentString: function (places) {
1785
- var self = this.rgb().round(typeof places === 'number' ? places : 1);
1786
- var args = self.valpha === 1 ? self.color : self.color.concat(this.valpha);
1787
- return colorString.to.rgb.percent(args);
1788
- },
1789
-
1790
- array: function () {
1791
- return this.valpha === 1 ? this.color.slice() : this.color.concat(this.valpha);
1792
- },
1793
-
1794
- object: function () {
1795
- var result = {};
1796
- var channels = convert[this.model].channels;
1797
- var labels = convert[this.model].labels;
1798
-
1799
- for (var i = 0; i < channels; i++) {
1800
- result[labels[i]] = this.color[i];
1818
+ this.color = zeroArray(color);
1801
1819
  }
1802
1820
 
1803
- if (this.valpha !== 1) {
1804
- result.alpha = this.valpha;
1821
+ // perform limitations (clamping, etc.)
1822
+ if (limiters[this.model]) {
1823
+ channels = convert[this.model].channels;
1824
+ for (i = 0; i < channels; i++) {
1825
+ var limit = limiters[this.model][i];
1826
+ if (limit) {
1827
+ this.color[i] = limit(this.color[i]);
1828
+ }
1829
+ }
1805
1830
  }
1806
1831
 
1807
- return result;
1808
- },
1832
+ this.valpha = Math.max(0, Math.min(1, this.valpha));
1809
1833
 
1810
- unitArray: function () {
1811
- var rgb = this.rgb().color;
1812
- rgb[0] /= 255;
1813
- rgb[1] /= 255;
1814
- rgb[2] /= 255;
1815
-
1816
- if (this.valpha !== 1) {
1817
- rgb.push(this.valpha);
1834
+ if (Object.freeze) {
1835
+ Object.freeze(this);
1818
1836
  }
1837
+ }
1819
1838
 
1820
- return rgb;
1821
- },
1839
+ Color.prototype = {
1840
+ toString: function () {
1841
+ return this.string();
1842
+ },
1843
+
1844
+ toJSON: function () {
1845
+ return this[this.model]();
1846
+ },
1847
+
1848
+ string: function (places) {
1849
+ var self = this.model in colorString.to ? this : this.rgb();
1850
+ self = self.round(typeof places === 'number' ? places : 1);
1851
+ var args = self.valpha === 1 ? self.color : self.color.concat(this.valpha);
1852
+ return colorString.to[self.model](args);
1853
+ },
1854
+
1855
+ percentString: function (places) {
1856
+ var self = this.rgb().round(typeof places === 'number' ? places : 1);
1857
+ var args = self.valpha === 1 ? self.color : self.color.concat(this.valpha);
1858
+ return colorString.to.rgb.percent(args);
1859
+ },
1860
+
1861
+ array: function () {
1862
+ return this.valpha === 1 ? this.color.slice() : this.color.concat(this.valpha);
1863
+ },
1864
+
1865
+ object: function () {
1866
+ var result = {};
1867
+ var channels = convert[this.model].channels;
1868
+ var labels = convert[this.model].labels;
1869
+
1870
+ for (var i = 0; i < channels; i++) {
1871
+ result[labels[i]] = this.color[i];
1872
+ }
1822
1873
 
1823
- unitObject: function () {
1824
- var rgb = this.rgb().object();
1825
- rgb.r /= 255;
1826
- rgb.g /= 255;
1827
- rgb.b /= 255;
1874
+ if (this.valpha !== 1) {
1875
+ result.alpha = this.valpha;
1876
+ }
1828
1877
 
1829
- if (this.valpha !== 1) {
1830
- rgb.alpha = this.valpha;
1831
- }
1878
+ return result;
1879
+ },
1832
1880
 
1833
- return rgb;
1834
- },
1881
+ unitArray: function () {
1882
+ var rgb = this.rgb().color;
1883
+ rgb[0] /= 255;
1884
+ rgb[1] /= 255;
1885
+ rgb[2] /= 255;
1835
1886
 
1836
- round: function (places) {
1837
- places = Math.max(places || 0, 0);
1838
- return new Color(this.color.map(roundToPlace(places)).concat(this.valpha), this.model);
1839
- },
1887
+ if (this.valpha !== 1) {
1888
+ rgb.push(this.valpha);
1889
+ }
1840
1890
 
1841
- alpha: function (val) {
1842
- if (arguments.length) {
1843
- return new Color(this.color.concat(Math.max(0, Math.min(1, val))), this.model);
1844
- }
1891
+ return rgb;
1892
+ },
1845
1893
 
1846
- return this.valpha;
1847
- },
1894
+ unitObject: function () {
1895
+ var rgb = this.rgb().object();
1896
+ rgb.r /= 255;
1897
+ rgb.g /= 255;
1898
+ rgb.b /= 255;
1848
1899
 
1849
- // rgb
1850
- red: getset('rgb', 0, maxfn(255)),
1851
- green: getset('rgb', 1, maxfn(255)),
1852
- blue: getset('rgb', 2, maxfn(255)),
1900
+ if (this.valpha !== 1) {
1901
+ rgb.alpha = this.valpha;
1902
+ }
1853
1903
 
1854
- hue: getset(['hsl', 'hsv', 'hsl', 'hwb', 'hcg'], 0, function (val) { return ((val % 360) + 360) % 360; }), // eslint-disable-line brace-style
1904
+ return rgb;
1905
+ },
1855
1906
 
1856
- saturationl: getset('hsl', 1, maxfn(100)),
1857
- lightness: getset('hsl', 2, maxfn(100)),
1907
+ round: function (places) {
1908
+ places = Math.max(places || 0, 0);
1909
+ return new Color(this.color.map(roundToPlace(places)).concat(this.valpha), this.model);
1910
+ },
1858
1911
 
1859
- saturationv: getset('hsv', 1, maxfn(100)),
1860
- value: getset('hsv', 2, maxfn(100)),
1912
+ alpha: function (val) {
1913
+ if (arguments.length) {
1914
+ return new Color(this.color.concat(Math.max(0, Math.min(1, val))), this.model);
1915
+ }
1861
1916
 
1862
- chroma: getset('hcg', 1, maxfn(100)),
1863
- gray: getset('hcg', 2, maxfn(100)),
1917
+ return this.valpha;
1918
+ },
1864
1919
 
1865
- white: getset('hwb', 1, maxfn(100)),
1866
- wblack: getset('hwb', 2, maxfn(100)),
1920
+ // rgb
1921
+ red: getset('rgb', 0, maxfn(255)),
1922
+ green: getset('rgb', 1, maxfn(255)),
1923
+ blue: getset('rgb', 2, maxfn(255)),
1867
1924
 
1868
- cyan: getset('cmyk', 0, maxfn(100)),
1869
- magenta: getset('cmyk', 1, maxfn(100)),
1870
- yellow: getset('cmyk', 2, maxfn(100)),
1871
- black: getset('cmyk', 3, maxfn(100)),
1925
+ hue: getset(['hsl', 'hsv', 'hsl', 'hwb', 'hcg'], 0, function (val) { return ((val % 360) + 360) % 360; }), // eslint-disable-line brace-style
1872
1926
 
1873
- x: getset('xyz', 0, maxfn(100)),
1874
- y: getset('xyz', 1, maxfn(100)),
1875
- z: getset('xyz', 2, maxfn(100)),
1927
+ saturationl: getset('hsl', 1, maxfn(100)),
1928
+ lightness: getset('hsl', 2, maxfn(100)),
1876
1929
 
1877
- l: getset('lab', 0, maxfn(100)),
1878
- a: getset('lab', 1),
1879
- b: getset('lab', 2),
1930
+ saturationv: getset('hsv', 1, maxfn(100)),
1931
+ value: getset('hsv', 2, maxfn(100)),
1880
1932
 
1881
- keyword: function (val) {
1882
- if (arguments.length) {
1883
- return new Color(val);
1884
- }
1933
+ chroma: getset('hcg', 1, maxfn(100)),
1934
+ gray: getset('hcg', 2, maxfn(100)),
1885
1935
 
1886
- return convert[this.model].keyword(this.color);
1887
- },
1936
+ white: getset('hwb', 1, maxfn(100)),
1937
+ wblack: getset('hwb', 2, maxfn(100)),
1888
1938
 
1889
- hex: function (val) {
1890
- if (arguments.length) {
1891
- return new Color(val);
1892
- }
1939
+ cyan: getset('cmyk', 0, maxfn(100)),
1940
+ magenta: getset('cmyk', 1, maxfn(100)),
1941
+ yellow: getset('cmyk', 2, maxfn(100)),
1942
+ black: getset('cmyk', 3, maxfn(100)),
1893
1943
 
1894
- return colorString.to.hex(this.rgb().round().color);
1895
- },
1944
+ x: getset('xyz', 0, maxfn(100)),
1945
+ y: getset('xyz', 1, maxfn(100)),
1946
+ z: getset('xyz', 2, maxfn(100)),
1896
1947
 
1897
- rgbNumber: function () {
1898
- var rgb = this.rgb().color;
1899
- return ((rgb[0] & 0xFF) << 16) | ((rgb[1] & 0xFF) << 8) | (rgb[2] & 0xFF);
1900
- },
1948
+ l: getset('lab', 0, maxfn(100)),
1949
+ a: getset('lab', 1),
1950
+ b: getset('lab', 2),
1901
1951
 
1902
- luminosity: function () {
1903
- // http://www.w3.org/TR/WCAG20/#relativeluminancedef
1904
- var rgb = this.rgb().color;
1952
+ keyword: function (val) {
1953
+ if (arguments.length) {
1954
+ return new Color(val);
1955
+ }
1905
1956
 
1906
- var lum = [];
1907
- for (var i = 0; i < rgb.length; i++) {
1908
- var chan = rgb[i] / 255;
1909
- lum[i] = (chan <= 0.03928) ? chan / 12.92 : Math.pow(((chan + 0.055) / 1.055), 2.4);
1910
- }
1957
+ return convert[this.model].keyword(this.color);
1958
+ },
1911
1959
 
1912
- return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
1913
- },
1960
+ hex: function (val) {
1961
+ if (arguments.length) {
1962
+ return new Color(val);
1963
+ }
1914
1964
 
1915
- contrast: function (color2) {
1916
- // http://www.w3.org/TR/WCAG20/#contrast-ratiodef
1917
- var lum1 = this.luminosity();
1918
- var lum2 = color2.luminosity();
1965
+ return colorString.to.hex(this.rgb().round().color);
1966
+ },
1919
1967
 
1920
- if (lum1 > lum2) {
1921
- return (lum1 + 0.05) / (lum2 + 0.05);
1922
- }
1968
+ rgbNumber: function () {
1969
+ var rgb = this.rgb().color;
1970
+ return ((rgb[0] & 0xFF) << 16) | ((rgb[1] & 0xFF) << 8) | (rgb[2] & 0xFF);
1971
+ },
1923
1972
 
1924
- return (lum2 + 0.05) / (lum1 + 0.05);
1925
- },
1973
+ luminosity: function () {
1974
+ // http://www.w3.org/TR/WCAG20/#relativeluminancedef
1975
+ var rgb = this.rgb().color;
1926
1976
 
1927
- level: function (color2) {
1928
- var contrastRatio = this.contrast(color2);
1929
- if (contrastRatio >= 7.1) {
1930
- return 'AAA';
1931
- }
1977
+ var lum = [];
1978
+ for (var i = 0; i < rgb.length; i++) {
1979
+ var chan = rgb[i] / 255;
1980
+ lum[i] = (chan <= 0.03928) ? chan / 12.92 : Math.pow(((chan + 0.055) / 1.055), 2.4);
1981
+ }
1932
1982
 
1933
- return (contrastRatio >= 4.5) ? 'AA' : '';
1934
- },
1983
+ return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
1984
+ },
1935
1985
 
1936
- isDark: function () {
1937
- // YIQ equation from http://24ways.org/2010/calculating-color-contrast
1938
- var rgb = this.rgb().color;
1939
- var yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;
1940
- return yiq < 128;
1941
- },
1986
+ contrast: function (color2) {
1987
+ // http://www.w3.org/TR/WCAG20/#contrast-ratiodef
1988
+ var lum1 = this.luminosity();
1989
+ var lum2 = color2.luminosity();
1942
1990
 
1943
- isLight: function () {
1944
- return !this.isDark();
1945
- },
1991
+ if (lum1 > lum2) {
1992
+ return (lum1 + 0.05) / (lum2 + 0.05);
1993
+ }
1946
1994
 
1947
- negate: function () {
1948
- var rgb = this.rgb();
1949
- for (var i = 0; i < 3; i++) {
1950
- rgb.color[i] = 255 - rgb.color[i];
1951
- }
1952
- return rgb;
1953
- },
1954
-
1955
- lighten: function (ratio) {
1956
- var hsl = this.hsl();
1957
- hsl.color[2] += hsl.color[2] * ratio;
1958
- return hsl;
1959
- },
1960
-
1961
- darken: function (ratio) {
1962
- var hsl = this.hsl();
1963
- hsl.color[2] -= hsl.color[2] * ratio;
1964
- return hsl;
1965
- },
1966
-
1967
- saturate: function (ratio) {
1968
- var hsl = this.hsl();
1969
- hsl.color[1] += hsl.color[1] * ratio;
1970
- return hsl;
1971
- },
1972
-
1973
- desaturate: function (ratio) {
1974
- var hsl = this.hsl();
1975
- hsl.color[1] -= hsl.color[1] * ratio;
1976
- return hsl;
1977
- },
1978
-
1979
- whiten: function (ratio) {
1980
- var hwb = this.hwb();
1981
- hwb.color[1] += hwb.color[1] * ratio;
1982
- return hwb;
1983
- },
1984
-
1985
- blacken: function (ratio) {
1986
- var hwb = this.hwb();
1987
- hwb.color[2] += hwb.color[2] * ratio;
1988
- return hwb;
1989
- },
1990
-
1991
- grayscale: function () {
1992
- // http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale
1993
- var rgb = this.rgb().color;
1994
- var val = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
1995
- return Color.rgb(val, val, val);
1996
- },
1997
-
1998
- fade: function (ratio) {
1999
- return this.alpha(this.valpha - (this.valpha * ratio));
2000
- },
2001
-
2002
- opaquer: function (ratio) {
2003
- return this.alpha(this.valpha + (this.valpha * ratio));
2004
- },
2005
-
2006
- rotate: function (degrees) {
2007
- var hsl = this.hsl();
2008
- var hue = hsl.color[0];
2009
- hue = (hue + degrees) % 360;
2010
- hue = hue < 0 ? 360 + hue : hue;
2011
- hsl.color[0] = hue;
2012
- return hsl;
2013
- },
2014
-
2015
- mix: function (mixinColor, weight) {
2016
- // ported from sass implementation in C
2017
- // https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209
2018
- if (!mixinColor || !mixinColor.rgb) {
2019
- throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
2020
- }
2021
- var color1 = mixinColor.rgb();
2022
- var color2 = this.rgb();
2023
- var p = weight === undefined ? 0.5 : weight;
1995
+ return (lum2 + 0.05) / (lum1 + 0.05);
1996
+ },
2024
1997
 
2025
- var w = 2 * p - 1;
2026
- var a = color1.alpha() - color2.alpha();
1998
+ level: function (color2) {
1999
+ var contrastRatio = this.contrast(color2);
2000
+ if (contrastRatio >= 7.1) {
2001
+ return 'AAA';
2002
+ }
2027
2003
 
2028
- var w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
2029
- var w2 = 1 - w1;
2004
+ return (contrastRatio >= 4.5) ? 'AA' : '';
2005
+ },
2030
2006
 
2031
- return Color.rgb(
2032
- w1 * color1.red() + w2 * color2.red(),
2033
- w1 * color1.green() + w2 * color2.green(),
2034
- w1 * color1.blue() + w2 * color2.blue(),
2035
- color1.alpha() * p + color2.alpha() * (1 - p));
2036
- }
2037
- };
2007
+ isDark: function () {
2008
+ // YIQ equation from http://24ways.org/2010/calculating-color-contrast
2009
+ var rgb = this.rgb().color;
2010
+ var yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;
2011
+ return yiq < 128;
2012
+ },
2038
2013
 
2039
- // model conversion methods and static constructors
2040
- Object.keys(convert).forEach(function (model) {
2041
- if (skippedModels.indexOf(model) !== -1) {
2042
- return;
2043
- }
2014
+ isLight: function () {
2015
+ return !this.isDark();
2016
+ },
2044
2017
 
2045
- var channels = convert[model].channels;
2018
+ negate: function () {
2019
+ var rgb = this.rgb();
2020
+ for (var i = 0; i < 3; i++) {
2021
+ rgb.color[i] = 255 - rgb.color[i];
2022
+ }
2023
+ return rgb;
2024
+ },
2025
+
2026
+ lighten: function (ratio) {
2027
+ var hsl = this.hsl();
2028
+ hsl.color[2] += hsl.color[2] * ratio;
2029
+ return hsl;
2030
+ },
2031
+
2032
+ darken: function (ratio) {
2033
+ var hsl = this.hsl();
2034
+ hsl.color[2] -= hsl.color[2] * ratio;
2035
+ return hsl;
2036
+ },
2037
+
2038
+ saturate: function (ratio) {
2039
+ var hsl = this.hsl();
2040
+ hsl.color[1] += hsl.color[1] * ratio;
2041
+ return hsl;
2042
+ },
2043
+
2044
+ desaturate: function (ratio) {
2045
+ var hsl = this.hsl();
2046
+ hsl.color[1] -= hsl.color[1] * ratio;
2047
+ return hsl;
2048
+ },
2049
+
2050
+ whiten: function (ratio) {
2051
+ var hwb = this.hwb();
2052
+ hwb.color[1] += hwb.color[1] * ratio;
2053
+ return hwb;
2054
+ },
2055
+
2056
+ blacken: function (ratio) {
2057
+ var hwb = this.hwb();
2058
+ hwb.color[2] += hwb.color[2] * ratio;
2059
+ return hwb;
2060
+ },
2061
+
2062
+ grayscale: function () {
2063
+ // http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale
2064
+ var rgb = this.rgb().color;
2065
+ var val = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
2066
+ return Color.rgb(val, val, val);
2067
+ },
2068
+
2069
+ fade: function (ratio) {
2070
+ return this.alpha(this.valpha - (this.valpha * ratio));
2071
+ },
2072
+
2073
+ opaquer: function (ratio) {
2074
+ return this.alpha(this.valpha + (this.valpha * ratio));
2075
+ },
2076
+
2077
+ rotate: function (degrees) {
2078
+ var hsl = this.hsl();
2079
+ var hue = hsl.color[0];
2080
+ hue = (hue + degrees) % 360;
2081
+ hue = hue < 0 ? 360 + hue : hue;
2082
+ hsl.color[0] = hue;
2083
+ return hsl;
2084
+ },
2085
+
2086
+ mix: function (mixinColor, weight) {
2087
+ // ported from sass implementation in C
2088
+ // https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209
2089
+ if (!mixinColor || !mixinColor.rgb) {
2090
+ throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
2091
+ }
2092
+ var color1 = mixinColor.rgb();
2093
+ var color2 = this.rgb();
2094
+ var p = weight === undefined ? 0.5 : weight;
2046
2095
 
2047
- // conversion methods
2048
- Color.prototype[model] = function () {
2049
- if (this.model === model) {
2050
- return new Color(this);
2051
- }
2096
+ var w = 2 * p - 1;
2097
+ var a = color1.alpha() - color2.alpha();
2052
2098
 
2053
- if (arguments.length) {
2054
- return new Color(arguments, model);
2055
- }
2099
+ var w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
2100
+ var w2 = 1 - w1;
2056
2101
 
2057
- var newAlpha = typeof arguments[channels] === 'number' ? channels : this.valpha;
2058
- return new Color(assertArray(convert[this.model][model].raw(this.color)).concat(newAlpha), model);
2102
+ return Color.rgb(
2103
+ w1 * color1.red() + w2 * color2.red(),
2104
+ w1 * color1.green() + w2 * color2.green(),
2105
+ w1 * color1.blue() + w2 * color2.blue(),
2106
+ color1.alpha() * p + color2.alpha() * (1 - p));
2107
+ }
2059
2108
  };
2060
2109
 
2061
- // 'static' construction methods
2062
- Color[model] = function (color) {
2063
- if (typeof color === 'number') {
2064
- color = zeroArray(_slice.call(arguments), channels);
2110
+ // model conversion methods and static constructors
2111
+ Object.keys(convert).forEach(function (model) {
2112
+ if (skippedModels.indexOf(model) !== -1) {
2113
+ return;
2065
2114
  }
2066
- return new Color(color, model);
2067
- };
2068
- });
2069
2115
 
2070
- function roundTo(num, places) {
2071
- return Number(num.toFixed(places));
2072
- }
2116
+ var channels = convert[model].channels;
2073
2117
 
2074
- function roundToPlace(places) {
2075
- return function (num) {
2076
- return roundTo(num, places);
2077
- };
2078
- }
2118
+ // conversion methods
2119
+ Color.prototype[model] = function () {
2120
+ if (this.model === model) {
2121
+ return new Color(this);
2122
+ }
2079
2123
 
2080
- function getset(model, channel, modifier) {
2081
- model = Array.isArray(model) ? model : [model];
2124
+ if (arguments.length) {
2125
+ return new Color(arguments, model);
2126
+ }
2082
2127
 
2083
- model.forEach(function (m) {
2084
- (limiters[m] || (limiters[m] = []))[channel] = modifier;
2128
+ var newAlpha = typeof arguments[channels] === 'number' ? channels : this.valpha;
2129
+ return new Color(assertArray(convert[this.model][model].raw(this.color)).concat(newAlpha), model);
2130
+ };
2131
+
2132
+ // 'static' construction methods
2133
+ Color[model] = function (color) {
2134
+ if (typeof color === 'number') {
2135
+ color = zeroArray(_slice.call(arguments), channels);
2136
+ }
2137
+ return new Color(color, model);
2138
+ };
2085
2139
  });
2086
2140
 
2087
- model = model[0];
2141
+ function roundTo(num, places) {
2142
+ return Number(num.toFixed(places));
2143
+ }
2088
2144
 
2089
- return function (val) {
2090
- var result;
2145
+ function roundToPlace(places) {
2146
+ return function (num) {
2147
+ return roundTo(num, places);
2148
+ };
2149
+ }
2091
2150
 
2092
- if (arguments.length) {
2151
+ function getset(model, channel, modifier) {
2152
+ model = Array.isArray(model) ? model : [model];
2153
+
2154
+ model.forEach(function (m) {
2155
+ (limiters[m] || (limiters[m] = []))[channel] = modifier;
2156
+ });
2157
+
2158
+ model = model[0];
2159
+
2160
+ return function (val) {
2161
+ var result;
2162
+
2163
+ if (arguments.length) {
2164
+ if (modifier) {
2165
+ val = modifier(val);
2166
+ }
2167
+
2168
+ result = this[model]();
2169
+ result.color[channel] = val;
2170
+ return result;
2171
+ }
2172
+
2173
+ result = this[model]().color[channel];
2093
2174
  if (modifier) {
2094
- val = modifier(val);
2175
+ result = modifier(result);
2095
2176
  }
2096
2177
 
2097
- result = this[model]();
2098
- result.color[channel] = val;
2099
2178
  return result;
2100
- }
2101
-
2102
- result = this[model]().color[channel];
2103
- if (modifier) {
2104
- result = modifier(result);
2105
- }
2106
-
2107
- return result;
2108
- };
2109
- }
2179
+ };
2180
+ }
2110
2181
 
2111
- function maxfn(max) {
2112
- return function (v) {
2113
- return Math.max(0, Math.min(max, v));
2114
- };
2115
- }
2182
+ function maxfn(max) {
2183
+ return function (v) {
2184
+ return Math.max(0, Math.min(max, v));
2185
+ };
2186
+ }
2116
2187
 
2117
- function assertArray(val) {
2118
- return Array.isArray(val) ? val : [val];
2119
- }
2188
+ function assertArray(val) {
2189
+ return Array.isArray(val) ? val : [val];
2190
+ }
2120
2191
 
2121
- function zeroArray(arr, length) {
2122
- for (var i = 0; i < length; i++) {
2123
- if (typeof arr[i] !== 'number') {
2124
- arr[i] = 0;
2192
+ function zeroArray(arr, length) {
2193
+ for (var i = 0; i < length; i++) {
2194
+ if (typeof arr[i] !== 'number') {
2195
+ arr[i] = 0;
2196
+ }
2125
2197
  }
2198
+
2199
+ return arr;
2126
2200
  }
2127
2201
 
2128
- return arr;
2202
+ color = Color;
2203
+ return color;
2129
2204
  }
2130
2205
 
2206
+ requireColor();
2207
+
2208
+ requireColorString();
2209
+
2131
2210
  const funnelDefs = [
2132
2211
  { id: 1, height: 400, width: 100, x: 10, y: 10, drop: 20 },
2133
2212
  { id: 2, height: 356, width: 100, x: 120, y: 32, drop: 20 },
@@ -2396,7 +2475,7 @@ const initStore = {
2396
2475
  values: [...sample],
2397
2476
  };
2398
2477
  const store = createStore(initStore);
2399
- const { state, onChange } = store;
2478
+ const { state} = store;
2400
2479
  const saveState = () => {
2401
2480
  const { count, pick, values } = state;
2402
2481
  bag.store({ count, pick, values });
@@ -2429,7 +2508,7 @@ const actions = {
2429
2508
  };
2430
2509
 
2431
2510
  // WARNING: generated file...
2432
- const TW_VERSION = '4.0.11';
2511
+ const TW_VERSION = '4.0.15';
2433
2512
 
2434
2513
  const ColorPicker = props => {
2435
2514
  const { actions, state } = props;
@@ -2543,8 +2622,7 @@ const Header = props => {
2543
2622
  return (h("h1", { class: "mb-11 ml-0 mr-0 mt-11 text-center text-6xl font-thin uppercase text-clrs-red" }, props.label));
2544
2623
  };
2545
2624
 
2546
- const shadowCss = "/*! tailwindcss v4.0.11 | MIT License | https://tailwindcss.com */\n@layer theme, base, components, utilities;\n@layer theme {\n :root,\n :host {\n --font-sans:\n ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji',\n 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';\n --spacing: 0.25rem;\n --text-xs: 0.75rem;\n --text-xs--line-height: calc(1 / 0.75);\n --text-6xl: 3.75rem;\n --text-6xl--line-height: 1;\n --font-weight-thin: 100;\n --font-weight-bold: 700;\n }\n}\n@layer utilities {\n .absolute {\n position: absolute;\n }\n .relative {\n position: relative;\n }\n .top-8 {\n top: calc(var(--spacing) * 8);\n }\n .right-8 {\n right: calc(var(--spacing) * 8);\n }\n .mt-3 {\n margin-top: calc(var(--spacing) * 3);\n }\n .mt-5px {\n margin-top: 5px;\n }\n .mt-11 {\n margin-top: calc(var(--spacing) * 11);\n }\n .mr-0 {\n margin-right: calc(var(--spacing) * 0);\n }\n .mr-10px {\n margin-right: 10px;\n }\n .mb-10px {\n margin-bottom: 10px;\n }\n .mb-11 {\n margin-bottom: calc(var(--spacing) * 11);\n }\n .ml-0 {\n margin-left: calc(var(--spacing) * 0);\n }\n .ml-auto {\n margin-left: auto;\n }\n .flex {\n display: flex;\n }\n .flex-col {\n flex-direction: column;\n }\n .flex-wrap {\n flex-wrap: wrap;\n }\n .items-center {\n align-items: center;\n }\n .border-solid {\n --tw-border-style: solid;\n border-style: solid;\n }\n .border-clrs-slate {\n border-color: var(--clrs-slate, #708090);\n }\n .bg-clrs-blue {\n background-color: var(--clrs-blue, #0074d9);\n }\n .bg-clrs-red {\n background-color: var(--clrs-red, #ff4136);\n }\n .p-4 {\n padding: calc(var(--spacing) * 4);\n }\n .text-center {\n text-align: center;\n }\n .align-top {\n vertical-align: top;\n }\n .font-sans {\n font-family: var(--font-sans);\n }\n .text-6xl {\n font-size: var(--text-6xl);\n line-height: var(--tw-leading, var(--text-6xl--line-height));\n }\n .text-xs {\n font-size: var(--text-xs);\n line-height: var(--tw-leading, var(--text-xs--line-height));\n }\n .font-bold {\n --tw-font-weight: var(--font-weight-bold);\n font-weight: var(--font-weight-bold);\n }\n .font-thin {\n --tw-font-weight: var(--font-weight-thin);\n font-weight: var(--font-weight-thin);\n }\n .text-clrs-gray {\n color: var(--clrs-gray, #aaaaaa);\n }\n .text-clrs-navy {\n color: var(--clrs-navy, #001f3f);\n }\n .text-clrs-red {\n color: var(--clrs-red, #ff4136);\n }\n .text-clrs-slate4 {\n color: var(--clrs-slate4, #4e5964);\n }\n .text-clrs-white {\n color: var(--clrs-white, #ffffff);\n }\n .uppercase {\n text-transform: uppercase;\n }\n .italic {\n font-style: italic;\n }\n .shadow {\n --tw-shadow:\n 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)),\n 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow:\n var(--tw-inset-shadow), var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .hover\\:text-clrs-navy {\n &:hover {\n @media (hover: hover) {\n color: var(--clrs-navy, #001f3f);\n }\n }\n }\n .active\\:bg-clrs-gray {\n &:active {\n background-color: var(--clrs-gray, #aaaaaa);\n }\n }\n}\n@layer components {\n .ds1-main {\n display: flex;\n flex-direction: column;\n padding: calc(var(--spacing) * 4);\n font-family: var(--font-sans);\n color: var(--clrs-navy, #001f3f);\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n .ds1-button {\n display: flex;\n align-items: center;\n --tw-border-style: solid;\n border-style: solid;\n border-color: var(--clrs-slate, #708090);\n color: var(--clrs-white, #ffffff);\n &:active {\n background-color: var(--clrs-gray, #aaaaaa);\n }\n &:active {\n color: var(--clrs-navy, #001f3f);\n }\n }\n}\n.data-button {\n border-radius: 5px;\n border-width: 1px;\n padding: 5px;\n margin: 0px;\n margin-right: 5px;\n cursor: pointer;\n}\n";
2547
- const ProtoTinkerStyle0 = shadowCss;
2625
+ const shadowCss = "/*! tailwindcss v4.0.15 | MIT License | https://tailwindcss.com */\n@layer theme, base, components, utilities;\n@layer theme {\n :root,\n :host {\n --font-sans:\n ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji',\n 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';\n --spacing: 0.25rem;\n --text-xs: 0.75rem;\n --text-xs--line-height: calc(1 / 0.75);\n --text-6xl: 3.75rem;\n --text-6xl--line-height: 1;\n --font-weight-thin: 100;\n --font-weight-bold: 700;\n }\n}\n@layer utilities {\n .absolute {\n position: absolute;\n }\n .relative {\n position: relative;\n }\n .top-8 {\n top: calc(var(--spacing) * 8);\n }\n .right-8 {\n right: calc(var(--spacing) * 8);\n }\n .mt-3 {\n margin-top: calc(var(--spacing) * 3);\n }\n .mt-5px {\n margin-top: 5px;\n }\n .mt-11 {\n margin-top: calc(var(--spacing) * 11);\n }\n .mr-0 {\n margin-right: calc(var(--spacing) * 0);\n }\n .mr-10px {\n margin-right: 10px;\n }\n .mb-10px {\n margin-bottom: 10px;\n }\n .mb-11 {\n margin-bottom: calc(var(--spacing) * 11);\n }\n .ml-0 {\n margin-left: calc(var(--spacing) * 0);\n }\n .ml-auto {\n margin-left: auto;\n }\n .flex {\n display: flex;\n }\n .flex-col {\n flex-direction: column;\n }\n .flex-wrap {\n flex-wrap: wrap;\n }\n .items-center {\n align-items: center;\n }\n .border-solid {\n --tw-border-style: solid;\n border-style: solid;\n }\n .border-clrs-slate {\n border-color: var(--clrs-slate, #708090);\n }\n .bg-clrs-blue {\n background-color: var(--clrs-blue, #0074d9);\n }\n .bg-clrs-red {\n background-color: var(--clrs-red, #ff4136);\n }\n .p-4 {\n padding: calc(var(--spacing) * 4);\n }\n .text-center {\n text-align: center;\n }\n .align-top {\n vertical-align: top;\n }\n .font-sans {\n font-family: var(--font-sans);\n }\n .text-6xl {\n font-size: var(--text-6xl);\n line-height: var(--tw-leading, var(--text-6xl--line-height));\n }\n .text-xs {\n font-size: var(--text-xs);\n line-height: var(--tw-leading, var(--text-xs--line-height));\n }\n .font-bold {\n --tw-font-weight: var(--font-weight-bold);\n font-weight: var(--font-weight-bold);\n }\n .font-thin {\n --tw-font-weight: var(--font-weight-thin);\n font-weight: var(--font-weight-thin);\n }\n .text-clrs-gray {\n color: var(--clrs-gray, #aaaaaa);\n }\n .text-clrs-navy {\n color: var(--clrs-navy, #001f3f);\n }\n .text-clrs-red {\n color: var(--clrs-red, #ff4136);\n }\n .text-clrs-slate4 {\n color: var(--clrs-slate4, #4e5964);\n }\n .text-clrs-white {\n color: var(--clrs-white, #ffffff);\n }\n .uppercase {\n text-transform: uppercase;\n }\n .italic {\n font-style: italic;\n }\n .shadow {\n --tw-shadow:\n 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)),\n 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow:\n var(--tw-inset-shadow), var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .hover\\:text-clrs-navy {\n &:hover {\n @media (hover: hover) {\n color: var(--clrs-navy, #001f3f);\n }\n }\n }\n .active\\:bg-clrs-gray {\n &:active {\n background-color: var(--clrs-gray, #aaaaaa);\n }\n }\n}\n@layer components {\n .ds1-main {\n display: flex;\n flex-direction: column;\n padding: calc(var(--spacing) * 4);\n font-family: var(--font-sans);\n color: var(--clrs-navy, #001f3f);\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n .ds1-button {\n display: flex;\n align-items: center;\n --tw-border-style: solid;\n border-style: solid;\n border-color: var(--clrs-slate, #708090);\n color: var(--clrs-white, #ffffff);\n &:active {\n background-color: var(--clrs-gray, #aaaaaa);\n }\n &:active {\n color: var(--clrs-navy, #001f3f);\n }\n }\n}\n.data-button {\n border-radius: 5px;\n border-width: 1px;\n padding: 5px;\n margin: 0px;\n margin-right: 5px;\n cursor: pointer;\n}\n";
2548
2626
 
2549
2627
  const ProtoTinker = class {
2550
2628
  constructor(hostRef) {
@@ -2558,6 +2636,8 @@ const ProtoTinker = class {
2558
2636
  return (h("div", { key: '8ce0faa12c39b5b7ebc87c2f8d00dade936e3ded', id: "app", class: "ds1-main relative" }, h(Header, { key: 'd1a5aba6e4221c2f233f8675a4d5cd81aab4d93d', label: "tinker wc" }), h(Eswat2Io, { key: '919ca01768ea309609ec6be67fede120434d723e' }), h(DataSource, { key: 'e8220f685b6b44e3d7ccd1bf644d3f98219d7310', actions: actions, state: state }), h(ColorPicker, { key: '463901312bdd5ee72715de3e2fc47ad364902f40', actions: actions, state: state }), h("hr", { key: '35ba2812a3b068b21b5252c5f07d0b5dc2f18527', class: "ml-0 mr-0" }), h(DataValues, { key: 'df047e0968a8267a031b87fd733c454911771fe0', state: state })));
2559
2637
  }
2560
2638
  };
2561
- ProtoTinker.style = ProtoTinkerStyle0;
2639
+ ProtoTinker.style = shadowCss;
2562
2640
 
2563
2641
  export { ProtoTinker as proto_tinker };
2642
+
2643
+ //# sourceMappingURL=proto-tinker.entry.js.map