proto-tinker-wc 0.1.13 → 0.1.15

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