x4js 1.4.2

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 (176) hide show
  1. package/lib/application.d.ts +95 -0
  2. package/lib/application.js +137 -0
  3. package/lib/base64.d.ts +31 -0
  4. package/lib/base64.js +135 -0
  5. package/lib/base_component.d.ts +64 -0
  6. package/lib/base_component.js +77 -0
  7. package/lib/button.d.ts +145 -0
  8. package/lib/button.js +235 -0
  9. package/lib/calendar.d.ts +77 -0
  10. package/lib/calendar.js +236 -0
  11. package/lib/canvas.d.ts +88 -0
  12. package/lib/canvas.js +354 -0
  13. package/lib/cardview.d.ts +83 -0
  14. package/lib/cardview.js +152 -0
  15. package/lib/checkbox.d.ts +72 -0
  16. package/lib/checkbox.js +126 -0
  17. package/lib/color.d.ts +144 -0
  18. package/lib/color.js +584 -0
  19. package/lib/colorpicker.d.ts +98 -0
  20. package/lib/colorpicker.js +1457 -0
  21. package/lib/combobox.d.ts +97 -0
  22. package/lib/combobox.js +246 -0
  23. package/lib/component.d.ts +572 -0
  24. package/lib/component.js +1712 -0
  25. package/lib/datastore.d.ts +392 -0
  26. package/lib/datastore.js +986 -0
  27. package/lib/dialog.d.ts +171 -0
  28. package/lib/dialog.js +468 -0
  29. package/lib/dom_events.d.ts +284 -0
  30. package/lib/dom_events.js +13 -0
  31. package/lib/drag_manager.d.ts +26 -0
  32. package/lib/drag_manager.js +118 -0
  33. package/lib/drawtext.d.ts +43 -0
  34. package/lib/drawtext.js +261 -0
  35. package/lib/fileupload.d.ts +60 -0
  36. package/lib/fileupload.js +158 -0
  37. package/lib/form.d.ts +122 -0
  38. package/lib/form.js +293 -0
  39. package/lib/formatters.d.ts +31 -0
  40. package/lib/formatters.js +75 -0
  41. package/lib/gridview.d.ts +171 -0
  42. package/lib/gridview.js +786 -0
  43. package/lib/hosts/host.d.ts +44 -0
  44. package/lib/hosts/host.js +69 -0
  45. package/lib/i18n.d.ts +67 -0
  46. package/lib/i18n.js +169 -0
  47. package/lib/icon.d.ts +56 -0
  48. package/lib/icon.js +173 -0
  49. package/lib/image.d.ts +51 -0
  50. package/lib/image.js +149 -0
  51. package/lib/index.js +1 -0
  52. package/lib/input.d.ts +86 -0
  53. package/lib/input.js +172 -0
  54. package/lib/label.d.ts +54 -0
  55. package/lib/label.js +86 -0
  56. package/lib/layout.d.ts +77 -0
  57. package/lib/layout.js +261 -0
  58. package/lib/link.d.ts +46 -0
  59. package/lib/link.js +55 -0
  60. package/lib/listview.d.ts +173 -0
  61. package/lib/listview.js +532 -0
  62. package/lib/md5.d.ts +56 -0
  63. package/lib/md5.js +397 -0
  64. package/lib/menu.d.ts +122 -0
  65. package/lib/menu.js +276 -0
  66. package/lib/messagebox.d.ts +64 -0
  67. package/lib/messagebox.js +141 -0
  68. package/lib/panel.d.ts +42 -0
  69. package/lib/panel.js +61 -0
  70. package/lib/popup.d.ts +71 -0
  71. package/lib/popup.js +373 -0
  72. package/lib/property_editor.d.ts +67 -0
  73. package/lib/property_editor.js +247 -0
  74. package/lib/radiobtn.d.ts +68 -0
  75. package/lib/radiobtn.js +131 -0
  76. package/lib/rating.d.ts +49 -0
  77. package/lib/rating.js +93 -0
  78. package/lib/request.d.ts +48 -0
  79. package/lib/request.js +220 -0
  80. package/lib/router.d.ts +13 -0
  81. package/lib/router.js +27 -0
  82. package/lib/settings.d.ts +33 -0
  83. package/lib/settings.js +63 -0
  84. package/lib/sidebarview.d.ts +44 -0
  85. package/lib/sidebarview.js +73 -0
  86. package/lib/smartedit.d.ts +103 -0
  87. package/lib/smartedit.js +381 -0
  88. package/lib/spreadsheet.d.ts +214 -0
  89. package/lib/spreadsheet.js +1073 -0
  90. package/lib/styles.d.ts +81 -0
  91. package/lib/styles.js +262 -0
  92. package/lib/svgcomponent.d.ts +165 -0
  93. package/lib/svgcomponent.js +350 -0
  94. package/lib/tabbar.d.ts +41 -0
  95. package/lib/tabbar.js +66 -0
  96. package/lib/tabview.d.ts +45 -0
  97. package/lib/tabview.js +79 -0
  98. package/lib/textarea.d.ts +59 -0
  99. package/lib/textarea.js +119 -0
  100. package/lib/textedit.d.ts +118 -0
  101. package/lib/textedit.js +406 -0
  102. package/lib/texthiliter.d.ts +56 -0
  103. package/lib/texthiliter.js +219 -0
  104. package/lib/toaster.d.ts +38 -0
  105. package/lib/toaster.js +58 -0
  106. package/lib/tools.d.ts +382 -0
  107. package/lib/tools.js +1096 -0
  108. package/lib/tooltips.d.ts +42 -0
  109. package/lib/tooltips.js +148 -0
  110. package/lib/treeview.d.ts +128 -0
  111. package/lib/treeview.js +490 -0
  112. package/lib/x4_events.d.ts +253 -0
  113. package/lib/x4_events.js +363 -0
  114. package/package.json +21 -0
  115. package/src/README.md +2 -0
  116. package/src/application.ts +191 -0
  117. package/src/base64.ts +162 -0
  118. package/src/base_component.ts +118 -0
  119. package/src/button.ts +327 -0
  120. package/src/calendar.ts +312 -0
  121. package/src/canvas.ts +501 -0
  122. package/src/cardview.ts +220 -0
  123. package/src/checkbox.ts +178 -0
  124. package/src/color.ts +748 -0
  125. package/src/colorpicker.ts +1618 -0
  126. package/src/combobox.ts +348 -0
  127. package/src/component.ts +2330 -0
  128. package/src/datastore.ts +1318 -0
  129. package/src/dialog.ts +631 -0
  130. package/src/dom_events.ts +297 -0
  131. package/src/drag_manager.ts +168 -0
  132. package/src/drawtext.ts +342 -0
  133. package/src/fileupload.ts +208 -0
  134. package/src/form.ts +362 -0
  135. package/src/formatters.ts +96 -0
  136. package/src/gridview.ts +1051 -0
  137. package/src/hosts/electron.ts +161 -0
  138. package/src/hosts/host.ts +100 -0
  139. package/src/hosts/nwjs.ts +141 -0
  140. package/src/hosts/nwjs_types.ts +339 -0
  141. package/src/i18n.ts +205 -0
  142. package/src/icon.ts +237 -0
  143. package/src/image.ts +198 -0
  144. package/src/input.ts +236 -0
  145. package/src/label.ts +124 -0
  146. package/src/layout.ts +366 -0
  147. package/src/link.ts +82 -0
  148. package/src/listview.ts +749 -0
  149. package/src/md5.ts +432 -0
  150. package/src/menu.ts +394 -0
  151. package/src/messagebox.ts +199 -0
  152. package/src/panel.ts +81 -0
  153. package/src/popup.ts +488 -0
  154. package/src/property_editor.ts +333 -0
  155. package/src/radiobtn.ts +190 -0
  156. package/src/rating.ts +131 -0
  157. package/src/request.ts +296 -0
  158. package/src/router.ts +43 -0
  159. package/src/settings.ts +75 -0
  160. package/src/sidebarview.ts +97 -0
  161. package/src/smartedit.ts +532 -0
  162. package/src/spreadsheet.ts +1423 -0
  163. package/src/styles.ts +332 -0
  164. package/src/svgcomponent.ts +440 -0
  165. package/src/tabbar.ts +105 -0
  166. package/src/tabview.ts +106 -0
  167. package/src/textarea.ts +183 -0
  168. package/src/textedit.ts +535 -0
  169. package/src/texthiliter.ts +284 -0
  170. package/src/toaster.ts +76 -0
  171. package/src/tools.ts +1391 -0
  172. package/src/tooltips.ts +185 -0
  173. package/src/treeview.ts +670 -0
  174. package/src/x4.less +1940 -0
  175. package/src/x4_events.ts +558 -0
  176. package/tsconfig.json +14 -0
