@web-atoms/core 2.6.21 → 2.6.25

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 (137) hide show
  1. package/dist/App.d.ts +1 -1
  2. package/dist/App.d.ts.map +1 -1
  3. package/dist/App.js.map +1 -1
  4. package/dist/core/SingleInvoker.d.ts.map +1 -1
  5. package/dist/core/SingleInvoker.js.map +1 -1
  6. package/dist/core/sleep.js.map +1 -1
  7. package/dist/tsconfig.tsbuildinfo +1 -1
  8. package/dist-esm/App.d.ts +1 -1
  9. package/dist-esm/App.d.ts.map +1 -1
  10. package/dist-esm/App.js +231 -235
  11. package/dist-esm/App.js.map +1 -1
  12. package/dist-esm/Atom.js +93 -96
  13. package/dist-esm/MockApp.js +17 -18
  14. package/dist-esm/Pack.js +1 -3
  15. package/dist-esm/core/AtomBinder.js +189 -187
  16. package/dist-esm/core/AtomComponent.js +479 -502
  17. package/dist-esm/core/AtomDispatcher.js +46 -48
  18. package/dist-esm/core/AtomDisposableList.js +24 -25
  19. package/dist-esm/core/AtomEnumerator.js +15 -16
  20. package/dist-esm/core/AtomList.js +193 -192
  21. package/dist-esm/core/AtomLoader.js +229 -215
  22. package/dist-esm/core/AtomMap.js +7 -8
  23. package/dist-esm/core/AtomOnce.js +22 -24
  24. package/dist-esm/core/AtomSelectableList.js +240 -243
  25. package/dist-esm/core/AtomUri.js +70 -72
  26. package/dist-esm/core/AtomWatcher.js +105 -111
  27. package/dist-esm/core/Bind.js +271 -269
  28. package/dist-esm/core/BindableProperty.js +26 -27
  29. package/dist-esm/core/CancelTokenFactory.js +21 -24
  30. package/dist-esm/core/Color.js +1 -2
  31. package/dist-esm/core/Colors.js +545 -231
  32. package/dist-esm/core/Command.js +236 -223
  33. package/dist-esm/core/Defer.js +21 -22
  34. package/dist-esm/core/EventScope.js +96 -88
  35. package/dist-esm/core/ExpressionParser.js +132 -144
  36. package/dist-esm/core/ExtendControl.js +7 -8
  37. package/dist-esm/core/FormattedError.js +7 -8
  38. package/dist-esm/core/FormattedString.js +4 -5
  39. package/dist-esm/core/Hacks.js +41 -42
  40. package/dist-esm/core/IFetchEvent.js +1 -2
  41. package/dist-esm/core/IScreen.js +1 -2
  42. package/dist-esm/core/IValueConverter.js +1 -2
  43. package/dist-esm/core/InheritedProperty.js +61 -63
  44. package/dist-esm/core/InjectProperty.js +12 -13
  45. package/dist-esm/core/KeyValuePairs.js +1 -2
  46. package/dist-esm/core/Markdown.js +14 -17
  47. package/dist-esm/core/MarkdownError.js +6 -7
  48. package/dist-esm/core/PropertyBinding.js +1 -2
  49. package/dist-esm/core/PropertyMap.js +28 -27
  50. package/dist-esm/core/Route.js +149 -148
  51. package/dist-esm/core/SingleInvoker.d.ts.map +1 -1
  52. package/dist-esm/core/SingleInvoker.js +32 -35
  53. package/dist-esm/core/SingleInvoker.js.map +1 -1
  54. package/dist-esm/core/StringHelper.js +49 -51
  55. package/dist-esm/core/TransientDisposable.js +14 -16
  56. package/dist-esm/core/WatchProperty.js +18 -17
  57. package/dist-esm/core/WebImage.js +7 -8
  58. package/dist-esm/core/XNode.js +134 -117
  59. package/dist-esm/core/sleep.js +21 -24
  60. package/dist-esm/core/sleep.js.map +1 -1
  61. package/dist-esm/core/types.js +102 -103
  62. package/dist-esm/di/DISingleton.js +7 -5
  63. package/dist-esm/di/DITransient.js +7 -5
  64. package/dist-esm/di/IMockOrInject.js +1 -2
  65. package/dist-esm/di/IServiceProvider.js +1 -2
  66. package/dist-esm/di/Inject.js +67 -67
  67. package/dist-esm/di/Register.js +25 -26
  68. package/dist-esm/di/RegisterScoped.js +4 -3
  69. package/dist-esm/di/RegisterSingleton.js +4 -3
  70. package/dist-esm/di/ServiceCollection.js +38 -37
  71. package/dist-esm/di/ServiceProvider.js +94 -94
  72. package/dist-esm/di/TypeKey.js +13 -12
  73. package/dist-esm/services/BusyIndicatorService.js +7 -11
  74. package/dist-esm/services/CacheService.js +54 -62
  75. package/dist-esm/services/FetchBuilder.js +327 -278
  76. package/dist-esm/services/JsonService.js +118 -116
  77. package/dist-esm/services/MockNavigationService.js +127 -126
  78. package/dist-esm/services/NavigationService.js +95 -102
  79. package/dist-esm/services/ReferenceService.js +30 -33
  80. package/dist-esm/services/http/AjaxOptions.js +1 -3
  81. package/dist-esm/services/http/JsonError.js +16 -15
  82. package/dist-esm/services/http/RestService.js +314 -323
  83. package/dist-esm/style/StyleRule.js +1 -2
  84. package/dist-esm/test.js +0 -1
  85. package/dist-esm/tsconfig.esm.tsbuildinfo +1 -1
  86. package/dist-esm/unit/AtomTest.js +10 -11
  87. package/dist-esm/view-model/Action.js +258 -223
  88. package/dist-esm/view-model/AtomViewModel.js +234 -232
  89. package/dist-esm/view-model/AtomWindowViewModel.js +13 -14
  90. package/dist-esm/view-model/BindableUrlParameter.js +7 -8
  91. package/dist-esm/view-model/Delay.js +21 -25
  92. package/dist-esm/view-model/Disposable.js +28 -29
  93. package/dist-esm/view-model/Load.js +72 -73
  94. package/dist-esm/view-model/Once.js +33 -35
  95. package/dist-esm/view-model/baseTypes.js +4 -5
  96. package/dist-esm/view-model/bindPromise.js +24 -27
  97. package/dist-esm/view-model/bindProperty.js +3 -4
  98. package/dist-esm/view-model/bindUrlParameter.js +39 -43
  99. package/dist-esm/web/controls/AtomComboBox.js +56 -63
  100. package/dist-esm/web/controls/AtomControl.js +485 -490
  101. package/dist-esm/web/controls/AtomGridSplitter.js +57 -50
  102. package/dist-esm/web/controls/AtomGridView.js +230 -222
  103. package/dist-esm/web/controls/AtomItemsControl.js +677 -688
  104. package/dist-esm/web/controls/AtomPage.js +6 -7
  105. package/dist-esm/web/controls/AtomTemplate.js +1 -3
  106. package/dist-esm/web/controls/AtomTemplateControl.js +28 -29
  107. package/dist-esm/web/controls/AtomViewStack.js +19 -20
  108. package/dist-esm/web/core/AtomUI.js +200 -200
  109. package/dist-esm/web/core/Encoder.js +142 -152
  110. package/dist-esm/web/core/HtmlNode.js +141 -139
  111. package/dist-esm/web/images/Busy.js +1 -2
  112. package/dist-esm/web/images/BusyDataUrl.js +2 -869
  113. package/dist-esm/web/images/Button.js +1 -2
  114. package/dist-esm/web/images/ButtonDataUrl.js +2 -30
  115. package/dist-esm/web/images/CloseButton.js +1 -2
  116. package/dist-esm/web/images/CloseButtonDataUrl.js +2 -30
  117. package/dist-esm/web/images/CloseButtonHover.js +1 -2
  118. package/dist-esm/web/images/CloseButtonHoverDataUrl.js +2 -24
  119. package/dist-esm/web/services/LastTarget.js +31 -29
  120. package/dist-esm/web/services/MarkdownService.js +19 -31
  121. package/dist-esm/web/services/NotificationPopup.js +28 -21
  122. package/dist-esm/web/services/PopupService.js +512 -478
  123. package/dist-esm/web/services/PopupWindow.js +266 -247
  124. package/dist-esm/web/styles/AtomAlertWindowStyle.js +39 -40
  125. package/dist-esm/web/styles/AtomFrameStyle.js +15 -16
  126. package/dist-esm/web/styles/AtomNotificationStyle.js +19 -20
  127. package/dist-esm/web/styles/AtomPageLinkStyle.js +11 -12
  128. package/dist-esm/web/styles/AtomPopupStyle.js +9 -10
  129. package/dist-esm/web/styles/AtomStyle.js +61 -64
  130. package/dist-esm/web/styles/AtomStyleSheet.js +50 -51
  131. package/dist-esm/web/styles/AtomWindowStyle.js +116 -117
  132. package/dist-esm/web/styles/IStyleDeclaration.js +1 -2
  133. package/dist-esm/web/styles/StyleBuilder.js +79 -80
  134. package/package.json +3 -1
  135. package/src/App.ts +1 -1
  136. package/src/core/SingleInvoker.ts +1 -1
  137. package/src/core/sleep.ts +1 -1
