@unicom-cloud/ui 0.8.74 → 0.8.76
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/Affix.js +1 -1
- package/Alert.js +1 -1
- package/AutoComplete.js +1 -1
- package/BackTop.js +1 -1
- package/Badge.js +1 -1
- package/Breadcrumb.js +2 -2
- package/Button.js +1 -1
- package/Calendar.js +1 -1
- package/Card.js +1 -1
- package/Carousel.js +1 -1
- package/Cascader.js +1 -1
- package/Checkbox.js +1 -1
- package/Collapse.js +1 -1
- package/ColorPicker.js +1 -1
- package/Comment.js +1 -1
- package/ConfigProvider.js +1 -1
- package/Copy.js +1 -1
- package/DatePicker.js +1 -1
- package/Descriptions.js +1 -1
- package/Divider.js +1 -1
- package/Draggable.js +1 -1
- package/Dropdown.js +1 -1
- package/Empty.js +1 -1
- package/Icon.js +1 -1
- package/IconHover.js +1 -1
- package/Image.js +1 -1
- package/InputNumber.js +1 -1
- package/Layout.js +1 -1
- package/Link.js +1 -1
- package/List.js +1 -1
- package/Mentions.js +1 -1
- package/Menu.js +1 -1
- package/Message.js +1 -1
- package/Modal.js +1 -1
- package/Notice.js +1 -1
- package/Notification.js +1 -1
- package/OverflowEllipsis.js +1 -1
- package/PageHeader.js +1 -1
- package/Popconfirm.js +1 -1
- package/Popover.js +1 -1
- package/Progress.js +1 -1
- package/Radio.js +1 -1
- package/Rate.js +1 -1
- package/ResizeBox.js +1 -1
- package/Result.js +1 -1
- package/Skeleton.js +1 -1
- package/Slider.js +1 -1
- package/Space.js +1 -1
- package/SpeechSynthesis.js +4 -3
- package/Spin.js +1 -1
- package/Statistic.js +1 -1
- package/Steps.js +1 -1
- package/Switch.js +1 -1
- package/Table.js +1 -1
- package/Tabs.js +1 -1
- package/Tag.js +1 -1
- package/Tooltip.js +2 -2
- package/Transfer.js +1 -1
- package/Tree.js +1 -1
- package/Trigger.js +1 -1
- package/affix/index.js +86 -82
- package/alert/index.js +1 -1
- package/anchor/Anchor.js +1 -1
- package/anchor/Link.js +1 -1
- package/auto-complete/index.js +1 -1
- package/avatar/Avatar.js +1 -1
- package/avatar/Group.js +1 -1
- package/back-top/index.js +1 -1
- package/badge/index.js +1 -1
- package/breadcrumb/index.js +2 -2
- package/button/Group.js +1 -1
- package/button/index.js +1 -1
- package/calendar/index.js +2 -2
- package/card/Grid.js +1 -1
- package/card/Meta.js +1 -1
- package/card/index.js +1 -1
- package/carousel/Arrow.js +1 -1
- package/carousel/Indicator.js +1 -1
- package/carousel/index.js +1 -1
- package/cascader/Cascader.js +2 -2
- package/cascader/index.js +1 -1
- package/cascader/util.js +1 -1
- package/checkbox/Checkbox.js +2 -2
- package/checkbox/Group.js +2 -2
- package/checkbox/index.js +1 -1
- package/chunk/ATwvJ8j2.js +6 -0
- package/chunk/BGmWsXl0.js +257 -0
- package/chunk/{_L2dKF58.js → ByRETFRI.js} +1 -1
- package/chunk/CBzE-PUr.js +23 -0
- package/chunk/CQzKdjhX.js +714 -0
- package/chunk/{CWjvjpyc.js → CqtaeJXT.js} +280 -226
- package/chunk/{Dn7KbmZ7.js → CzaoCNQH.js} +2 -2
- package/chunk/{D5UfU6-H.js → D0qXkqyq.js} +3 -3
- package/chunk/{BoUHPeG7.js → D9JpbqFT.js} +1 -1
- package/chunk/{Bu8A2l60.js → DM_DBvmG.js} +2 -2
- package/chunk/{NmSLBKjp.js → DQrLGkIG.js} +1 -1
- package/chunk/{Bd9zhOZS.js → DezXC21w.js} +1 -1
- package/chunk/{DdT3C0ih.js → J07pQqQ7.js} +2 -2
- package/chunk/{BDZpJpz-.js → OPbfCome.js} +1 -1
- package/chunk/{DJ8rDYjb.js → lf-xRLXx.js} +1 -1
- package/collapse/Collapse.js +2 -2
- package/collapse/Item.js +2 -2
- package/collapse/index.js +1 -1
- package/color-picker/ControlBar.js +1 -1
- package/color-picker/InputAlpha.js +1 -1
- package/color-picker/InputHex.js +7 -7
- package/color-picker/InputRgb.js +6 -6
- package/color-picker/Palette.js +5 -5
- package/color-picker/Panel.js +3 -3
- package/color-picker/colors.js +7 -23
- package/color-picker/index.js +2 -2
- package/color-picker/utils.js +1 -1
- package/comment/index.js +1 -1
- package/config-provider/ConfigProvider.js +7 -6
- package/config-provider/context.js +3 -2
- package/config-provider/index.js +2 -2
- package/copy/index.js +1 -1
- package/date-picker/Picker.js +1 -1
- package/date-picker/PickerRange.js +2 -2
- package/date-picker/index.js +1 -1
- package/descriptions/index.js +1 -1
- package/divider/index.js +1 -1
- package/draggable/index.js +1 -1
- package/drawer/Drawer.js +1 -1
- package/dropdown/Button.js +1 -1
- package/dropdown/index.js +1 -1
- package/empty/index.js +1 -1
- package/form/Form.js +1 -1
- package/form/FormItem.js +1 -1
- package/grid/Col.js +1 -1
- package/grid/Row.js +1 -1
- package/grid/grid-item.js +1 -1
- package/grid/grid.js +1 -1
- package/icon/index.js +1 -1
- package/icon-hover/index.js +1 -1
- package/image/Image.js +2 -2
- package/image/ImagePreview.js +2 -2
- package/image/ImagePreviewArrow.js +1 -1
- package/image/ImagePreviewGroup.js +1 -1
- package/image/index.js +1 -1
- package/index.js +488 -482
- package/input/Group.js +1 -1
- package/input/Input.js +1 -1
- package/input/InputElement.js +1 -1
- package/input/Password.js +1 -1
- package/input/Search.js +1 -1
- package/input/Textarea.js +1 -1
- package/input-number/index.js +1 -1
- package/input-tag/InputTag.js +1 -1
- package/layout/Content.js +1 -1
- package/layout/Footer.js +1 -1
- package/layout/Header.js +1 -1
- package/layout/Sider.js +1 -1
- package/layout/index.js +1 -1
- package/link/index.js +1 -1
- package/list/Item.js +1 -1
- package/list/Meta.js +1 -1
- package/list/index.js +1 -1
- package/mentions/index.js +1 -1
- package/menu/Menu.js +2 -2
- package/menu/OverflowWrap.js +1 -1
- package/menu/index.js +2 -2
- package/message/index.js +1 -1
- package/message/useMessage.js +1 -1
- package/modal/Confirm.js +2 -2
- package/modal/Modal.js +2 -2
- package/modal/index.js +1 -1
- package/notice/index.js +1 -1
- package/notification/index.js +1 -1
- package/notification/useNotification.js +1 -1
- package/overflow-ellipsis/OverflowItem.js +1 -1
- package/overflow-ellipsis/index.js +1 -1
- package/package.json +1 -1
- package/page-header/index.js +1 -1
- package/pagination/PageItem.js +1 -1
- package/pagination/PageJumper.js +1 -1
- package/pagination/PageOption.js +1 -1
- package/pagination/Pagination.js +1 -1
- package/picker/Input.js +1 -1
- package/picker/InputRange.js +1 -1
- package/popconfirm/index.js +1 -1
- package/popover/index.js +1 -1
- package/progress/index.js +1 -1
- package/radio/Group.js +2 -2
- package/radio/Radio.js +2 -2
- package/radio/index.js +2 -2
- package/rate/index.js +1 -1
- package/resize-box/ResizeTrigger.js +1 -1
- package/resize-box/Split.js +1 -1
- package/resize-box/SplitGroup.js +1 -1
- package/resize-box/index.js +1 -1
- package/result/index.js +1 -1
- package/select/Option.js +1 -1
- package/select/Select.js +2 -2
- package/select-view/Core.js +1 -1
- package/skeleton/index.js +1 -1
- package/slider/Button.js +1 -1
- package/slider/index.js +1 -1
- package/space/index.js +1 -1
- package/speech-synthesis/index.js +4 -3
- package/spin/DotLoading.js +1 -1
- package/spin/index.js +1 -1
- package/statistic/Countdown.js +1 -1
- package/statistic/index.js +1 -1
- package/steps/index.js +1 -1
- package/style/variables.less +0 -819
- package/style.css +1 -1
- package/switch/index.js +1 -1
- package/table/Table.js +2 -2
- package/table/index.js +3 -3
- package/tabs/Tab.js +2 -2
- package/tabs/TabContent.js +2 -2
- package/tabs/TabPane.js +1 -1
- package/tabs/index.js +2 -2
- package/tag/index.js +1 -1
- package/time-picker/Picker.js +1 -1
- package/time-picker/TimePicker.js +1 -1
- package/timeline/Item.js +1 -1
- package/timeline/Timeline.js +1 -1
- package/tooltip/index.js +2 -2
- package/transfer/Item.js +2 -2
- package/transfer/List.js +2 -2
- package/transfer/index.js +1 -1
- package/tree/Animation.js +2 -2
- package/tree/Node.js +3 -3
- package/tree/NodeList.js +1 -1
- package/tree/Tree.js +2 -2
- package/tree/index.js +1 -1
- package/tree-select/Select.js +1 -1
- package/trigger/index.js +1 -1
- package/types/config-provider/interface.d.ts +0 -1
- package/types/utils/constant.d.ts +1 -0
- package/types/utils/index.d.ts +1 -0
- package/types/utils/setDarkTheme.d.ts +3 -0
- package/typography/Base.js +1 -1
- package/typography/Ellipsis.js +12 -11
- package/typography/Paragraph.js +1 -1
- package/typography/Typography.js +1 -1
- package/typography/index.js +10 -9
- package/upload/TriggerNode.js +1 -1
- package/upload/Upload.js +1 -1
- package/upload/Uploader.js +1 -1
- package/utils/caseName.js +1 -1
- package/utils/color.js +1 -1
- package/utils/constant.js +5 -2
- package/utils/contextHolder.js +1 -1
- package/utils/index.js +219 -213
- package/utils/setDarkTheme.js +35 -0
- package/utils/tinycolor.js +3 -3
- package/verification-code/VerificationCode.js +1 -1
- package/version/index.js +1 -1
- package/watermark/Watermark.js +1 -1
- package/chunk/9we0Q8Kh.js +0 -257
- package/chunk/BsWphzcT.js +0 -20
- package/chunk/Crs3isAx.js +0 -724
|
@@ -1,128 +1,128 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
const e =
|
|
1
|
+
function u(r, t) {
|
|
2
|
+
fe(r) && (r = "100%");
|
|
3
|
+
const e = le(r);
|
|
4
4
|
return r = t === 360 ? r : Math.min(t, Math.max(0, parseFloat(r))), e && (r = parseInt(String(r * t), 10) / 100), Math.abs(r - t) < 1e-6 ? 1 : (t === 360 ? r = (r < 0 ? r % t + t : r % t) / parseFloat(String(t)) : r = r % t / parseFloat(String(t)), r);
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function A(r) {
|
|
7
7
|
return Math.min(1, Math.max(0, r));
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function fe(r) {
|
|
10
10
|
return typeof r == "string" && r.indexOf(".") !== -1 && parseFloat(r) === 1;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function le(r) {
|
|
13
13
|
return typeof r == "string" && r.indexOf("%") !== -1;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function L(r) {
|
|
16
16
|
return r = parseFloat(r), (isNaN(r) || r < 0 || r > 1) && (r = 1), r;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function S(r) {
|
|
19
19
|
return Number(r) <= 1 ? `${Number(r) * 100}%` : r;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function b(r) {
|
|
22
22
|
return r.length === 1 ? "0" + r : String(r);
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function ge(r, t, e) {
|
|
25
25
|
return {
|
|
26
|
-
r:
|
|
27
|
-
g:
|
|
28
|
-
b:
|
|
26
|
+
r: u(r, 255) * 255,
|
|
27
|
+
g: u(t, 255) * 255,
|
|
28
|
+
b: u(e, 255) * 255
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
r =
|
|
31
|
+
function q(r, t, e) {
|
|
32
|
+
r = u(r, 255), t = u(t, 255), e = u(e, 255);
|
|
33
33
|
const a = Math.max(r, t, e), n = Math.min(r, t, e);
|
|
34
34
|
let s = 0, i = 0;
|
|
35
|
-
const
|
|
35
|
+
const o = (a + n) / 2;
|
|
36
36
|
if (a === n)
|
|
37
37
|
i = 0, s = 0;
|
|
38
38
|
else {
|
|
39
|
-
const
|
|
40
|
-
switch (i =
|
|
39
|
+
const f = a - n;
|
|
40
|
+
switch (i = o > 0.5 ? f / (2 - a - n) : f / (a + n), a) {
|
|
41
41
|
case r:
|
|
42
|
-
s = (t - e) /
|
|
42
|
+
s = (t - e) / f + (t < e ? 6 : 0);
|
|
43
43
|
break;
|
|
44
44
|
case t:
|
|
45
|
-
s = (e - r) /
|
|
45
|
+
s = (e - r) / f + 2;
|
|
46
46
|
break;
|
|
47
47
|
case e:
|
|
48
|
-
s = (r - t) /
|
|
48
|
+
s = (r - t) / f + 4;
|
|
49
49
|
break;
|
|
50
50
|
}
|
|
51
51
|
s /= 6;
|
|
52
52
|
}
|
|
53
|
-
return { h: s, s: i, l:
|
|
53
|
+
return { h: s, s: i, l: o };
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function H(r, t, e) {
|
|
56
56
|
return e < 0 && (e += 1), e > 1 && (e -= 1), e < 1 / 6 ? r + (t - r) * (6 * e) : e < 1 / 2 ? t : e < 2 / 3 ? r + (t - r) * (2 / 3 - e) * 6 : r;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function ce(r, t, e) {
|
|
59
59
|
let a, n, s;
|
|
60
|
-
if (r =
|
|
60
|
+
if (r = u(r, 360), t = u(t, 100), e = u(e, 100), t === 0)
|
|
61
61
|
n = e, s = e, a = e;
|
|
62
62
|
else {
|
|
63
|
-
const i = e < 0.5 ? e * (1 + t) : e + t - e * t,
|
|
64
|
-
a =
|
|
63
|
+
const i = e < 0.5 ? e * (1 + t) : e + t - e * t, o = 2 * e - i;
|
|
64
|
+
a = H(o, i, r + 1 / 3), n = H(o, i, r), s = H(o, i, r - 1 / 3);
|
|
65
65
|
}
|
|
66
66
|
return { r: a * 255, g: n * 255, b: s * 255 };
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
r =
|
|
68
|
+
function R(r, t, e) {
|
|
69
|
+
r = u(r, 255), t = u(t, 255), e = u(e, 255);
|
|
70
70
|
const a = Math.max(r, t, e), n = Math.min(r, t, e);
|
|
71
71
|
let s = 0;
|
|
72
|
-
const i = a,
|
|
72
|
+
const i = a, o = a - n, f = a === 0 ? 0 : o / a;
|
|
73
73
|
if (a === n)
|
|
74
74
|
s = 0;
|
|
75
75
|
else {
|
|
76
76
|
switch (a) {
|
|
77
77
|
case r:
|
|
78
|
-
s = (t - e) /
|
|
78
|
+
s = (t - e) / o + (t < e ? 6 : 0);
|
|
79
79
|
break;
|
|
80
80
|
case t:
|
|
81
|
-
s = (e - r) /
|
|
81
|
+
s = (e - r) / o + 2;
|
|
82
82
|
break;
|
|
83
83
|
case e:
|
|
84
|
-
s = (r - t) /
|
|
84
|
+
s = (r - t) / o + 4;
|
|
85
85
|
break;
|
|
86
86
|
}
|
|
87
87
|
s /= 6;
|
|
88
88
|
}
|
|
89
|
-
return { h: s, s:
|
|
89
|
+
return { h: s, s: f, v: i };
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
r =
|
|
93
|
-
const a = Math.floor(r), n = r - a, s = e * (1 - t), i = e * (1 - n * t),
|
|
94
|
-
return { r:
|
|
91
|
+
function de(r, t, e) {
|
|
92
|
+
r = u(r, 360) * 6, t = u(t, 100), e = u(e, 100);
|
|
93
|
+
const a = Math.floor(r), n = r - a, s = e * (1 - t), i = e * (1 - n * t), o = e * (1 - (1 - n) * t), f = a % 6, d = [e, i, s, s, o, e][f], m = [o, e, e, i, s, s][f], M = [s, s, o, e, e, i][f];
|
|
94
|
+
return { r: d * 255, g: m * 255, b: M * 255 };
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function T(r, t, e, a) {
|
|
97
97
|
const n = [
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
b(Math.round(r).toString(16)),
|
|
99
|
+
b(Math.round(t).toString(16)),
|
|
100
|
+
b(Math.round(e).toString(16))
|
|
101
101
|
];
|
|
102
102
|
return a && n[0].startsWith(n[0].charAt(1)) && n[1].startsWith(n[1].charAt(1)) && n[2].startsWith(n[2].charAt(1)) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) : n.join("");
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function be(r, t, e, a, n) {
|
|
105
105
|
const s = [
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
b(Math.round(r).toString(16)),
|
|
107
|
+
b(Math.round(t).toString(16)),
|
|
108
|
+
b(Math.round(e).toString(16)),
|
|
109
|
+
b(V(a))
|
|
110
110
|
];
|
|
111
111
|
return n && s[0].startsWith(s[0].charAt(1)) && s[1].startsWith(s[1].charAt(1)) && s[2].startsWith(s[2].charAt(1)) && s[3].startsWith(s[3].charAt(1)) ? s[0].charAt(0) + s[1].charAt(0) + s[2].charAt(0) + s[3].charAt(0) : s.join("");
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function Ae(r, t, e, a) {
|
|
114
114
|
return [
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
b(V(a)),
|
|
116
|
+
b(Math.round(r).toString(16)),
|
|
117
|
+
b(Math.round(t).toString(16)),
|
|
118
|
+
b(Math.round(e).toString(16))
|
|
119
119
|
].join("");
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
const n = r / 100, s = t / 100, i = e / 100,
|
|
123
|
-
return { r:
|
|
121
|
+
function me(r, t, e, a) {
|
|
122
|
+
const n = r / 100, s = t / 100, i = e / 100, o = a / 100, f = 255 * (1 - n) * (1 - o), d = 255 * (1 - s) * (1 - o), m = 255 * (1 - i) * (1 - o);
|
|
123
|
+
return { r: f, g: d, b: m };
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function O(r, t, e) {
|
|
126
126
|
let a = 1 - r / 255, n = 1 - t / 255, s = 1 - e / 255, i = Math.min(a, n, s);
|
|
127
127
|
return i === 1 ? (a = 0, n = 0, s = 0) : (a = (a - i) / (1 - i) * 100, n = (n - i) / (1 - i) * 100, s = (s - i) / (1 - i) * 100), i *= 100, {
|
|
128
128
|
c: Math.round(a),
|
|
@@ -131,23 +131,23 @@ function N(r, t, e) {
|
|
|
131
131
|
k: Math.round(i)
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function V(r) {
|
|
135
135
|
return Math.round(parseFloat(r) * 255).toString(16);
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function P(r) {
|
|
138
138
|
return g(r) / 255;
|
|
139
139
|
}
|
|
140
140
|
function g(r) {
|
|
141
141
|
return parseInt(r, 16);
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function pe(r) {
|
|
144
144
|
return {
|
|
145
145
|
r: r >> 16,
|
|
146
146
|
g: (r & 65280) >> 8,
|
|
147
147
|
b: r & 255
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
|
-
const
|
|
150
|
+
const C = {
|
|
151
151
|
aliceblue: "#f0f8ff",
|
|
152
152
|
antiquewhite: "#faebd7",
|
|
153
153
|
aqua: "#00ffff",
|
|
@@ -297,40 +297,40 @@ const E = {
|
|
|
297
297
|
yellow: "#ffff00",
|
|
298
298
|
yellowgreen: "#9acd32"
|
|
299
299
|
};
|
|
300
|
-
function
|
|
301
|
-
let t = { r: 0, g: 0, b: 0 }, e = 1, a = null, n = null, s = null, i = !1,
|
|
302
|
-
return typeof r == "string" && (r =
|
|
300
|
+
function ye(r) {
|
|
301
|
+
let t = { r: 0, g: 0, b: 0 }, e = 1, a = null, n = null, s = null, i = !1, o = !1;
|
|
302
|
+
return typeof r == "string" && (r = ve(r)), typeof r == "object" && (l(r.r) && l(r.g) && l(r.b) ? (t = ge(r.r, r.g, r.b), i = !0, o = String(r.r).slice(-1) === "%" ? "prgb" : "rgb") : l(r.h) && l(r.s) && l(r.v) ? (a = S(r.s), n = S(r.v), t = de(r.h, a, n), i = !0, o = "hsv") : l(r.h) && l(r.s) && l(r.l) ? (a = S(r.s), s = S(r.l), t = ce(r.h, a, s), i = !0, o = "hsl") : l(r.c) && l(r.m) && l(r.y) && l(r.k) && (t = me(r.c, r.m, r.y, r.k), i = !0, o = "cmyk"), Object.prototype.hasOwnProperty.call(r, "a") && (e = r.a)), e = L(e), {
|
|
303
303
|
ok: i,
|
|
304
|
-
format: r.format ||
|
|
304
|
+
format: r.format || o,
|
|
305
305
|
r: Math.min(255, Math.max(t.r, 0)),
|
|
306
306
|
g: Math.min(255, Math.max(t.g, 0)),
|
|
307
307
|
b: Math.min(255, Math.max(t.b, 0)),
|
|
308
308
|
a: e
|
|
309
309
|
};
|
|
310
310
|
}
|
|
311
|
-
const
|
|
311
|
+
const we = "[-\\+]?\\d+%?", ke = "[-\\+]?\\d*\\.\\d+%?", y = "(?:" + ke + ")|(?:" + we + ")", E = "[\\s|\\(]+(" + y + ")[,|\\s]+(" + y + ")[,|\\s]+(" + y + ")\\s*\\)?", F = (
|
|
312
312
|
// eslint-disable-next-line prettier/prettier
|
|
313
|
-
"[\\s|\\(]+(" +
|
|
313
|
+
"[\\s|\\(]+(" + y + ")[,|\\s]+(" + y + ")[,|\\s]+(" + y + ")[,|\\s]+(" + y + ")\\s*\\)?"
|
|
314
314
|
), c = {
|
|
315
|
-
CSS_UNIT: new RegExp(
|
|
316
|
-
rgb: new RegExp("rgb" +
|
|
317
|
-
rgba: new RegExp("rgba" +
|
|
318
|
-
hsl: new RegExp("hsl" +
|
|
319
|
-
hsla: new RegExp("hsla" +
|
|
320
|
-
hsv: new RegExp("hsv" +
|
|
321
|
-
hsva: new RegExp("hsva" +
|
|
322
|
-
cmyk: new RegExp("cmyk" +
|
|
315
|
+
CSS_UNIT: new RegExp(y),
|
|
316
|
+
rgb: new RegExp("rgb" + E),
|
|
317
|
+
rgba: new RegExp("rgba" + F),
|
|
318
|
+
hsl: new RegExp("hsl" + E),
|
|
319
|
+
hsla: new RegExp("hsla" + F),
|
|
320
|
+
hsv: new RegExp("hsv" + E),
|
|
321
|
+
hsva: new RegExp("hsva" + F),
|
|
322
|
+
cmyk: new RegExp("cmyk" + F),
|
|
323
323
|
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
324
324
|
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
|
325
325
|
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
326
326
|
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
327
327
|
};
|
|
328
|
-
function
|
|
328
|
+
function ve(r) {
|
|
329
329
|
if (r = r.trim().toLowerCase(), r.length === 0)
|
|
330
330
|
return !1;
|
|
331
331
|
let t = !1;
|
|
332
|
-
if (
|
|
333
|
-
r =
|
|
332
|
+
if (C[r])
|
|
333
|
+
r = C[r], t = !0;
|
|
334
334
|
else if (r === "transparent")
|
|
335
335
|
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
|
|
336
336
|
let e = c.rgb.exec(r);
|
|
@@ -343,7 +343,7 @@ function ae(r) {
|
|
|
343
343
|
r: g(e[1]),
|
|
344
344
|
g: g(e[2]),
|
|
345
345
|
b: g(e[3]),
|
|
346
|
-
a:
|
|
346
|
+
a: P(e[4]),
|
|
347
347
|
format: t ? "name" : "hex8"
|
|
348
348
|
} : (e = c.hex6.exec(r), e ? {
|
|
349
349
|
r: g(e[1]),
|
|
@@ -354,7 +354,7 @@ function ae(r) {
|
|
|
354
354
|
r: g(e[1] + e[1]),
|
|
355
355
|
g: g(e[2] + e[2]),
|
|
356
356
|
b: g(e[3] + e[3]),
|
|
357
|
-
a:
|
|
357
|
+
a: P(e[4] + e[4]),
|
|
358
358
|
format: t ? "name" : "hex8"
|
|
359
359
|
} : (e = c.hex3.exec(r), e ? {
|
|
360
360
|
r: g(e[1] + e[1]),
|
|
@@ -363,16 +363,16 @@ function ae(r) {
|
|
|
363
363
|
format: t ? "name" : "hex"
|
|
364
364
|
} : !1))))))))));
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function l(r) {
|
|
367
367
|
return typeof r == "number" ? !Number.isNaN(r) : c.CSS_UNIT.test(r);
|
|
368
368
|
}
|
|
369
|
-
var
|
|
370
|
-
class
|
|
369
|
+
var Me = Object.defineProperty, $e = (r, t, e) => t in r ? Me(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e, p = (r, t, e) => $e(r, typeof t != "symbol" ? t + "" : t, e);
|
|
370
|
+
class h {
|
|
371
371
|
constructor(t = "", e = {}) {
|
|
372
|
-
if (
|
|
372
|
+
if (p(this, "r"), p(this, "g"), p(this, "b"), p(this, "a"), p(this, "format"), p(this, "originalInput"), p(this, "isValid"), p(this, "gradientType"), p(this, "roundA"), t instanceof h)
|
|
373
373
|
return t;
|
|
374
|
-
typeof t == "number" && (t =
|
|
375
|
-
const a =
|
|
374
|
+
typeof t == "number" && (t = pe(t)), this.originalInput = t;
|
|
375
|
+
const a = ye(t);
|
|
376
376
|
this.originalInput = t, this.r = a.r, this.g = a.g, this.b = a.b, this.a = a.a, this.roundA = Math.round(100 * this.a) / 100, this.format = e.format ?? a.format, this.gradientType = e.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = a.ok;
|
|
377
377
|
}
|
|
378
378
|
get ok() {
|
|
@@ -397,8 +397,8 @@ class o {
|
|
|
397
397
|
getLuminance() {
|
|
398
398
|
const t = this.toRgb();
|
|
399
399
|
let e, a, n;
|
|
400
|
-
const s = t.r / 255, i = t.g / 255,
|
|
401
|
-
return s <= 0.03928 ? e = s / 12.92 : e = Math.pow((s + 0.055) / 1.055, 2.4), i <= 0.03928 ? a = i / 12.92 : a = Math.pow((i + 0.055) / 1.055, 2.4),
|
|
400
|
+
const s = t.r / 255, i = t.g / 255, o = t.b / 255;
|
|
401
|
+
return s <= 0.03928 ? e = s / 12.92 : e = Math.pow((s + 0.055) / 1.055, 2.4), i <= 0.03928 ? a = i / 12.92 : a = Math.pow((i + 0.055) / 1.055, 2.4), o <= 0.03928 ? n = o / 12.92 : n = Math.pow((o + 0.055) / 1.055, 2.4), 0.2126 * e + 0.7152 * a + 0.0722 * n;
|
|
402
402
|
}
|
|
403
403
|
/**
|
|
404
404
|
* Returns the alpha value of a color, from 0-1.
|
|
@@ -412,7 +412,7 @@ class o {
|
|
|
412
412
|
* @param alpha - The new alpha value. The accepted range is 0-1.
|
|
413
413
|
*/
|
|
414
414
|
setAlpha(t) {
|
|
415
|
-
return this.a =
|
|
415
|
+
return this.a = L(t), this.roundA = Math.round(100 * this.a) / 100, this;
|
|
416
416
|
}
|
|
417
417
|
/**
|
|
418
418
|
* Returns whether the color is monochrome.
|
|
@@ -425,11 +425,11 @@ class o {
|
|
|
425
425
|
* Returns the object as a HSVA object.
|
|
426
426
|
*/
|
|
427
427
|
toHsv() {
|
|
428
|
-
const t =
|
|
428
|
+
const t = R(this.r, this.g, this.b);
|
|
429
429
|
return { h: t.h * 360, s: t.s, v: t.v, a: this.a };
|
|
430
430
|
}
|
|
431
431
|
toHsv_() {
|
|
432
|
-
const t =
|
|
432
|
+
const t = R(this.r, this.g, this.b);
|
|
433
433
|
return { h: t.h, s: t.s, v: t.v, a: this.a };
|
|
434
434
|
}
|
|
435
435
|
/**
|
|
@@ -437,14 +437,14 @@ class o {
|
|
|
437
437
|
* "hsva(xxx, xxx, xxx, xx)".
|
|
438
438
|
*/
|
|
439
439
|
toHsvString() {
|
|
440
|
-
const t =
|
|
440
|
+
const t = R(this.r, this.g, this.b), e = Math.round(t.h * 360), a = Math.round(t.s * 100), n = Math.round(t.v * 100);
|
|
441
441
|
return this.a === 1 ? `hsv(${e}, ${a}%, ${n}%)` : `hsva(${e}, ${a}%, ${n}%, ${this.roundA})`;
|
|
442
442
|
}
|
|
443
443
|
/**
|
|
444
444
|
* Returns the object as a HSLA object.
|
|
445
445
|
*/
|
|
446
446
|
toHsl() {
|
|
447
|
-
const t =
|
|
447
|
+
const t = q(this.r, this.g, this.b);
|
|
448
448
|
return { h: t.h * 360, s: t.s, l: t.l, a: this.a };
|
|
449
449
|
}
|
|
450
450
|
/**
|
|
@@ -452,7 +452,7 @@ class o {
|
|
|
452
452
|
* "hsla(xxx, xxx, xxx, xx)".
|
|
453
453
|
*/
|
|
454
454
|
toHslString() {
|
|
455
|
-
const t =
|
|
455
|
+
const t = q(this.r, this.g, this.b), e = Math.round(t.h * 360), a = Math.round(t.s * 100), n = Math.round(t.l * 100);
|
|
456
456
|
return this.a === 1 ? `hsl(${e}, ${a}%, ${n}%)` : `hsla(${e}, ${a}%, ${n}%, ${this.roundA})`;
|
|
457
457
|
}
|
|
458
458
|
/**
|
|
@@ -460,7 +460,7 @@ class o {
|
|
|
460
460
|
* @param allow3Char will shorten hex value to 3 char if possible
|
|
461
461
|
*/
|
|
462
462
|
toHex(t = !1) {
|
|
463
|
-
return
|
|
463
|
+
return T(this.r, this.g, this.b, t);
|
|
464
464
|
}
|
|
465
465
|
/**
|
|
466
466
|
* Returns the hex value of the color -with a # prefixed.
|
|
@@ -474,7 +474,7 @@ class o {
|
|
|
474
474
|
* @param allow4Char will shorten hex value to 4 char if possible
|
|
475
475
|
*/
|
|
476
476
|
toHex8(t = !1) {
|
|
477
|
-
return
|
|
477
|
+
return be(this.r, this.g, this.b, this.a, t);
|
|
478
478
|
}
|
|
479
479
|
/**
|
|
480
480
|
* Returns the hex 8 value of the color -with a # prefixed.
|
|
@@ -528,7 +528,7 @@ class o {
|
|
|
528
528
|
* Returns the object as a RGBA object.
|
|
529
529
|
*/
|
|
530
530
|
toPercentageRgb() {
|
|
531
|
-
const t = (e) => `${Math.round(
|
|
531
|
+
const t = (e) => `${Math.round(u(e, 255) * 100)}%`;
|
|
532
532
|
return {
|
|
533
533
|
r: t(this.r),
|
|
534
534
|
g: t(this.g),
|
|
@@ -540,16 +540,16 @@ class o {
|
|
|
540
540
|
* Returns the RGBA relative values interpolated into a string
|
|
541
541
|
*/
|
|
542
542
|
toPercentageRgbString() {
|
|
543
|
-
const t = (e) => Math.round(
|
|
543
|
+
const t = (e) => Math.round(u(e, 255) * 100);
|
|
544
544
|
return this.a === 1 ? `rgb(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%)` : `rgba(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%, ${this.roundA})`;
|
|
545
545
|
}
|
|
546
546
|
toCmyk() {
|
|
547
547
|
return {
|
|
548
|
-
...
|
|
548
|
+
...O(this.r, this.g, this.b)
|
|
549
549
|
};
|
|
550
550
|
}
|
|
551
551
|
toCmykString() {
|
|
552
|
-
const { c: t, m: e, y: a, k: n } =
|
|
552
|
+
const { c: t, m: e, y: a, k: n } = O(this.r, this.g, this.b);
|
|
553
553
|
return `cmyk(${t}, ${e}, ${a}, ${n})`;
|
|
554
554
|
}
|
|
555
555
|
/**
|
|
@@ -560,8 +560,8 @@ class o {
|
|
|
560
560
|
return "transparent";
|
|
561
561
|
if (this.a < 1)
|
|
562
562
|
return !1;
|
|
563
|
-
const t = `#${
|
|
564
|
-
for (const [e, a] of Object.entries(
|
|
563
|
+
const t = `#${T(this.r, this.g, this.b, !1)}`;
|
|
564
|
+
for (const [e, a] of Object.entries(C))
|
|
565
565
|
if (t === a)
|
|
566
566
|
return e;
|
|
567
567
|
return !1;
|
|
@@ -577,7 +577,7 @@ class o {
|
|
|
577
577
|
return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
|
|
578
578
|
}
|
|
579
579
|
clone() {
|
|
580
|
-
return new
|
|
580
|
+
return new h(this.toString());
|
|
581
581
|
}
|
|
582
582
|
/**
|
|
583
583
|
* Lighten the color a given amount. Providing 100 will always return white.
|
|
@@ -585,7 +585,7 @@ class o {
|
|
|
585
585
|
*/
|
|
586
586
|
lighten(t = 10) {
|
|
587
587
|
const e = this.toHsl();
|
|
588
|
-
return e.l += t / 100, e.l =
|
|
588
|
+
return e.l += t / 100, e.l = A(e.l), new h(e);
|
|
589
589
|
}
|
|
590
590
|
/**
|
|
591
591
|
* Brighten the color a given amount, from 0 to 100.
|
|
@@ -602,7 +602,7 @@ class o {
|
|
|
602
602
|
), e.b = Math.max(
|
|
603
603
|
0,
|
|
604
604
|
Math.min(255, e.b - Math.round(255 * -(t / 100)))
|
|
605
|
-
), new
|
|
605
|
+
), new h(e);
|
|
606
606
|
}
|
|
607
607
|
/**
|
|
608
608
|
* Darken the color a given amount, from 0 to 100.
|
|
@@ -611,7 +611,7 @@ class o {
|
|
|
611
611
|
*/
|
|
612
612
|
darken(t = 10) {
|
|
613
613
|
const e = this.toHsl();
|
|
614
|
-
return e.l -= t / 100, e.l =
|
|
614
|
+
return e.l -= t / 100, e.l = A(e.l), new h(e);
|
|
615
615
|
}
|
|
616
616
|
/**
|
|
617
617
|
* Mix the color with pure white, from 0 to 100.
|
|
@@ -636,7 +636,7 @@ class o {
|
|
|
636
636
|
*/
|
|
637
637
|
desaturate(t = 10) {
|
|
638
638
|
const e = this.toHsl();
|
|
639
|
-
return e.s -= t / 100, e.s =
|
|
639
|
+
return e.s -= t / 100, e.s = A(e.s), new h(e);
|
|
640
640
|
}
|
|
641
641
|
/**
|
|
642
642
|
* Saturate the color a given amount, from 0 to 100.
|
|
@@ -644,7 +644,7 @@ class o {
|
|
|
644
644
|
*/
|
|
645
645
|
saturate(t = 10) {
|
|
646
646
|
const e = this.toHsl();
|
|
647
|
-
return e.s += t / 100, e.s =
|
|
647
|
+
return e.s += t / 100, e.s = A(e.s), new h(e);
|
|
648
648
|
}
|
|
649
649
|
/**
|
|
650
650
|
* Completely desaturates a color into greyscale.
|
|
@@ -659,25 +659,25 @@ class o {
|
|
|
659
659
|
*/
|
|
660
660
|
spin(t) {
|
|
661
661
|
const e = this.toHsl(), a = (e.h + t) % 360;
|
|
662
|
-
return e.h = a < 0 ? 360 + a : a, new
|
|
662
|
+
return e.h = a < 0 ? 360 + a : a, new h(e);
|
|
663
663
|
}
|
|
664
664
|
/**
|
|
665
665
|
* Mix the current color a given amount with another color, from 0 to 100.
|
|
666
666
|
* 0 means no mixing (return current color).
|
|
667
667
|
*/
|
|
668
668
|
mix(t, e = 50) {
|
|
669
|
-
const a = this.toRgb(), n = new
|
|
669
|
+
const a = this.toRgb(), n = new h(t).toRgb(), s = e / 100, i = {
|
|
670
670
|
r: (n.r - a.r) * s + a.r,
|
|
671
671
|
g: (n.g - a.g) * s + a.g,
|
|
672
672
|
b: (n.b - a.b) * s + a.b,
|
|
673
673
|
a: (n.a - a.a) * s + a.a
|
|
674
674
|
};
|
|
675
|
-
return new
|
|
675
|
+
return new h(i);
|
|
676
676
|
}
|
|
677
677
|
analogous(t = 6, e = 30) {
|
|
678
678
|
const a = this.toHsl(), n = 360 / e, s = [this];
|
|
679
679
|
for (a.h = (a.h - (n * t >> 1) + 720) % 360; --t; )
|
|
680
|
-
a.h = (a.h + n) % 360, s.push(new
|
|
680
|
+
a.h = (a.h + n) % 360, s.push(new h(a));
|
|
681
681
|
return s;
|
|
682
682
|
}
|
|
683
683
|
/**
|
|
@@ -685,30 +685,30 @@ class o {
|
|
|
685
685
|
*/
|
|
686
686
|
complement() {
|
|
687
687
|
const t = this.toHsl();
|
|
688
|
-
return t.h = (t.h + 180) % 360, new
|
|
688
|
+
return t.h = (t.h + 180) % 360, new h(t);
|
|
689
689
|
}
|
|
690
690
|
monochromatic(t = 6) {
|
|
691
691
|
const e = this.toHsv(), { h: a } = e, { s: n } = e;
|
|
692
692
|
let { v: s } = e;
|
|
693
|
-
const i = [],
|
|
693
|
+
const i = [], o = 1 / t;
|
|
694
694
|
for (; t--; )
|
|
695
|
-
i.push(new
|
|
695
|
+
i.push(new h({ h: a, s: n, v: s })), s = (s + o) % 1;
|
|
696
696
|
return i;
|
|
697
697
|
}
|
|
698
698
|
splitcomplement() {
|
|
699
699
|
const t = this.toHsl(), { h: e } = t;
|
|
700
700
|
return [
|
|
701
701
|
this,
|
|
702
|
-
new
|
|
703
|
-
new
|
|
702
|
+
new h({ h: (e + 72) % 360, s: t.s, l: t.l }),
|
|
703
|
+
new h({ h: (e + 216) % 360, s: t.s, l: t.l })
|
|
704
704
|
];
|
|
705
705
|
}
|
|
706
706
|
/**
|
|
707
707
|
* Compute how the color would appear on a background
|
|
708
708
|
*/
|
|
709
709
|
onBackground(t) {
|
|
710
|
-
const e = this.toRgb(), a = new
|
|
711
|
-
return new
|
|
710
|
+
const e = this.toRgb(), a = new h(t).toRgb(), n = e.a + a.a * (1 - e.a);
|
|
711
|
+
return new h({
|
|
712
712
|
r: (e.r * e.a + a.r * a.a * (1 - e.a)) / n,
|
|
713
713
|
g: (e.g * e.a + a.g * a.a * (1 - e.a)) / n,
|
|
714
714
|
b: (e.b * e.a + a.b * a.a * (1 - e.a)) / n,
|
|
@@ -735,7 +735,7 @@ class o {
|
|
|
735
735
|
const e = this.toHsl(), { h: a } = e, n = [this], s = 360 / t;
|
|
736
736
|
for (let i = 1; i < t; i++)
|
|
737
737
|
n.push(
|
|
738
|
-
new
|
|
738
|
+
new h({ h: (a + i * s) % 360, s: e.s, l: e.l })
|
|
739
739
|
);
|
|
740
740
|
return n;
|
|
741
741
|
}
|
|
@@ -743,131 +743,185 @@ class o {
|
|
|
743
743
|
* compare color vs current color
|
|
744
744
|
*/
|
|
745
745
|
equals(t) {
|
|
746
|
-
const e = new
|
|
746
|
+
const e = new h(t);
|
|
747
747
|
return this.format === "cmyk" || e.format === "cmyk" ? this.toCmykString() === e.toCmykString() : this.toRgbString() === e.toRgbString();
|
|
748
748
|
}
|
|
749
749
|
}
|
|
750
|
-
const
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
},
|
|
766
|
-
|
|
767
|
-
|
|
750
|
+
const k = 10, w = {
|
|
751
|
+
name: { zh: "中性灰", en: "gray" },
|
|
752
|
+
value: "#6B6C6D"
|
|
753
|
+
}, G = {
|
|
754
|
+
name: { zh: "浪漫红", en: "red" },
|
|
755
|
+
value: "#F53F3F"
|
|
756
|
+
}, U = {
|
|
757
|
+
name: { zh: "晚秋红", en: "orangered" },
|
|
758
|
+
value: "#FF702E"
|
|
759
|
+
}, J = {
|
|
760
|
+
name: { zh: "活力橙", en: "orange" },
|
|
761
|
+
value: "#FFA500"
|
|
762
|
+
}, K = {
|
|
763
|
+
name: { zh: "黄昏", en: "gold" },
|
|
764
|
+
value: "#FFBD14"
|
|
765
|
+
}, Q = {
|
|
766
|
+
name: { zh: "柠檬黄", en: "yellow" },
|
|
767
|
+
value: "#FFE014"
|
|
768
|
+
}, X = {
|
|
769
|
+
name: { zh: "新生绿", en: "lime" },
|
|
770
|
+
value: "#A1E619"
|
|
771
|
+
}, Y = {
|
|
772
|
+
name: { zh: "仙野绿", en: "green" },
|
|
773
|
+
value: "#00B82B"
|
|
774
|
+
}, Z = {
|
|
775
|
+
name: { zh: "碧涛青", en: "cyan" },
|
|
776
|
+
value: "#0BD0D0"
|
|
777
|
+
}, _ = {
|
|
778
|
+
name: { zh: "海蔚蓝", en: "blue" },
|
|
779
|
+
value: "#2E8FFF"
|
|
780
|
+
}, ee = {
|
|
781
|
+
name: { zh: "极致蓝", en: "pqbblue" },
|
|
782
|
+
value: "#1A5EFF"
|
|
783
|
+
}, te = {
|
|
784
|
+
name: { zh: "暗夜紫", en: "purple" },
|
|
785
|
+
value: "#7126D9"
|
|
786
|
+
}, re = {
|
|
787
|
+
name: { zh: "青春紫", en: "pinkpurple" },
|
|
788
|
+
value: "#D91AD9"
|
|
789
|
+
}, ae = {
|
|
790
|
+
name: { zh: "品红", en: "magenta" },
|
|
791
|
+
value: "#FF299F"
|
|
792
|
+
}, z = [
|
|
793
|
+
G,
|
|
794
|
+
U,
|
|
795
|
+
J,
|
|
796
|
+
K,
|
|
797
|
+
Q,
|
|
798
|
+
X,
|
|
799
|
+
Y,
|
|
800
|
+
Z,
|
|
801
|
+
_,
|
|
802
|
+
ee,
|
|
803
|
+
te,
|
|
804
|
+
re,
|
|
805
|
+
ae
|
|
806
|
+
];
|
|
807
|
+
var W, I;
|
|
808
|
+
const ne = {
|
|
809
|
+
key: ((W = w.name) == null ? void 0 : W.en) ?? ((I = w.name) == null ? void 0 : I.zh) ?? w.name,
|
|
810
|
+
name: w.name,
|
|
811
|
+
primary: w.value,
|
|
768
812
|
light: [
|
|
769
|
-
"#F7F8F9",
|
|
770
|
-
"#F2F3F4",
|
|
771
|
-
"#E5E6E7",
|
|
772
|
-
"#C9CACB",
|
|
773
|
-
"#A9ABAC",
|
|
774
|
-
"#868788",
|
|
775
|
-
|
|
776
|
-
"#4D4E4F",
|
|
777
|
-
"#28292A",
|
|
778
|
-
"#1E1F20"
|
|
813
|
+
new h("#F7F8F9"),
|
|
814
|
+
new h("#F2F3F4"),
|
|
815
|
+
new h("#E5E6E7"),
|
|
816
|
+
new h("#C9CACB"),
|
|
817
|
+
new h("#A9ABAC"),
|
|
818
|
+
new h("#868788"),
|
|
819
|
+
new h(w.value),
|
|
820
|
+
new h("#4D4E4F"),
|
|
821
|
+
new h("#28292A"),
|
|
822
|
+
new h("#1E1F20")
|
|
779
823
|
],
|
|
780
824
|
dark: [
|
|
781
|
-
"#121213",
|
|
782
|
-
"#1C1C1D",
|
|
783
|
-
"#404142",
|
|
784
|
-
"#5E5F60",
|
|
785
|
-
"#797A7B",
|
|
786
|
-
"#9C9E9F",
|
|
787
|
-
"#BCBDBE",
|
|
788
|
-
"#D8D9DB",
|
|
789
|
-
"#E4E6E8",
|
|
790
|
-
"#E8EBEE"
|
|
791
|
-
]
|
|
792
|
-
|
|
793
|
-
name:
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
);
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
let v = i;
|
|
813
|
-
v > B && (k ? v = i - (i - B) / (t - 1) * m : v = i + (S - i) / (t - 1) * m), u && (v = i);
|
|
814
|
-
const V = u ? 0.97 : 1, D = 0.1;
|
|
815
|
-
let x = h;
|
|
816
|
-
return x > D && (k ? x = h + (V - h) / (t - 1) * m : x = h - (h - D) / (t - 1) * m), a = new o({
|
|
817
|
-
h: s,
|
|
825
|
+
new h("#121213"),
|
|
826
|
+
new h("#1C1C1D"),
|
|
827
|
+
new h("#404142"),
|
|
828
|
+
new h("#5E5F60"),
|
|
829
|
+
new h("#797A7B"),
|
|
830
|
+
new h("#9C9E9F"),
|
|
831
|
+
new h("#BCBDBE"),
|
|
832
|
+
new h("#D8D9DB"),
|
|
833
|
+
new h("#E4E6E8"),
|
|
834
|
+
new h("#E8EBEE")
|
|
835
|
+
]
|
|
836
|
+
}, xe = z.map((r, t, e) => {
|
|
837
|
+
const a = r.name, n = (a == null ? void 0 : a.en) ?? (a == null ? void 0 : a.zh) ?? a, s = r.value;
|
|
838
|
+
return {
|
|
839
|
+
key: n,
|
|
840
|
+
name: a,
|
|
841
|
+
primary: s,
|
|
842
|
+
light: ie({ color: s, length: k }),
|
|
843
|
+
dark: he({ color: s, length: k })
|
|
844
|
+
};
|
|
845
|
+
}).concat([ne]);
|
|
846
|
+
function D(r = {}) {
|
|
847
|
+
const { length: t, color: e, level: a } = r, n = (t ?? k) / 2 + 1, s = a ?? n;
|
|
848
|
+
let i = new h(e);
|
|
849
|
+
const o = i.toHsv(), f = o.h, d = o.s, m = o.v, M = f === 0 && d === 0, B = s < n, $ = Math.abs(n - s), oe = 1, N = 0.1;
|
|
850
|
+
let v = d;
|
|
851
|
+
v > N && (B ? v = d - (d - N) / (n - 1) * $ : v = d + (oe - d) / (n - 1) * $), M && (v = d);
|
|
852
|
+
const ue = M ? 0.97 : 1, j = 0.1;
|
|
853
|
+
let x = m;
|
|
854
|
+
return x > j && (B ? x = m + (ue - m) / (n - 1) * $ : x = m - (m - j) / (n - 1) * $), i = new h({
|
|
855
|
+
h: f,
|
|
818
856
|
s: v,
|
|
819
857
|
v: x
|
|
820
|
-
}), r.dark && (
|
|
858
|
+
}), r.dark && (i = i.darken(r.amount ?? 10)), i;
|
|
821
859
|
}
|
|
822
|
-
function
|
|
823
|
-
return
|
|
860
|
+
function se(r = {}) {
|
|
861
|
+
return D({ ...r, dark: !0 });
|
|
824
862
|
}
|
|
825
|
-
function
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
863
|
+
function ie(r = {}) {
|
|
864
|
+
const { length: t } = r;
|
|
865
|
+
return Array.from(new Array(t ?? k), (e, a) => {
|
|
866
|
+
const n = a + 1;
|
|
867
|
+
return D({ ...r, level: n });
|
|
829
868
|
});
|
|
830
869
|
}
|
|
831
|
-
function
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
870
|
+
function he(r = {}) {
|
|
871
|
+
const { length: t } = r;
|
|
872
|
+
return Array.from(new Array(t ?? k), (e, a) => {
|
|
873
|
+
const n = a + 1;
|
|
874
|
+
return se({
|
|
835
875
|
...r,
|
|
836
|
-
level:
|
|
876
|
+
level: k - n + 1
|
|
837
877
|
});
|
|
838
878
|
});
|
|
839
879
|
}
|
|
840
|
-
const
|
|
880
|
+
const Se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
841
881
|
__proto__: null,
|
|
842
|
-
LENGTH:
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
882
|
+
LENGTH: k,
|
|
883
|
+
blue: _,
|
|
884
|
+
colorPresets: xe,
|
|
885
|
+
colors: z,
|
|
886
|
+
cyan: Z,
|
|
887
|
+
default: z,
|
|
888
|
+
generate: ie,
|
|
889
|
+
generateDark: he,
|
|
890
|
+
gold: K,
|
|
891
|
+
gray: w,
|
|
892
|
+
grayPresets: ne,
|
|
893
|
+
green: Y,
|
|
894
|
+
lime: X,
|
|
895
|
+
magenta: ae,
|
|
896
|
+
orange: J,
|
|
897
|
+
orangered: U,
|
|
898
|
+
palette: D,
|
|
899
|
+
paletteDark: se,
|
|
900
|
+
pinkpurple: re,
|
|
901
|
+
pqbblue: ee,
|
|
902
|
+
purple: te,
|
|
903
|
+
red: G,
|
|
904
|
+
yellow: Q
|
|
851
905
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
852
906
|
export {
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
o as a,
|
|
907
|
+
ge as A,
|
|
908
|
+
O as C,
|
|
909
|
+
T as H,
|
|
910
|
+
ye as N,
|
|
911
|
+
Se as R,
|
|
912
|
+
de as S,
|
|
913
|
+
q as T,
|
|
914
|
+
be as W,
|
|
915
|
+
pe as a,
|
|
863
916
|
g as b,
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
917
|
+
h as c,
|
|
918
|
+
V as d,
|
|
919
|
+
C as e,
|
|
920
|
+
P as j,
|
|
921
|
+
ce as k,
|
|
922
|
+
R as l,
|
|
923
|
+
l as n,
|
|
924
|
+
Ae as p,
|
|
925
|
+
ve as w,
|
|
926
|
+
me as y
|
|
873
927
|
};
|