@@ -0,0 +1,1457 @@
1
+ /**
2
+ * ___ ___ __
3
+ * \ \/ / / _
4
+ * \ / /_| |_
5
+ * / \____ _|
6
+ * /__/\__\ |_|
7
+ *
8
+ * @file colorpicker.ts
9
+ * @author Etienne Cochard
10
+ * @license
11
+ * Copyright (c) 2019-2021 R-libre ingenierie
12
+ *
13
+ * This program is free software; you can redistribute it and/or modify
14
+ * it under the terms of the GNU General Public License as published by
15
+ * the Free Software Foundation; either version 3 of the License, or
16
+ * (at your option) any later version.
17
+ *
18
+ * This program is distributed in the hope that it will be useful,
19
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
+ * GNU General Public License for more details.
22
+ *
23
+ * You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
24
+ **/
25
+ import { Container, Component } from './component';
26
+ import { CheckBox } from './checkbox';
27
+ import { Dialog } from './dialog';
28
+ import { EvChange } from './x4_events';
29
+ import { VLayout, HLayout } from './layout';
30
+ import { Label } from './label';
31
+ import { Color } from './color';
32
+ import { isString, getMousePos, clamp, classNames } from './tools';
33
+ import { TextEdit } from './textedit';
34
+ import { Menu, MenuItem } from './menu';
35
+ const pal_colors = {
36
+ blue: [0x0e5a8a, 0x106ba3, 0x137cbd, 0x2b95d6, 0x48aff0,],
37
+ green: [0x0a6640, 0x0d8050, 0x0f9960, 0x15b371, 0x3dcc91,],
38
+ orange: [0xa66321, 0xbf7326, 0xd9822b, 0xf29d49, 0xffb366,],
39
+ red: [0xa82a2a, 0xc23030, 0xdb3737, 0xf55656, 0xff7373,],
40
+ vermilion: [0x9e2b0e, 0xb83211, 0xd13913, 0xeb532d, 0xff6e4a,],
41
+ rose: [0xa82255, 0xc22762, 0xdb2c6f, 0xf5498b, 0xff66a1,],
42
+ violet: [0x5c255c, 0x752f75, 0x8f398f, 0xa854a8, 0xc274c2,],
43
+ indigo: [0x5642a6, 0x634dbf, 0x7157d9, 0x9179f2, 0xad99ff,],
44
+ cobalt: [0x1f4b99, 0x2458b3, 0x2965cc, 0x4580e6, 0x669eff,],
45
+ turquoise: [0x008075, 0x00998c, 0x00b3a4, 0x14ccbd, 0x2ee6d6,],
46
+ forest: [0x1d7324, 0x238c2c, 0x29a634, 0x43bf4d, 0x62d96b,],
47
+ lime: [0x728c23, 0x87a629, 0x9bbf30, 0xb6d94c, 0xd1f26d,],
48
+ gold: [0xa67908, 0xbf8c0a, 0xd99e0b, 0xf2b824, 0xffc940,],
49
+ sepia: [0x63411e, 0x7d5125, 0x96622d, 0xb07b46, 0xc99765,],
50
+ bw: [0x000000, 0x444444, 0x666666, 0xcccccc, 0xffffff,],
51
+ };
52
+ export class ColorPicker extends Container {
53
+ m_colorSel;
54
+ m_colorHue;
55
+ m_colorAlpha;
56
+ m_sample;
57
+ m_selMark;
58
+ m_hueMark;
59
+ m_alphaMark;
60
+ m_baseHSV;
61
+ m_baseColor;
62
+ m_transpCk;
63
+ m_colorEdit;
64
+ m_palmode;
65
+ static last_palmode = false;
66
+ constructor(props) {
67
+ super(props);
68
+ this.m_palmode = ColorPicker.last_palmode;
69
+ this.setDomEvent('contextmenu', (e) => this._showCtx(e));
70
+ }
71
+ _showCtx(e) {
72
+ const menu = new Menu({
73
+ items: [
74
+ new MenuItem({
75
+ text: 'Palette', checked: this.m_palmode, click: () => {
76
+ this.m_palmode = !this.m_palmode;
77
+ ColorPicker.last_palmode = this.m_palmode;
78
+ this.update();
79
+ }
80
+ })
81
+ ]
82
+ });
83
+ let pt = getMousePos(e, true);
84
+ menu.displayAt(pt.x, pt.y);
85
+ }
86
+ render(props) {
87
+ this.m_baseColor = props.color;
88
+ this.m_baseHSV = Color.toHSV(this.m_baseColor);
89
+ if (this.m_palmode) {
90
+ this.addClass("pal-mode");
91
+ let selector = null;
92
+ let cur = null;
93
+ let main_sel = [];
94
+ let sub_sel = [];
95
+ const ccolor = this.m_baseColor.value();
96
+ materialColors.forEach(mc => {
97
+ const color = mc.variations[4].hex;
98
+ let selected = color === ccolor;
99
+ if (!selected) {
100
+ selected = mc.variations.some(c => {
101
+ const cc = new Color(c.hex).value();
102
+ if (cc === ccolor) {
103
+ return true;
104
+ }
105
+ });
106
+ }
107
+ let cls = classNames('clr-box xbox', { selected });
108
+ let el = new Component({
109
+ cls,
110
+ style: { backgroundColor: new Color(color).toHex() },
111
+ data: { color, main: mc.variations }
112
+ });
113
+ if (selected) {
114
+ fillSubs(mc.variations);
115
+ }
116
+ main_sel.push(el);
117
+ });
118
+ function fillSubs(colors) {
119
+ sub_sel = [];
120
+ colors.forEach(mc => {
121
+ let clr = new Color(mc.hex);
122
+ const selected = clr.value() == ccolor;
123
+ let cls = classNames('hclr-box xbox', { selected });
124
+ let el = new Component({
125
+ cls,
126
+ style: { backgroundColor: clr.toHex(), color: Color.contrastColor(clr).toHex() },
127
+ data: { color: clr.value() },
128
+ content: clr.toHex()
129
+ });
130
+ sub_sel.push(el);
131
+ if (selected) {
132
+ cur = el;
133
+ }
134
+ });
135
+ if (selector) {
136
+ selector.itemWithId('vsel').setContent(sub_sel);
137
+ }
138
+ }
139
+ selector = new VLayout({
140
+ content: [
141
+ new HLayout({
142
+ id: 'hsel',
143
+ content: main_sel
144
+ }),
145
+ new VLayout({
146
+ id: 'vsel',
147
+ flex: 1,
148
+ content: sub_sel
149
+ })
150
+ ]
151
+ });
152
+ /*
153
+ let cur = null;
154
+ const buildCol = ( colors: number[] ) => {
155
+
156
+ const ccolor = this.m_baseColor.value();
157
+ const els = colors.map( x => {
158
+ const selected = x==ccolor;
159
+
160
+ let cls = classNames( 'clr-box', { selected } );
161
+ let el = new Component( { cls, style: { backgroundColor: new Color(x).toHex() }, data: { color: x } } );
162
+
163
+ if( selected ) {
164
+ cur = el;
165
+ }
166
+ return el;
167
+ });
168
+
169
+ return new VLayout( {
170
+ cls: 'vcol',
171
+ content: els
172
+ });
173
+ }
174
+
175
+ let rows = new HLayout( {
176
+ cls: 'hcol',
177
+ content: [
178
+ buildCol( pal_colors.blue ),
179
+ buildCol( pal_colors.green ),
180
+ buildCol( pal_colors.orange ),
181
+ buildCol( pal_colors.red ),
182
+ buildCol( pal_colors.vermilion ),
183
+ buildCol( pal_colors.rose ),
184
+ buildCol( pal_colors.violet ),
185
+ buildCol( pal_colors.indigo ),
186
+ buildCol( pal_colors.cobalt ),
187
+ buildCol( pal_colors.turquoise ),
188
+ buildCol( pal_colors.forest ),
189
+ buildCol( pal_colors.lime ),
190
+ buildCol( pal_colors.gold ),
191
+ buildCol( pal_colors.sepia ),
192
+ buildCol( pal_colors.bw ),
193
+ ]
194
+ });
195
+ */
196
+ this.m_colorEdit = new TextEdit({
197
+ cls: 'hexv',
198
+ value: '',
199
+ attrs: {
200
+ spellcheck: false,
201
+ },
202
+ change: (ev) => {
203
+ const clr = new Color(ev.value);
204
+ if (clr) {
205
+ this.m_baseColor = clr;
206
+ this.m_baseHSV = Color.toHSV(clr);
207
+ this._updateColor(false);
208
+ }
209
+ }
210
+ });
211
+ this.m_transpCk = new CheckBox({
212
+ cls: 'transp',
213
+ text: 'transparent',
214
+ change: (ev) => {
215
+ this.m_baseHSV.a = ev.value ? 0 : 1;
216
+ this._updateColor();
217
+ }
218
+ });
219
+ this.setContent([selector, this.m_transpCk, this.m_colorEdit]);
220
+ // globally handle click
221
+ selector.setDomEvent('click', (ev) => {
222
+ if (cur) {
223
+ cur.removeClass('selected');
224
+ cur = null;
225
+ }
226
+ let cell = Component.getElement(ev.target, 'xbox');
227
+ if (cell) {
228
+ const subs = cell.getData('main');
229
+ if (subs) {
230
+ fillSubs(subs);
231
+ }
232
+ else {
233
+ const clr = new Color(cell.getData('color'));
234
+ this.m_baseColor = clr;
235
+ this.m_baseHSV = Color.toHSV(clr);
236
+ this._updateColor();
237
+ cur = cell;
238
+ cell.addClass('selected');
239
+ }
240
+ }
241
+ });
242
+ }
243
+ else {
244
+ this.removeClass("pal-mode");
245
+ this.m_selMark = new Component({ cls: 'marker' });
246
+ this.m_colorSel = new Component({
247
+ cls: 'sel',
248
+ content: [
249
+ new Component({ cls: '@fit light' }),
250
+ new Component({ cls: '@fit dark' }),
251
+ this.m_selMark,
252
+ ]
253
+ });
254
+ this.m_hueMark = new Component({ cls: 'marker' });
255
+ this.m_colorHue = new Component({
256
+ cls: 'hue',
257
+ content: [
258
+ this.m_hueMark
259
+ ]
260
+ });
261
+ this.m_sample = new Component({ cls: 'sample' });
262
+ if (props.hasAlpha) {
263
+ this.addClass('with-alpha');
264
+ this.m_alphaMark = new Component({ cls: 'marker' });
265
+ this.m_colorAlpha = new Component({
266
+ cls: 'alpha',
267
+ content: [
268
+ new Component({ cls: 'bk @fit', ref: 'color' }),
269
+ this.m_alphaMark
270
+ ]
271
+ });
272
+ }
273
+ else {
274
+ this.removeClass('with-alpha');
275
+ this.m_transpCk = new CheckBox({
276
+ cls: 'transp',
277
+ text: 'transparent',
278
+ change: (ev) => {
279
+ this.m_baseHSV.a = ev.value ? 0 : 1;
280
+ this._updateColor();
281
+ }
282
+ });
283
+ }
284
+ this.m_colorEdit = new TextEdit({
285
+ cls: 'hexv',
286
+ value: '',
287
+ attrs: {
288
+ spellcheck: false,
289
+ },
290
+ change: (ev) => {
291
+ const clr = new Color(ev.value);
292
+ if (clr) {
293
+ this.m_baseColor = clr;
294
+ this.m_baseHSV = Color.toHSV(clr);
295
+ this._updateColor(false);
296
+ }
297
+ }
298
+ });
299
+ this.setContent([
300
+ this.m_colorSel,
301
+ this.m_colorHue,
302
+ this.m_colorAlpha,
303
+ this.m_transpCk,
304
+ this.m_colorEdit,
305
+ this.m_sample,
306
+ ]);
307
+ this.m_colorSel.setDomEvent('mousedown', (ev) => {
308
+ Component.setCapture(this, (e) => this._selChange(e));
309
+ });
310
+ this.m_colorHue.setDomEvent('mousedown', (ev) => {
311
+ Component.setCapture(this, (e) => this._hueChange(e));
312
+ });
313
+ if (props.hasAlpha) {
314
+ this.m_colorAlpha.setDomEvent('mousedown', (ev) => {
315
+ Component.setCapture(this, (e) => this._alphaChange(e));
316
+ });
317
+ }
318
+ this._updateColor();
319
+ }
320
+ }
321
+ set color(clr) {
322
+ this.m_baseColor = clr;
323
+ this.m_baseHSV = Color.toHSV(this.m_baseColor);
324
+ this._updateColor();
325
+ }
326
+ get color() {
327
+ return this.m_baseColor;
328
+ }
329
+ _selChange(ev) {
330
+ let pt = getMousePos(ev, true);
331
+ console.log(pt);
332
+ let rc = this.m_colorSel.getBoundingRect();
333
+ if (!this.m_props.hasAlpha) {
334
+ this.m_baseHSV.a = 1;
335
+ }
336
+ this.m_baseHSV.s = clamp((pt.x - rc.left) / rc.width, 0, 1);
337
+ this.m_baseHSV.v = 1 - clamp((pt.y - rc.top) / rc.height, 0, 1);
338
+ this._updateColor();
339
+ if (ev.type == 'mouseup' || ev.type == 'touchend') {
340
+ Component.releaseCapture();
341
+ }
342
+ }
343
+ _hueChange(ev) {
344
+ let pt = getMousePos(ev, true);
345
+ let rc = this.m_colorHue.getBoundingRect();
346
+ this.m_baseHSV.h = clamp((pt.y - rc.top) / rc.height, 0, 1);
347
+ this._updateColor();
348
+ if (ev.type == 'mouseup' || ev.type == 'touchend') {
349
+ Component.releaseCapture();
350
+ }
351
+ }
352
+ _alphaChange(ev) {
353
+ let pt = getMousePos(ev, true);
354
+ let rc = this.m_colorAlpha.getBoundingRect();
355
+ this.m_baseHSV.a = clamp((pt.x - rc.left) / rc.width, 0, 1);
356
+ this._updateColor();
357
+ if (ev.type == 'mouseup' || ev.type == 'touchend') {
358
+ Component.releaseCapture();
359
+ }
360
+ }
361
+ _updateColor(edit = true) {
362
+ let color;
363
+ if (!this.m_palmode) {
364
+ color = Color.fromHSV(this.m_baseHSV.h, 1, 1, 1);
365
+ this.m_colorSel.setStyleValue('backgroundColor', color.toString());
366
+ color = Color.fromHSV(this.m_baseHSV.h, this.m_baseHSV.s, this.m_baseHSV.v, 1);
367
+ this.m_sample.setStyleValue('backgroundColor', color.toString());
368
+ if (this.m_props.hasAlpha) {
369
+ let gradient = `linear-gradient(to right, rgba(0,0,0,0) 0%, ${color.toString()} 100%)`;
370
+ this.m_colorAlpha.itemWithRef('color').setStyleValue('backgroundImage', gradient);
371
+ }
372
+ this.m_selMark.setStyle({
373
+ left: (this.m_baseHSV.s * 100) + '%',
374
+ top: (100 - this.m_baseHSV.v * 100) + '%',
375
+ });
376
+ this.m_hueMark.setStyle({
377
+ top: (this.m_baseHSV.h * 100) + '%',
378
+ });
379
+ if (this.m_props.hasAlpha) {
380
+ this.m_alphaMark.setStyle({
381
+ left: (this.m_baseHSV.a * 100) + '%',
382
+ });
383
+ }
384
+ else {
385
+ this.m_transpCk.check = this.m_baseHSV.a == 0;
386
+ }
387
+ }
388
+ else {
389
+ this.m_transpCk.check = this.m_baseHSV.a == 0;
390
+ }
391
+ color = Color.fromHSV(this.m_baseHSV.h, this.m_baseHSV.s, this.m_baseHSV.v, this.m_baseHSV.a);
392
+ this.m_baseColor = color;
393
+ if (edit) {
394
+ this.m_colorEdit.value = color.alpha() == 1 ? color.toHex() : color.toString(); //color.toHex();
395
+ }
396
+ this._change();
397
+ }
398
+ _change() {
399
+ this.emit('change', EvChange(this.m_baseColor));
400
+ }
401
+ }
402
+ export class ColorPickerBox extends Dialog {
403
+ m_picker;
404
+ constructor(props) {
405
+ props.icon = undefined;
406
+ props.buttons = undefined;
407
+ super(props);
408
+ this.mapPropEvents(props, 'change');
409
+ this.m_picker = new ColorPicker({
410
+ color: props.color,
411
+ hasAlpha: props.hasAlpha,
412
+ style: { padding: 8 },
413
+ width: 250,
414
+ height: 250,
415
+ });
416
+ let customs = this._makeCustoms(props.cust_colors);
417
+ this.form.updateContent([
418
+ new VLayout({
419
+ content: [
420
+ this.m_picker,
421
+ customs
422
+ ]
423
+ })
424
+ ], ['ok', 'cancel']);
425
+ this.on('btnClick', (ev) => {
426
+ if (ev.button == 'ok') {
427
+ this.emit('change', EvChange(this.m_picker.color));
428
+ }
429
+ });
430
+ }
431
+ _makeCustoms(cc) {
432
+ let custom = null;
433
+ if (cc && cc.length > 0) {
434
+ let els = [];
435
+ for (let i = 0; i < cc.length; i += 8) {
436
+ let lne = [];
437
+ for (let j = 0; j < 8; j++) {
438
+ let idx = i + j, clr = cc[idx];
439
+ lne.push(new Label({
440
+ cls: 'cust-cc',
441
+ text: '',
442
+ flex: 1,
443
+ style: {
444
+ backgroundColor: clr ? clr.toString() : 'transparent'
445
+ },
446
+ tooltip: clr ? clr.toString() : undefined,
447
+ dom_events: {
448
+ click: () => {
449
+ if (clr) {
450
+ this.m_picker.color = clr;
451
+ this.emit('change', EvChange(clr));
452
+ this.close();
453
+ }
454
+ }
455
+ }
456
+ }));
457
+ }
458
+ els.push(new HLayout({ cls: 'line', content: lne }));
459
+ }
460
+ custom = new VLayout({ cls: 'customs', content: els });
461
+ }
462
+ return custom;
463
+ }
464
+ set color(clr) {
465
+ this.m_picker.color = clr;
466
+ }
467
+ get color() {
468
+ return this.m_picker.color;
469
+ }
470
+ /**
471
+ * display a messagebox
472
+ */
473
+ static show(props) {
474
+ let msg;
475
+ if (isString(props)) {
476
+ msg = new ColorPickerBox({ color: new Color(props) });
477
+ }
478
+ else {
479
+ msg = new ColorPickerBox(props);
480
+ }
481
+ msg.show();
482
+ return msg;
483
+ }
484
+ }
485
+ export class ColorPickerEditor extends HLayout {
486
+ constructor(props) {
487
+ super(props);
488
+ this.mapPropEvents(props, 'change');
489
+ }
490
+ render(props) {
491
+ let color = props.color;
492
+ let tcolor;
493
+ if (this._isTransp(color)) {
494
+ color = Color.NONE;
495
+ tcolor = 'black';
496
+ }
497
+ else {
498
+ tcolor = Color.contrastColor(color).toString();
499
+ }
500
+ this.setContent([
501
+ props.label ? new Label({
502
+ cls: 'label',
503
+ text: props.label,
504
+ flex: props.labelWidth < 0 ? -props.labelWidth : undefined,
505
+ width: props.labelWidth >= 0 ? props.labelWidth : undefined,
506
+ }) : null,
507
+ new Label({
508
+ cls: 'value',
509
+ flex: 1,
510
+ text: color.toHex(),
511
+ style: {
512
+ backgroundColor: color.toString(),
513
+ color: tcolor
514
+ },
515
+ dom_events: {
516
+ click: () => this._showPicker()
517
+ }
518
+ })
519
+ ]);
520
+ this._setTabIndex(props.tabIndex);
521
+ }
522
+ set value(color) {
523
+ this.m_props.color = color;
524
+ this.update();
525
+ }
526
+ get value() {
527
+ return this.m_props.color;
528
+ }
529
+ set custom_colors(v) {
530
+ this.m_props.cust_colors = v;
531
+ }
532
+ _showPicker() {
533
+ let dlg = new ColorPickerBox({
534
+ color: this.m_props.color,
535
+ cust_colors: this.m_props.cust_colors,
536
+ hasAlpha: this.m_props.hasAlpha,
537
+ events: {
538
+ change: (e) => {
539
+ this.m_props.color = e.value;
540
+ this._change();
541
+ this.update();
542
+ }
543
+ }
544
+ });
545
+ let rc = this.getBoundingRect();
546
+ dlg.displayAt(rc.left, rc.bottom, 'tl');
547
+ }
548
+ _change() {
549
+ this.emit('change', EvChange(this.m_props.color));
550
+ }
551
+ _isTransp(color) {
552
+ return !color.alpha();
553
+ }
554
+ }
555
+ // :: Material colors scheme ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
556
+ const materialColors = [
557
+ {
558
+ color: "Red",
559
+ variations: [
560
+ {
561
+ weight: 50,
562
+ hex: 0xFFEBEE
563
+ },
564
+ {
565
+ weight: 100,
566
+ hex: 0xFFCDD2
567
+ },
568
+ {
569
+ weight: 200,
570
+ hex: 0xEF9A9A
571
+ },
572
+ {
573
+ weight: 300,
574
+ hex: 0xE57373
575
+ },
576
+ {
577
+ weight: 400,
578
+ hex: 0xEF5350
579
+ },
580
+ {
581
+ weight: 500,
582
+ hex: 0xF44336
583
+ },
584
+ {
585
+ weight: 600,
586
+ hex: 0xE53935
587
+ },
588
+ {
589
+ weight: 700,
590
+ hex: 0xD32F2F
591
+ },
592
+ {
593
+ weight: 800,
594
+ hex: 0xC62828
595
+ },
596
+ {
597
+ weight: 900,
598
+ hex: 0xB71C1C
599
+ }
600
+ ]
601
+ },
602
+ {
603
+ color: "Pink",
604
+ variations: [
605
+ {
606
+ weight: 50,
607
+ hex: 0xFCE4EC
608
+ },
609
+ {
610
+ weight: 100,
611
+ hex: 0xF8BBD0
612
+ },
613
+ {
614
+ weight: 200,
615
+ hex: 0xF48FB1
616
+ },
617
+ {
618
+ weight: 300,
619
+ hex: 0xF06292
620
+ },
621
+ {
622
+ weight: 400,
623
+ hex: 0xEC407A
624
+ },
625
+ {
626
+ weight: 500,
627
+ hex: 0xE91E63
628
+ },
629
+ {
630
+ weight: 600,
631
+ hex: 0xD81B60
632
+ },
633
+ {
634
+ weight: 700,
635
+ hex: 0xC2185B
636
+ },
637
+ {
638
+ weight: 800,
639
+ hex: 0xAD1457
640
+ },
641
+ {
642
+ weight: 900,
643
+ hex: 0x880E4F
644
+ }
645
+ ]
646
+ },
647
+ {
648
+ color: "Purple",
649
+ variations: [
650
+ {
651
+ weight: 50,
652
+ hex: 0xF3E5F5
653
+ },
654
+ {
655
+ weight: 100,
656
+ hex: 0xE1BEE7
657
+ },
658
+ {
659
+ weight: 200,
660
+ hex: 0xCE93D8
661
+ },
662
+ {
663
+ weight: 300,
664
+ hex: 0xBA68C8
665
+ },
666
+ {
667
+ weight: 400,
668
+ hex: 0xAB47BC
669
+ },
670
+ {
671
+ weight: 500,
672
+ hex: 0x9C27B0
673
+ },
674
+ {
675
+ weight: 600,
676
+ hex: 0x8E24AA
677
+ },
678
+ {
679
+ weight: 700,
680
+ hex: 0x7B1FA2
681
+ },
682
+ {
683
+ weight: 800,
684
+ hex: 0x6A1B9A
685
+ },
686
+ {
687
+ weight: 900,
688
+ hex: 0x4A148C
689
+ }
690
+ ]
691
+ },
692
+ {
693
+ color: "Deep Purple",
694
+ variations: [
695
+ {
696
+ weight: 50,
697
+ hex: 0xEDE7F6
698
+ },
699
+ {
700
+ weight: 100,
701
+ hex: 0xD1C4E9
702
+ },
703
+ {
704
+ weight: 200,
705
+ hex: 0xB39DDB
706
+ },
707
+ {
708
+ weight: 300,
709
+ hex: 0x9575CD
710
+ },
711
+ {
712
+ weight: 400,
713
+ hex: 0x7E57C2
714
+ },
715
+ {
716
+ weight: 500,
717
+ hex: 0x673AB7
718
+ },
719
+ {
720
+ weight: 600,
721
+ hex: 0x5E35B1
722
+ },
723
+ {
724
+ weight: 700,
725
+ hex: 0x512DA8
726
+ },
727
+ {
728
+ weight: 800,
729
+ hex: 0x4527A0
730
+ },
731
+ {
732
+ weight: 900,
733
+ hex: 0x311B92
734
+ }
735
+ ]
736
+ },
737
+ {
738
+ color: "Indigo",
739
+ variations: [
740
+ {
741
+ weight: 50,
742
+ hex: 0xE8EAF6
743
+ },
744
+ {
745
+ weight: 100,
746
+ hex: 0xC5CAE9
747
+ },
748
+ {
749
+ weight: 200,
750
+ hex: 0x9FA8DA
751
+ },
752
+ {
753
+ weight: 300,
754
+ hex: 0x7986CB
755
+ },
756
+ {
757
+ weight: 400,
758
+ hex: 0x5C6BC0
759
+ },
760
+ {
761
+ weight: 500,
762
+ hex: 0x3F51B5
763
+ },
764
+ {
765
+ weight: 600,
766
+ hex: 0x3949AB
767
+ },
768
+ {
769
+ weight: 700,
770
+ hex: 0x303F9F
771
+ },
772
+ {
773
+ weight: 800,
774
+ hex: 0x283593
775
+ },
776
+ {
777
+ weight: 900,
778
+ hex: 0x1A237E
779
+ }
780
+ ]
781
+ },
782
+ {
783
+ color: "Blue",
784
+ variations: [
785
+ {
786
+ weight: 50,
787
+ hex: 0xE3F2FD
788
+ },
789
+ {
790
+ weight: 100,
791
+ hex: 0xBBDEFB
792
+ },
793
+ {
794
+ weight: 200,
795
+ hex: 0x90CAF9
796
+ },
797
+ {
798
+ weight: 300,
799
+ hex: 0x64B5F6
800
+ },
801
+ {
802
+ weight: 400,
803
+ hex: 0x42A5F5
804
+ },
805
+ {
806
+ weight: 500,
807
+ hex: 0x2196F3
808
+ },
809
+ {
810
+ weight: 600,
811
+ hex: 0x1E88E5
812
+ },
813
+ {
814
+ weight: 700,
815
+ hex: 0x1976D2
816
+ },
817
+ {
818
+ weight: 800,
819
+ hex: 0x1565C0
820
+ },
821
+ {
822
+ weight: 900,
823
+ hex: 0x0D47A1
824
+ }
825
+ ]
826
+ },
827
+ {
828
+ color: "Light Blue",
829
+ variations: [
830
+ {
831
+ weight: 50,
832
+ hex: 0xE1F5FE
833
+ },
834
+ {
835
+ weight: 100,
836
+ hex: 0xB3E5FC
837
+ },
838
+ {
839
+ weight: 200,
840
+ hex: 0x81D4FA
841
+ },
842
+ {
843
+ weight: 300,
844
+ hex: 0x4FC3F7
845
+ },
846
+ {
847
+ weight: 400,
848
+ hex: 0x29B6F6
849
+ },
850
+ {
851
+ weight: 500,
852
+ hex: 0x03A9F4
853
+ },
854
+ {
855
+ weight: 600,
856
+ hex: 0x039BE5
857
+ },
858
+ {
859
+ weight: 700,
860
+ hex: 0x0288D1
861
+ },
862
+ {
863
+ weight: 800,
864
+ hex: 0x0277BD
865
+ },
866
+ {
867
+ weight: 900,
868
+ hex: 0x01579B
869
+ }
870
+ ]
871
+ },
872
+ {
873
+ color: "Cyan",
874
+ variations: [
875
+ {
876
+ weight: 50,
877
+ hex: 0xE0F7FA
878
+ },
879
+ {
880
+ weight: 100,
881
+ hex: 0xB2EBF2
882
+ },
883
+ {
884
+ weight: 200,
885
+ hex: 0x80DEEA
886
+ },
887
+ {
888
+ weight: 300,
889
+ hex: 0x4DD0E1
890
+ },
891
+ {
892
+ weight: 400,
893
+ hex: 0x26C6DA
894
+ },
895
+ {
896
+ weight: 500,
897
+ hex: 0x00BCD4
898
+ },
899
+ {
900
+ weight: 600,
901
+ hex: 0x00ACC1
902
+ },
903
+ {
904
+ weight: 700,
905
+ hex: 0x0097A7
906
+ },
907
+ {
908
+ weight: 800,
909
+ hex: 0x00838F
910
+ },
911
+ {
912
+ weight: 900,
913
+ hex: 0x006064
914
+ }
915
+ ]
916
+ },
917
+ {
918
+ color: "Teal",
919
+ variations: [
920
+ {
921
+ weight: 50,
922
+ hex: 0xE0F2F1
923
+ },
924
+ {
925
+ weight: 100,
926
+ hex: 0xB2DFDB
927
+ },
928
+ {
929
+ weight: 200,
930
+ hex: 0x80CBC4
931
+ },
932
+ {
933
+ weight: 300,
934
+ hex: 0x4DB6AC
935
+ },
936
+ {
937
+ weight: 400,
938
+ hex: 0x26A69A
939
+ },
940
+ {
941
+ weight: 500,
942
+ hex: 0x009688
943
+ },
944
+ {
945
+ weight: 600,
946
+ hex: 0x00897B
947
+ },
948
+ {
949
+ weight: 700,
950
+ hex: 0x00796B
951
+ },
952
+ {
953
+ weight: 800,
954
+ hex: 0x00695C
955
+ },
956
+ {
957
+ weight: 900,
958
+ hex: 0x004D40
959
+ }
960
+ ]
961
+ },
962
+ {
963
+ color: "Green",
964
+ variations: [
965
+ {
966
+ weight: 50,
967
+ hex: 0xE8F5E9
968
+ },
969
+ {
970
+ weight: 100,
971
+ hex: 0xC8E6C9
972
+ },
973
+ {
974
+ weight: 200,
975
+ hex: 0xA5D6A7
976
+ },
977
+ {
978
+ weight: 300,
979
+ hex: 0x81C784
980
+ },
981
+ {
982
+ weight: 400,
983
+ hex: 0x66BB6A
984
+ },
985
+ {
986
+ weight: 500,
987
+ hex: 0x4CAF50
988
+ },
989
+ {
990
+ weight: 600,
991
+ hex: 0x43A047
992
+ },
993
+ {
994
+ weight: 700,
995
+ hex: 0x388E3C
996
+ },
997
+ {
998
+ weight: 800,
999
+ hex: 0x2E7D32
1000
+ },
1001
+ {
1002
+ weight: 900,
1003
+ hex: 0x1B5E20
1004
+ }
1005
+ ]
1006
+ },
1007
+ {
1008
+ color: "Light Green",
1009
+ variations: [
1010
+ {
1011
+ weight: 50,
1012
+ hex: 0xF1F8E9
1013
+ },
1014
+ {
1015
+ weight: 100,
1016
+ hex: 0xDCEDC8
1017
+ },
1018
+ {
1019
+ weight: 200,
1020
+ hex: 0xC5E1A5
1021
+ },
1022
+ {
1023
+ weight: 300,
1024
+ hex: 0xAED581
1025
+ },
1026
+ {
1027
+ weight: 400,
1028
+ hex: 0x9CCC65
1029
+ },
1030
+ {
1031
+ weight: 500,
1032
+ hex: 0x8BC34A
1033
+ },
1034
+ {
1035
+ weight: 600,
1036
+ hex: 0x7CB342
1037
+ },
1038
+ {
1039
+ weight: 700,
1040
+ hex: 0x689F38
1041
+ },
1042
+ {
1043
+ weight: 800,
1044
+ hex: 0x558B2F
1045
+ },
1046
+ {
1047
+ weight: 900,
1048
+ hex: 0x33691E
1049
+ }
1050
+ ]
1051
+ },
1052
+ {
1053
+ color: "Lime",
1054
+ variations: [
1055
+ {
1056
+ weight: 50,
1057
+ hex: 0xF9FBE7
1058
+ },
1059
+ {
1060
+ weight: 100,
1061
+ hex: 0xF0F4C3
1062
+ },
1063
+ {
1064
+ weight: 200,
1065
+ hex: 0xE6EE9C
1066
+ },
1067
+ {
1068
+ weight: 300,
1069
+ hex: 0xDCE775
1070
+ },
1071
+ {
1072
+ weight: 400,
1073
+ hex: 0xD4E157
1074
+ },
1075
+ {
1076
+ weight: 500,
1077
+ hex: 0xCDDC39
1078
+ },
1079
+ {
1080
+ weight: 600,
1081
+ hex: 0xC0CA33
1082
+ },
1083
+ {
1084
+ weight: 700,
1085
+ hex: 0xAFB42B
1086
+ },
1087
+ {
1088
+ weight: 800,
1089
+ hex: 0x9E9D24
1090
+ },
1091
+ {
1092
+ weight: 900,
1093
+ hex: 0x827717
1094
+ }
1095
+ ]
1096
+ },
1097
+ {
1098
+ color: "Yellow",
1099
+ variations: [
1100
+ {
1101
+ weight: 50,
1102
+ hex: 0xFFFDE7
1103
+ },
1104
+ {
1105
+ weight: 100,
1106
+ hex: 0xFFF9C4
1107
+ },
1108
+ {
1109
+ weight: 200,
1110
+ hex: 0xFFF59D
1111
+ },
1112
+ {
1113
+ weight: 300,
1114
+ hex: 0xFFF176
1115
+ },
1116
+ {
1117
+ weight: 400,
1118
+ hex: 0xFFEE58
1119
+ },
1120
+ {
1121
+ weight: 500,
1122
+ hex: 0xFFEB3B
1123
+ },
1124
+ {
1125
+ weight: 600,
1126
+ hex: 0xFDD835
1127
+ },
1128
+ {
1129
+ weight: 700,
1130
+ hex: 0xFBC02D
1131
+ },
1132
+ {
1133
+ weight: 800,
1134
+ hex: 0xF9A825
1135
+ },
1136
+ {
1137
+ weight: 900,
1138
+ hex: 0xF57F17
1139
+ }
1140
+ ]
1141
+ },
1142
+ {
1143
+ color: "Amber",
1144
+ variations: [
1145
+ {
1146
+ weight: 50,
1147
+ hex: 0xFFF8E1
1148
+ },
1149
+ {
1150
+ weight: 100,
1151
+ hex: 0xFFECB3
1152
+ },
1153
+ {
1154
+ weight: 200,
1155
+ hex: 0xFFE082
1156
+ },
1157
+ {
1158
+ weight: 300,
1159
+ hex: 0xFFD54F
1160
+ },
1161
+ {
1162
+ weight: 400,
1163
+ hex: 0xFFCA28
1164
+ },
1165
+ {
1166
+ weight: 500,
1167
+ hex: 0xFFC107
1168
+ },
1169
+ {
1170
+ weight: 600,
1171
+ hex: 0xFFB300
1172
+ },
1173
+ {
1174
+ weight: 700,
1175
+ hex: 0xFFA000
1176
+ },
1177
+ {
1178
+ weight: 800,
1179
+ hex: 0xFF8F00
1180
+ },
1181
+ {
1182
+ weight: 900,
1183
+ hex: 0xFF6F00
1184
+ }
1185
+ ]
1186
+ },
1187
+ {
1188
+ color: "Orange",
1189
+ variations: [
1190
+ {
1191
+ weight: 50,
1192
+ hex: 0xFFF3E0
1193
+ },
1194
+ {
1195
+ weight: 100,
1196
+ hex: 0xFFE0B2
1197
+ },
1198
+ {
1199
+ weight: 200,
1200
+ hex: 0xFFCC80
1201
+ },
1202
+ {
1203
+ weight: 300,
1204
+ hex: 0xFFB74D
1205
+ },
1206
+ {
1207
+ weight: 400,
1208
+ hex: 0xFFA726
1209
+ },
1210
+ {
1211
+ weight: 500,
1212
+ hex: 0xFF9800
1213
+ },
1214
+ {
1215
+ weight: 600,
1216
+ hex: 0xFB8C00
1217
+ },
1218
+ {
1219
+ weight: 700,
1220
+ hex: 0xF57C00
1221
+ },
1222
+ {
1223
+ weight: 800,
1224
+ hex: 0xEF6C00
1225
+ },
1226
+ {
1227
+ weight: 900,
1228
+ hex: 0xE65100
1229
+ }
1230
+ ]
1231
+ },
1232
+ {
1233
+ color: "Deep Orange",
1234
+ variations: [
1235
+ {
1236
+ weight: 50,
1237
+ hex: 0xFBE9E7
1238
+ },
1239
+ {
1240
+ weight: 100,
1241
+ hex: 0xFFCCBC
1242
+ },
1243
+ {
1244
+ weight: 200,
1245
+ hex: 0xFFAB91
1246
+ },
1247
+ {
1248
+ weight: 300,
1249
+ hex: 0xFF8A65
1250
+ },
1251
+ {
1252
+ weight: 400,
1253
+ hex: 0xFF7043
1254
+ },
1255
+ {
1256
+ weight: 500,
1257
+ hex: 0xFF5722
1258
+ },
1259
+ {
1260
+ weight: 600,
1261
+ hex: 0xF4511E
1262
+ },
1263
+ {
1264
+ weight: 700,
1265
+ hex: 0xE64A19
1266
+ },
1267
+ {
1268
+ weight: 800,
1269
+ hex: 0xD84315
1270
+ },
1271
+ {
1272
+ weight: 900,
1273
+ hex: 0xBF360C
1274
+ }
1275
+ ]
1276
+ },
1277
+ {
1278
+ color: "Brown",
1279
+ variations: [
1280
+ {
1281
+ weight: 50,
1282
+ hex: 0xEFEBE9
1283
+ },
1284
+ {
1285
+ weight: 100,
1286
+ hex: 0xD7CCC8
1287
+ },
1288
+ {
1289
+ weight: 200,
1290
+ hex: 0xBCAAA4
1291
+ },
1292
+ {
1293
+ weight: 300,
1294
+ hex: 0xA1887F
1295
+ },
1296
+ {
1297
+ weight: 400,
1298
+ hex: 0x8D6E63
1299
+ },
1300
+ {
1301
+ weight: 500,
1302
+ hex: 0x795548
1303
+ },
1304
+ {
1305
+ weight: 600,
1306
+ hex: 0x6D4C41
1307
+ },
1308
+ {
1309
+ weight: 700,
1310
+ hex: 0x5D4037
1311
+ },
1312
+ {
1313
+ weight: 800,
1314
+ hex: 0x4E342E
1315
+ },
1316
+ {
1317
+ weight: 900,
1318
+ hex: 0x3E2723
1319
+ }
1320
+ ]
1321
+ },
1322
+ {
1323
+ color: "Grey",
1324
+ variations: [
1325
+ {
1326
+ weight: 50,
1327
+ hex: 0xFAFAFA
1328
+ },
1329
+ {
1330
+ weight: 100,
1331
+ hex: 0xF5F5F5
1332
+ },
1333
+ {
1334
+ weight: 200,
1335
+ hex: 0xEEEEEE
1336
+ },
1337
+ {
1338
+ weight: 300,
1339
+ hex: 0xE0E0E0
1340
+ },
1341
+ {
1342
+ weight: 400,
1343
+ hex: 0xBDBDBD
1344
+ },
1345
+ {
1346
+ weight: 500,
1347
+ hex: 0x9E9E9E
1348
+ },
1349
+ {
1350
+ weight: 600,
1351
+ hex: 0x757575
1352
+ },
1353
+ {
1354
+ weight: 700,
1355
+ hex: 0x616161
1356
+ },
1357
+ {
1358
+ weight: 800,
1359
+ hex: 0x424242
1360
+ },
1361
+ {
1362
+ weight: 900,
1363
+ hex: 0x212121
1364
+ }
1365
+ ]
1366
+ },
1367
+ {
1368
+ color: "Blue Grey",
1369
+ variations: [
1370
+ {
1371
+ weight: 50,
1372
+ hex: 0xECEFF1
1373
+ },
1374
+ {
1375
+ weight: 100,
1376
+ hex: 0xCFD8DC
1377
+ },
1378
+ {
1379
+ weight: 200,
1380
+ hex: 0xB0BEC5
1381
+ },
1382
+ {
1383
+ weight: 300,
1384
+ hex: 0x90A4AE
1385
+ },
1386
+ {
1387
+ weight: 400,
1388
+ hex: 0x78909C
1389
+ },
1390
+ {
1391
+ weight: 500,
1392
+ hex: 0x607D8B
1393
+ },
1394
+ {
1395
+ weight: 600,
1396
+ hex: 0x546E7A
1397
+ },
1398
+ {
1399
+ weight: 700,
1400
+ hex: 0x455A64
1401
+ },
1402
+ {
1403
+ weight: 800,
1404
+ hex: 0x37474F
1405
+ },
1406
+ {
1407
+ weight: 900,
1408
+ hex: 0x263238
1409
+ }
1410
+ ]
1411
+ },
1412
+ {
1413
+ color: "Grey",
1414
+ variations: [
1415
+ {
1416
+ weight: 50,
1417
+ hex: 0xFFFFFF
1418
+ },
1419
+ {
1420
+ weight: 100,
1421
+ hex: 0xe0e0e0
1422
+ },
1423
+ {
1424
+ weight: 200,
1425
+ hex: 0xc4c4c4
1426
+ },
1427
+ {
1428
+ weight: 300,
1429
+ hex: 0xa8a8a8
1430
+ },
1431
+ {
1432
+ weight: 400,
1433
+ hex: 0x8c8c8c
1434
+ },
1435
+ {
1436
+ weight: 500,
1437
+ hex: 0x707070
1438
+ },
1439
+ {
1440
+ weight: 600,
1441
+ hex: 0x545454
1442
+ },
1443
+ {
1444
+ weight: 700,
1445
+ hex: 0x383838
1446
+ },
1447
+ {
1448
+ weight: 800,
1449
+ hex: 0x1c1c1c
1450
+ },
1451
+ {
1452
+ weight: 900,
1453
+ hex: 0x00000
1454
+ }
1455
+ ]
1456
+ }
1457
+ ];