@@ -1,244 +1,558 @@
1
1
  export class ColorItem {
2
- constructor(colorCodeOrRed, namedColorOrGreen, blue, alpha) {
3
- if (typeof colorCodeOrRed === "string") {
4
- this.colorCode = colorCodeOrRed;
5
- if (typeof namedColorOrGreen === "string") {
6
- this.namedColor = namedColorOrGreen;
7
- }
8
- const r = ColorItem.parseRgb(this.colorCode);
9
- this.red = r.red;
10
- this.green = r.green;
11
- this.blue = r.blue;
12
- this.alpha = r.alpha;
13
- }
14
- else {
15
- this.red = colorCodeOrRed;
16
- if (typeof namedColorOrGreen === "number") {
17
- this.green = namedColorOrGreen;
18
- }
19
- this.blue = blue;
20
- this.alpha = alpha;
21
- this.colorCode = ColorItem.rgb(this.red, this.green, this.blue, this.alpha);
22
- }
2
+ constructor(colorCodeOrRed, namedColorOrGreen, blue, alpha) {
3
+ if (typeof colorCodeOrRed === "string") {
4
+ this.colorCode = colorCodeOrRed;
5
+ if (typeof namedColorOrGreen === "string") {
6
+ this.namedColor = namedColorOrGreen;
7
+ }
8
+ const r = ColorItem.parseRgb(this.colorCode);
9
+ this.red = r.red;
10
+ this.green = r.green;
11
+ this.blue = r.blue;
12
+ this.alpha = r.alpha;
13
+ } else {
14
+ this.red = colorCodeOrRed;
15
+ if (typeof namedColorOrGreen === "number") {
16
+ this.green = namedColorOrGreen;
17
+ }
18
+ this.blue = blue;
19
+ this.alpha = alpha;
20
+ this.colorCode = ColorItem.rgb(this.red, this.green, this.blue, this.alpha);
23
21
  }
24
- toString() {
25
- return this.colorCode;
22
+ }
23
+ toString() {
24
+ return this.colorCode;
25
+ }
26
+ withAlphaPercent(a) {
27
+ return new ColorItem(this.red, this.green, this.blue, a);
28
+ }
29
+ static parseRgb(rgba) {
30
+ if (/^\#/.test(rgba)) {
31
+ rgba = rgba.substr(1);
32
+ if (rgba.length === 3) {
33
+ rgba = rgba.split("").map(x => x + x).join("");
34
+ }
35
+ const red = Number.parseInt(rgba[0] + rgba[1], 16);
36
+ const green = Number.parseInt(rgba[2] + rgba[3], 16);
37
+ const blue = Number.parseInt(rgba[4] + rgba[5], 16);
38
+ if (rgba.length > 6) {
39
+ const alpha = Number.parseInt(rgba[6] + rgba[7], 16);
40
+ return {
41
+ red,
42
+ green,
43
+ blue,
44
+ alpha
45
+ };
46
+ }
47
+ return {
48
+ red,
49
+ green,
50
+ blue
51
+ };
26
52
  }
27
- withAlphaPercent(a) {
28
- return new ColorItem(this.red, this.green, this.blue, a);
53
+ if (/^rgba/i.test(rgba)) {
54
+ rgba = rgba.substr(5);
55
+ rgba = rgba.substr(0, rgba.length - 1);
56
+ const a = rgba.split(",").map((x, i) => i === 3 ? Number.parseFloat(x) : Number.parseInt(x, 10));
57
+ return {
58
+ red: a[0],
59
+ green: a[1],
60
+ blue: a[2],
61
+ alpha: a[3]
62
+ };
29
63
  }
30
- static parseRgb(rgba) {
31
- if (/^\#/.test(rgba)) {
32
- rgba = rgba.substr(1);
33
- if (rgba.length === 3) {
34
- rgba = rgba.split("").map((x) => x + x).join("");
35
- }
36
- const red = Number.parseInt(rgba[0] + rgba[1], 16);
37
- const green = Number.parseInt(rgba[2] + rgba[3], 16);
38
- const blue = Number.parseInt(rgba[4] + rgba[5], 16);
39
- if (rgba.length > 6) {
40
- const alpha = Number.parseInt(rgba[6] + rgba[7], 16);
41
- return { red, green, blue, alpha };
42
- }
43
- return { red, green, blue };
44
- }
45
- if (/^rgba/i.test(rgba)) {
46
- rgba = rgba.substr(5);
47
- rgba = rgba.substr(0, rgba.length - 1);
48
- const a = rgba.split(",").map((x, i) => i === 3 ? Number.parseFloat(x) : Number.parseInt(x, 10));
49
- return { red: a[0], green: a[1], blue: a[2], alpha: a[3] };
50
- }
51
- if (/^rgb/i.test(rgba)) {
52
- rgba = rgba.substr(4);
53
- rgba = rgba.substr(0, rgba.length - 1);
54
- const a = rgba.split(",").map((x) => Number.parseInt(x, 10));
55
- return { red: a[0], green: a[1], blue: a[2] };
56
- }
57
- throw new Error("Unknown color format " + rgba);
64
+ if (/^rgb/i.test(rgba)) {
65
+ rgba = rgba.substr(4);
66
+ rgba = rgba.substr(0, rgba.length - 1);
67
+ const a = rgba.split(",").map(x => Number.parseInt(x, 10));
68
+ return {
69
+ red: a[0],
70
+ green: a[1],
71
+ blue: a[2]
72
+ };
58
73
  }
59
- static rgb(r, g, b, a) {
60
- if (a !== undefined) {
61
- return `rgba(${r},${g},${b},${a})`;
62
- }
63
- return "#" + toFixedString(r) + toFixedString(g) + toFixedString(b);
74
+ throw new Error("Unknown color format " + rgba);
75
+ }
76
+ static rgb(r, g, b, a) {
77
+ if (a !== undefined) {
78
+ return `rgba(${r},${g},${b},${a})`;
64
79
  }
80
+ return "#" + toFixedString(r) + toFixedString(g) + toFixedString(b);
81
+ }
65
82
  }
66
83
  function toFixedString(t) {
67
- return ("0" + t.toString(16)).slice(-2);
84
+ return ("0" + t.toString(16)).slice(-2);
68
85
  }
69
86
  export default class Colors {
70
- static rgba(red, green, blue, alpha) {
71
- return new ColorItem(red, green, blue, alpha);
87
+ static rgba(red, green, blue, alpha) {
88
+ return new ColorItem(red, green, blue, alpha);
89
+ }
90
+ static parse(color) {
91
+ if (!color) {
92
+ return null;
72
93
  }
73
- static parse(color) {
74
- if (!color) {
75
- return null;
76
- }
77
- color = color.toLowerCase();
78
- for (const key in Colors) {
79
- if (Colors.hasOwnProperty(key)) {
80
- const element = Colors[key];
81
- if (element instanceof ColorItem) {
82
- const ci = element;
83
- if (ci.namedColor === color) {
84
- return ci;
85
- }
86
- }
87
- }
88
- }
89
- if (/^(\#|rgb\(|rgba\()/i.test(color)) {
90
- return new ColorItem(color);
94
+ color = color.toLowerCase();
95
+ for (const key in Colors) {
96
+ if (Colors.hasOwnProperty(key)) {
97
+ const element = Colors[key];
98
+ if (element instanceof ColorItem) {
99
+ const ci = element;
100
+ if (ci.namedColor === color) {
101
+ return ci;
102
+ }
91
103
  }
92
- throw new Error("Invalid color format " + color);
104
+ }
93
105
  }
94
- static { this.black = new ColorItem("#000000", "black"); }
95
- static { this.silver = new ColorItem("#c0c0c0", "silver"); }
96
- static { this.gray = new ColorItem("#808080", "gray"); }
97
- static { this.white = new ColorItem("#ffffff", "white"); }
98
- static { this.maroon = new ColorItem("#800000", "maroon"); }
99
- static { this.red = new ColorItem("#ff0000", "red"); }
100
- static { this.purple = new ColorItem("#800080", "purple"); }
101
- static { this.fuchsia = new ColorItem("#ff00ff", "fuchsia"); }
102
- static { this.green = new ColorItem("#008000", "green"); }
103
- static { this.lime = new ColorItem("#00ff00", "lime"); }
104
- static { this.olive = new ColorItem("#808000", "olive"); }
105
- static { this.yellow = new ColorItem("#ffff00", "yellow"); }
106
- static { this.navy = new ColorItem("#000080", "navy"); }
107
- static { this.blue = new ColorItem("#0000ff", "blue"); }
108
- static { this.teal = new ColorItem("#008080", "teal"); }
109
- static { this.aqua = new ColorItem("#00ffff", "aqua"); }
110
- static { this.orange = new ColorItem("#ffa500", "orange"); }
111
- static { this.aliceBlue = new ColorItem("#f0f8ff", "aliceblue"); }
112
- static { this.antiqueWhite = new ColorItem("#faebd7", "antiquewhite"); }
113
- static { this.aquaMarine = new ColorItem("#7fffd4", "aquamarine"); }
114
- static { this.azure = new ColorItem("#f0ffff", "azure"); }
115
- static { this.beige = new ColorItem("#f5f5dc", "beige"); }
116
- static { this.bisque = new ColorItem("#ffe4c4", "bisque"); }
117
- static { this.blanchedAlmond = new ColorItem("#ffebcd", "blanchedalmond"); }
118
- static { this.blueViolet = new ColorItem("#8a2be2", "blueviolet"); }
119
- static { this.brown = new ColorItem("#a52a2a", "brown"); }
120
- static { this.burlyWood = new ColorItem("#deb887", "burlywood"); }
121
- static { this.cadetBlue = new ColorItem("#5f9ea0", "cadetblue"); }
122
- static { this.chartReuse = new ColorItem("#7fff00", "chartreuse"); }
123
- static { this.chocolate = new ColorItem("#d2691e", "chocolate"); }
124
- static { this.coral = new ColorItem("#ff7f50", "coral"); }
125
- static { this.cornFlowerBlue = new ColorItem("#6495ed", "cornflowerblue"); }
126
- static { this.cornSilk = new ColorItem("#fff8dc", "cornsilk"); }
127
- static { this.crimson = new ColorItem("#dc143c", "crimson"); }
128
- static { this.cyan = new ColorItem("#00ffff", "cyan"); }
129
- static { this.darkBlue = new ColorItem("#00008b", "darkblue"); }
130
- static { this.darkCyan = new ColorItem("#008b8b", "darkcyan"); }
131
- static { this.darkGoldenRod = new ColorItem("#b8860b", "darkgoldenrod"); }
132
- static { this.darkGray = new ColorItem("#a9a9a9", "darkgray"); }
133
- static { this.darkGreen = new ColorItem("#006400", "darkgreen"); }
134
- static { this.darkGrey = new ColorItem("#a9a9a9", "darkgrey"); }
135
- static { this.darkKhaki = new ColorItem("#bdb76b", "darkkhaki"); }
136
- static { this.darkMagenta = new ColorItem("#8b008b", "darkmagenta"); }
137
- static { this.darkOliveGreen = new ColorItem("#556b2f", "darkolivegreen"); }
138
- static { this.darkOrange = new ColorItem("#ff8c00", "darkorange"); }
139
- static { this.darkOrchid = new ColorItem("#9932cc", "darkorchid"); }
140
- static { this.darkRed = new ColorItem("#8b0000", "darkred"); }
141
- static { this.darkSalmon = new ColorItem("#e9967a", "darksalmon"); }
142
- static { this.darkSeaGreen = new ColorItem("#8fbc8f", "darkseagreen"); }
143
- static { this.darkSlateBlue = new ColorItem("#483d8b", "darkslateblue"); }
144
- static { this.darkSlateGray = new ColorItem("#2f4f4f", "darkslategray"); }
145
- static { this.darkSlateGrey = new ColorItem("#2f4f4f", "darkslategrey"); }
146
- static { this.darkTurquoise = new ColorItem("#00ced1", "darkturquoise"); }
147
- static { this.darkViolet = new ColorItem("#9400d3", "darkviolet"); }
148
- static { this.deepPink = new ColorItem("#ff1493", "deeppink"); }
149
- static { this.deepSkyBlue = new ColorItem("#00bfff", "deepskyblue"); }
150
- static { this.dimGray = new ColorItem("#696969", "dimgray"); }
151
- static { this.dimGrey = new ColorItem("#696969", "dimgrey"); }
152
- static { this.dodgerBlue = new ColorItem("#1e90ff", "dodgerblue"); }
153
- static { this.fireBrick = new ColorItem("#b22222", "firebrick"); }
154
- static { this.floralWhite = new ColorItem("#fffaf0", "floralwhite"); }
155
- static { this.forestGreen = new ColorItem("#228b22", "forestgreen"); }
156
- static { this.gainsboro = new ColorItem("#dcdcdc", "gainsboro"); }
157
- static { this.ghostWhite = new ColorItem("#f8f8ff", "ghostwhite"); }
158
- static { this.gold = new ColorItem("#ffd700", "gold"); }
159
- static { this.goldenRod = new ColorItem("#daa520", "goldenrod"); }
160
- static { this.greenYellow = new ColorItem("#adff2f", "greenyellow"); }
161
- static { this.grey = new ColorItem("#808080", "grey"); }
162
- static { this.honeyDew = new ColorItem("#f0fff0", "honeydew"); }
163
- static { this.hotPink = new ColorItem("#ff69b4", "hotpink"); }
164
- static { this.indianRed = new ColorItem("#cd5c5c", "indianred"); }
165
- static { this.indigo = new ColorItem("#4b0082", "indigo"); }
166
- static { this.ivory = new ColorItem("#fffff0", "ivory"); }
167
- static { this.khaki = new ColorItem("#f0e68c", "khaki"); }
168
- static { this.lavender = new ColorItem("#e6e6fa", "lavender"); }
169
- static { this.lavenderBlush = new ColorItem("#fff0f5", "lavenderblush"); }
170
- static { this.lawnGreen = new ColorItem("#7cfc00", "lawngreen"); }
171
- static { this.lemonChiffon = new ColorItem("#fffacd", "lemonchiffon"); }
172
- static { this.lightBlue = new ColorItem("#add8e6", "lightblue"); }
173
- static { this.lightCoral = new ColorItem("#f08080", "lightcoral"); }
174
- static { this.lightCyan = new ColorItem("#e0ffff", "lightcyan"); }
175
- static { this.lightGoldenRodYellow = new ColorItem("#fafad2", "lightgoldenrodyellow"); }
176
- static { this.lightGray = new ColorItem("#d3d3d3", "lightgray"); }
177
- static { this.lightGreen = new ColorItem("#90ee90", "lightgreen"); }
178
- static { this.lightGrey = new ColorItem("#d3d3d3", "lightgrey"); }
179
- static { this.lightPink = new ColorItem("#ffb6c1", "lightpink"); }
180
- static { this.lightSalmon = new ColorItem("#ffa07a", "lightsalmon"); }
181
- static { this.lightSeaGreen = new ColorItem("#20b2aa", "lightseagreen"); }
182
- static { this.lightSkyBlue = new ColorItem("#87cefa", "lightskyblue"); }
183
- static { this.lightSlateGray = new ColorItem("#778899", "lightslategray"); }
184
- static { this.lightSlateGrey = new ColorItem("#778899", "lightslategrey"); }
185
- static { this.lightSteelBlue = new ColorItem("#b0c4de", "lightsteelblue"); }
186
- static { this.lightYellow = new ColorItem("#ffffe0", "lightyellow"); }
187
- static { this.limeGreen = new ColorItem("#32cd32", "limegreen"); }
188
- static { this.linen = new ColorItem("#faf0e6", "linen"); }
189
- static { this.magenta = new ColorItem("#ff00ff", "magenta"); }
190
- static { this.mediumAquaMarine = new ColorItem("#66cdaa", "mediumaquamarine"); }
191
- static { this.mediumBlue = new ColorItem("#0000cd", "mediumblue"); }
192
- static { this.mediumOrchid = new ColorItem("#ba55d3", "mediumorchid"); }
193
- static { this.mediumPurple = new ColorItem("#9370db", "mediumpurple"); }
194
- static { this.mediumSeaGreen = new ColorItem("#3cb371", "mediumseagreen"); }
195
- static { this.mediumSlateBlue = new ColorItem("#7b68ee", "mediumslateblue"); }
196
- static { this.mediumSpringGreen = new ColorItem("#00fa9a", "mediumspringgreen"); }
197
- static { this.mediumTurquoise = new ColorItem("#48d1cc", "mediumturquoise"); }
198
- static { this.mediumVioletred = new ColorItem("#c71585", "mediumvioletred"); }
199
- static { this.midNightBlue = new ColorItem("#191970", "midnightblue"); }
200
- static { this.mintCream = new ColorItem("#f5fffa", "mintcream"); }
201
- static { this.mistyRose = new ColorItem("#ffe4e1", "mistyrose"); }
202
- static { this.moccasin = new ColorItem("#ffe4b5", "moccasin"); }
203
- static { this.navajoWhite = new ColorItem("#ffdead", "navajowhite"); }
204
- static { this.oldLace = new ColorItem("#fdf5e6", "oldlace"); }
205
- static { this.oliveDrab = new ColorItem("#6b8e23", "olivedrab"); }
206
- static { this.orangeRed = new ColorItem("#ff4500", "orangered"); }
207
- static { this.orchid = new ColorItem("#da70d6", "orchid"); }
208
- static { this.paleGoldenRod = new ColorItem("#eee8aa", "palegoldenrod"); }
209
- static { this.paleGreen = new ColorItem("#98fb98", "palegreen"); }
210
- static { this.paleTurquoise = new ColorItem("#afeeee", "paleturquoise"); }
211
- static { this.paleVioletRed = new ColorItem("#db7093", "palevioletred"); }
212
- static { this.papayaWhip = new ColorItem("#ffefd5", "papayawhip"); }
213
- static { this.peachPuff = new ColorItem("#ffdab9", "peachpuff"); }
214
- static { this.peru = new ColorItem("#cd853f", "peru"); }
215
- static { this.pink = new ColorItem("#ffc0cb", "pink"); }
216
- static { this.plum = new ColorItem("#dda0dd", "plum"); }
217
- static { this.powderBlue = new ColorItem("#b0e0e6", "powderblue"); }
218
- static { this.rosyBrown = new ColorItem("#bc8f8f", "rosybrown"); }
219
- static { this.royalBlue = new ColorItem("#4169e1", "royalblue"); }
220
- static { this.saddleBrown = new ColorItem("#8b4513", "saddlebrown"); }
221
- static { this.salmon = new ColorItem("#fa8072", "salmon"); }
222
- static { this.sandyBrown = new ColorItem("#f4a460", "sandybrown"); }
223
- static { this.seaGreen = new ColorItem("#2e8b57", "seagreen"); }
224
- static { this.seaShell = new ColorItem("#fff5ee", "seashell"); }
225
- static { this.sienna = new ColorItem("#a0522d", "sienna"); }
226
- static { this.skyBlue = new ColorItem("#87ceeb", "skyblue"); }
227
- static { this.slateBlue = new ColorItem("#6a5acd", "slateblue"); }
228
- static { this.slateGray = new ColorItem("#708090", "slategray"); }
229
- static { this.slateGrey = new ColorItem("#708090", "slategrey"); }
230
- static { this.snow = new ColorItem("#fffafa", "snow"); }
231
- static { this.springGreen = new ColorItem("#00ff7f", "springgreen"); }
232
- static { this.steelBlue = new ColorItem("#4682b4", "steelblue"); }
233
- static { this.tan = new ColorItem("#d2b48c", "tan"); }
234
- static { this.thistle = new ColorItem("#d8bfd8", "thistle"); }
235
- static { this.tomato = new ColorItem("#ff6347", "tomato"); }
236
- static { this.turquoise = new ColorItem("#40e0d0", "turquoise"); }
237
- static { this.violet = new ColorItem("#ee82ee", "violet"); }
238
- static { this.wheat = new ColorItem("#f5deb3", "wheat"); }
239
- static { this.whiteSmoke = new ColorItem("#f5f5f5", "whitesmoke"); }
240
- static { this.yellowGreen = new ColorItem("#9acd32", "yellowgreen"); }
241
- static { this.rebeccaPurple = new ColorItem("#663399", "rebeccapurple"); }
242
- static { this.transparent = new ColorItem("#00000000", "transparent"); }
243
- }
244
- //# sourceMappingURL=Colors.js.map
106
+ if (/^(\#|rgb\(|rgba\()/i.test(color)) {
107
+ return new ColorItem(color);
108
+ }
109
+ throw new Error("Invalid color format " + color);
110
+ }
111
+ static {
112
+ this.black = new ColorItem("#000000", "black");
113
+ }
114
+ static {
115
+ this.silver = new ColorItem("#c0c0c0", "silver");
116
+ }
117
+ static {
118
+ this.gray = new ColorItem("#808080", "gray");
119
+ }
120
+ static {
121
+ this.white = new ColorItem("#ffffff", "white");
122
+ }
123
+ static {
124
+ this.maroon = new ColorItem("#800000", "maroon");
125
+ }
126
+ static {
127
+ this.red = new ColorItem("#ff0000", "red");
128
+ }
129
+ static {
130
+ this.purple = new ColorItem("#800080", "purple");
131
+ }
132
+ static {
133
+ this.fuchsia = new ColorItem("#ff00ff", "fuchsia");
134
+ }
135
+ static {
136
+ this.green = new ColorItem("#008000", "green");
137
+ }
138
+ static {
139
+ this.lime = new ColorItem("#00ff00", "lime");
140
+ }
141
+ static {
142
+ this.olive = new ColorItem("#808000", "olive");
143
+ }
144
+ static {
145
+ this.yellow = new ColorItem("#ffff00", "yellow");
146
+ }
147
+ static {
148
+ this.navy = new ColorItem("#000080", "navy");
149
+ }
150
+ static {
151
+ this.blue = new ColorItem("#0000ff", "blue");
152
+ }
153
+ static {
154
+ this.teal = new ColorItem("#008080", "teal");
155
+ }
156
+ static {
157
+ this.aqua = new ColorItem("#00ffff", "aqua");
158
+ }
159
+ static {
160
+ this.orange = new ColorItem("#ffa500", "orange");
161
+ }
162
+ static {
163
+ this.aliceBlue = new ColorItem("#f0f8ff", "aliceblue");
164
+ }
165
+ static {
166
+ this.antiqueWhite = new ColorItem("#faebd7", "antiquewhite");
167
+ }
168
+ static {
169
+ this.aquaMarine = new ColorItem("#7fffd4", "aquamarine");
170
+ }
171
+ static {
172
+ this.azure = new ColorItem("#f0ffff", "azure");
173
+ }
174
+ static {
175
+ this.beige = new ColorItem("#f5f5dc", "beige");
176
+ }
177
+ static {
178
+ this.bisque = new ColorItem("#ffe4c4", "bisque");
179
+ }
180
+ static {
181
+ this.blanchedAlmond = new ColorItem("#ffebcd", "blanchedalmond");
182
+ }
183
+ static {
184
+ this.blueViolet = new ColorItem("#8a2be2", "blueviolet");
185
+ }
186
+ static {
187
+ this.brown = new ColorItem("#a52a2a", "brown");
188
+ }
189
+ static {
190
+ this.burlyWood = new ColorItem("#deb887", "burlywood");
191
+ }
192
+ static {
193
+ this.cadetBlue = new ColorItem("#5f9ea0", "cadetblue");
194
+ }
195
+ static {
196
+ this.chartReuse = new ColorItem("#7fff00", "chartreuse");
197
+ }
198
+ static {
199
+ this.chocolate = new ColorItem("#d2691e", "chocolate");
200
+ }
201
+ static {
202
+ this.coral = new ColorItem("#ff7f50", "coral");
203
+ }
204
+ static {
205
+ this.cornFlowerBlue = new ColorItem("#6495ed", "cornflowerblue");
206
+ }
207
+ static {
208
+ this.cornSilk = new ColorItem("#fff8dc", "cornsilk");
209
+ }
210
+ static {
211
+ this.crimson = new ColorItem("#dc143c", "crimson");
212
+ }
213
+ static {
214
+ this.cyan = new ColorItem("#00ffff", "cyan");
215
+ }
216
+ static {
217
+ this.darkBlue = new ColorItem("#00008b", "darkblue");
218
+ }
219
+ static {
220
+ this.darkCyan = new ColorItem("#008b8b", "darkcyan");
221
+ }
222
+ static {
223
+ this.darkGoldenRod = new ColorItem("#b8860b", "darkgoldenrod");
224
+ }
225
+ static {
226
+ this.darkGray = new ColorItem("#a9a9a9", "darkgray");
227
+ }
228
+ static {
229
+ this.darkGreen = new ColorItem("#006400", "darkgreen");
230
+ }
231
+ static {
232
+ this.darkGrey = new ColorItem("#a9a9a9", "darkgrey");
233
+ }
234
+ static {
235
+ this.darkKhaki = new ColorItem("#bdb76b", "darkkhaki");
236
+ }
237
+ static {
238
+ this.darkMagenta = new ColorItem("#8b008b", "darkmagenta");
239
+ }
240
+ static {
241
+ this.darkOliveGreen = new ColorItem("#556b2f", "darkolivegreen");
242
+ }
243
+ static {
244
+ this.darkOrange = new ColorItem("#ff8c00", "darkorange");
245
+ }
246
+ static {
247
+ this.darkOrchid = new ColorItem("#9932cc", "darkorchid");
248
+ }
249
+ static {
250
+ this.darkRed = new ColorItem("#8b0000", "darkred");
251
+ }
252
+ static {
253
+ this.darkSalmon = new ColorItem("#e9967a", "darksalmon");
254
+ }
255
+ static {
256
+ this.darkSeaGreen = new ColorItem("#8fbc8f", "darkseagreen");
257
+ }
258
+ static {
259
+ this.darkSlateBlue = new ColorItem("#483d8b", "darkslateblue");
260
+ }
261
+ static {
262
+ this.darkSlateGray = new ColorItem("#2f4f4f", "darkslategray");
263
+ }
264
+ static {
265
+ this.darkSlateGrey = new ColorItem("#2f4f4f", "darkslategrey");
266
+ }
267
+ static {
268
+ this.darkTurquoise = new ColorItem("#00ced1", "darkturquoise");
269
+ }
270
+ static {
271
+ this.darkViolet = new ColorItem("#9400d3", "darkviolet");
272
+ }
273
+ static {
274
+ this.deepPink = new ColorItem("#ff1493", "deeppink");
275
+ }
276
+ static {
277
+ this.deepSkyBlue = new ColorItem("#00bfff", "deepskyblue");
278
+ }
279
+ static {
280
+ this.dimGray = new ColorItem("#696969", "dimgray");
281
+ }
282
+ static {
283
+ this.dimGrey = new ColorItem("#696969", "dimgrey");
284
+ }
285
+ static {
286
+ this.dodgerBlue = new ColorItem("#1e90ff", "dodgerblue");
287
+ }
288
+ static {
289
+ this.fireBrick = new ColorItem("#b22222", "firebrick");
290
+ }
291
+ static {
292
+ this.floralWhite = new ColorItem("#fffaf0", "floralwhite");
293
+ }
294
+ static {
295
+ this.forestGreen = new ColorItem("#228b22", "forestgreen");
296
+ }
297
+ static {
298
+ this.gainsboro = new ColorItem("#dcdcdc", "gainsboro");
299
+ }
300
+ static {
301
+ this.ghostWhite = new ColorItem("#f8f8ff", "ghostwhite");
302
+ }
303
+ static {
304
+ this.gold = new ColorItem("#ffd700", "gold");
305
+ }
306
+ static {
307
+ this.goldenRod = new ColorItem("#daa520", "goldenrod");
308
+ }
309
+ static {
310
+ this.greenYellow = new ColorItem("#adff2f", "greenyellow");
311
+ }
312
+ static {
313
+ this.grey = new ColorItem("#808080", "grey");
314
+ }
315
+ static {
316
+ this.honeyDew = new ColorItem("#f0fff0", "honeydew");
317
+ }
318
+ static {
319
+ this.hotPink = new ColorItem("#ff69b4", "hotpink");
320
+ }
321
+ static {
322
+ this.indianRed = new ColorItem("#cd5c5c", "indianred");
323
+ }
324
+ static {
325
+ this.indigo = new ColorItem("#4b0082", "indigo");
326
+ }
327
+ static {
328
+ this.ivory = new ColorItem("#fffff0", "ivory");
329
+ }
330
+ static {
331
+ this.khaki = new ColorItem("#f0e68c", "khaki");
332
+ }
333
+ static {
334
+ this.lavender = new ColorItem("#e6e6fa", "lavender");
335
+ }
336
+ static {
337
+ this.lavenderBlush = new ColorItem("#fff0f5", "lavenderblush");
338
+ }
339
+ static {
340
+ this.lawnGreen = new ColorItem("#7cfc00", "lawngreen");
341
+ }
342
+ static {
343
+ this.lemonChiffon = new ColorItem("#fffacd", "lemonchiffon");
344
+ }
345
+ static {
346
+ this.lightBlue = new ColorItem("#add8e6", "lightblue");
347
+ }
348
+ static {
349
+ this.lightCoral = new ColorItem("#f08080", "lightcoral");
350
+ }
351
+ static {
352
+ this.lightCyan = new ColorItem("#e0ffff", "lightcyan");
353
+ }
354
+ static {
355
+ this.lightGoldenRodYellow = new ColorItem("#fafad2", "lightgoldenrodyellow");
356
+ }
357
+ static {
358
+ this.lightGray = new ColorItem("#d3d3d3", "lightgray");
359
+ }
360
+ static {
361
+ this.lightGreen = new ColorItem("#90ee90", "lightgreen");
362
+ }
363
+ static {
364
+ this.lightGrey = new ColorItem("#d3d3d3", "lightgrey");
365
+ }
366
+ static {
367
+ this.lightPink = new ColorItem("#ffb6c1", "lightpink");
368
+ }
369
+ static {
370
+ this.lightSalmon = new ColorItem("#ffa07a", "lightsalmon");
371
+ }
372
+ static {
373
+ this.lightSeaGreen = new ColorItem("#20b2aa", "lightseagreen");
374
+ }
375
+ static {
376
+ this.lightSkyBlue = new ColorItem("#87cefa", "lightskyblue");
377
+ }
378
+ static {
379
+ this.lightSlateGray = new ColorItem("#778899", "lightslategray");
380
+ }
381
+ static {
382
+ this.lightSlateGrey = new ColorItem("#778899", "lightslategrey");
383
+ }
384
+ static {
385
+ this.lightSteelBlue = new ColorItem("#b0c4de", "lightsteelblue");
386
+ }
387
+ static {
388
+ this.lightYellow = new ColorItem("#ffffe0", "lightyellow");
389
+ }
390
+ static {
391
+ this.limeGreen = new ColorItem("#32cd32", "limegreen");
392
+ }
393
+ static {
394
+ this.linen = new ColorItem("#faf0e6", "linen");
395
+ }
396
+ static {
397
+ this.magenta = new ColorItem("#ff00ff", "magenta");
398
+ }
399
+ static {
400
+ this.mediumAquaMarine = new ColorItem("#66cdaa", "mediumaquamarine");
401
+ }
402
+ static {
403
+ this.mediumBlue = new ColorItem("#0000cd", "mediumblue");
404
+ }
405
+ static {
406
+ this.mediumOrchid = new ColorItem("#ba55d3", "mediumorchid");
407
+ }
408
+ static {
409
+ this.mediumPurple = new ColorItem("#9370db", "mediumpurple");
410
+ }
411
+ static {
412
+ this.mediumSeaGreen = new ColorItem("#3cb371", "mediumseagreen");
413
+ }
414
+ static {
415
+ this.mediumSlateBlue = new ColorItem("#7b68ee", "mediumslateblue");
416
+ }
417
+ static {
418
+ this.mediumSpringGreen = new ColorItem("#00fa9a", "mediumspringgreen");
419
+ }
420
+ static {
421
+ this.mediumTurquoise = new ColorItem("#48d1cc", "mediumturquoise");
422
+ }
423
+ static {
424
+ this.mediumVioletred = new ColorItem("#c71585", "mediumvioletred");
425
+ }
426
+ static {
427
+ this.midNightBlue = new ColorItem("#191970", "midnightblue");
428
+ }
429
+ static {
430
+ this.mintCream = new ColorItem("#f5fffa", "mintcream");
431
+ }
432
+ static {
433
+ this.mistyRose = new ColorItem("#ffe4e1", "mistyrose");
434
+ }
435
+ static {
436
+ this.moccasin = new ColorItem("#ffe4b5", "moccasin");
437
+ }
438
+ static {
439
+ this.navajoWhite = new ColorItem("#ffdead", "navajowhite");
440
+ }
441
+ static {
442
+ this.oldLace = new ColorItem("#fdf5e6", "oldlace");
443
+ }
444
+ static {
445
+ this.oliveDrab = new ColorItem("#6b8e23", "olivedrab");
446
+ }
447
+ static {
448
+ this.orangeRed = new ColorItem("#ff4500", "orangered");
449
+ }
450
+ static {
451
+ this.orchid = new ColorItem("#da70d6", "orchid");
452
+ }
453
+ static {
454
+ this.paleGoldenRod = new ColorItem("#eee8aa", "palegoldenrod");
455
+ }
456
+ static {
457
+ this.paleGreen = new ColorItem("#98fb98", "palegreen");
458
+ }
459
+ static {
460
+ this.paleTurquoise = new ColorItem("#afeeee", "paleturquoise");
461
+ }
462
+ static {
463
+ this.paleVioletRed = new ColorItem("#db7093", "palevioletred");
464
+ }
465
+ static {
466
+ this.papayaWhip = new ColorItem("#ffefd5", "papayawhip");
467
+ }
468
+ static {
469
+ this.peachPuff = new ColorItem("#ffdab9", "peachpuff");
470
+ }
471
+ static {
472
+ this.peru = new ColorItem("#cd853f", "peru");
473
+ }
474
+ static {
475
+ this.pink = new ColorItem("#ffc0cb", "pink");
476
+ }
477
+ static {
478
+ this.plum = new ColorItem("#dda0dd", "plum");
479
+ }
480
+ static {
481
+ this.powderBlue = new ColorItem("#b0e0e6", "powderblue");
482
+ }
483
+ static {
484
+ this.rosyBrown = new ColorItem("#bc8f8f", "rosybrown");
485
+ }
486
+ static {
487
+ this.royalBlue = new ColorItem("#4169e1", "royalblue");
488
+ }
489
+ static {
490
+ this.saddleBrown = new ColorItem("#8b4513", "saddlebrown");
491
+ }
492
+ static {
493
+ this.salmon = new ColorItem("#fa8072", "salmon");
494
+ }
495
+ static {
496
+ this.sandyBrown = new ColorItem("#f4a460", "sandybrown");
497
+ }
498
+ static {
499
+ this.seaGreen = new ColorItem("#2e8b57", "seagreen");
500
+ }
501
+ static {
502
+ this.seaShell = new ColorItem("#fff5ee", "seashell");
503
+ }
504
+ static {
505
+ this.sienna = new ColorItem("#a0522d", "sienna");
506
+ }
507
+ static {
508
+ this.skyBlue = new ColorItem("#87ceeb", "skyblue");
509
+ }
510
+ static {
511
+ this.slateBlue = new ColorItem("#6a5acd", "slateblue");
512
+ }
513
+ static {
514
+ this.slateGray = new ColorItem("#708090", "slategray");
515
+ }
516
+ static {
517
+ this.slateGrey = new ColorItem("#708090", "slategrey");
518
+ }
519
+ static {
520
+ this.snow = new ColorItem("#fffafa", "snow");
521
+ }
522
+ static {
523
+ this.springGreen = new ColorItem("#00ff7f", "springgreen");
524
+ }
525
+ static {
526
+ this.steelBlue = new ColorItem("#4682b4", "steelblue");
527
+ }
528
+ static {
529
+ this.tan = new ColorItem("#d2b48c", "tan");
530
+ }
531
+ static {
532
+ this.thistle = new ColorItem("#d8bfd8", "thistle");
533
+ }
534
+ static {
535
+ this.tomato = new ColorItem("#ff6347", "tomato");
536
+ }
537
+ static {
538
+ this.turquoise = new ColorItem("#40e0d0", "turquoise");
539
+ }
540
+ static {
541
+ this.violet = new ColorItem("#ee82ee", "violet");
542
+ }
543
+ static {
544
+ this.wheat = new ColorItem("#f5deb3", "wheat");
545
+ }
546
+ static {
547
+ this.whiteSmoke = new ColorItem("#f5f5f5", "whitesmoke");
548
+ }
549
+ static {
550
+ this.yellowGreen = new ColorItem("#9acd32", "yellowgreen");
551
+ }
552
+ static {
553
+ this.rebeccaPurple = new ColorItem("#663399", "rebeccapurple");
554
+ }
555
+ static {
556
+ this.transparent = new ColorItem("#00000000", "transparent");
557
+ }
558
+ }