x4js 1.5.17 → 1.5.20

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