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