@chaoswise/business 0.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/LICENSE +21 -0
- package/README.md +113 -0
- package/config/babel/antdComs.js +51 -0
- package/config/babel/formily.js +22 -0
- package/config/babel/index.js +36 -0
- package/config/city/citys.js +1964 -0
- package/config/theme/CWTheme.js +427 -0
- package/config/theme/chart.dark.js +394 -0
- package/config/theme/chart.light.js +3 -0
- package/config/theme/common.less +161 -0
- package/config/theme/dark.js +784 -0
- package/config/theme/dark.less +80 -0
- package/config/theme/default.js +717 -0
- package/config/theme/default.less +144 -0
- package/config/theme/style/color/bezierEasing.less +110 -0
- package/config/theme/style/color/colorPalette.less +85 -0
- package/config/theme/style/color/colors.less +162 -0
- package/config/theme/style/color/tinyColor.less +1184 -0
- package/config/theme/style/compact.less +4 -0
- package/config/theme/style/components.less +65 -0
- package/config/theme/style/core/base.less +10 -0
- package/config/theme/style/core/global.less +491 -0
- package/config/theme/style/core/iconfont.less +22 -0
- package/config/theme/style/core/index.less +5 -0
- package/config/theme/style/core/motion/fade.less +34 -0
- package/config/theme/style/core/motion/move.less +129 -0
- package/config/theme/style/core/motion/other.less +51 -0
- package/config/theme/style/core/motion/slide.less +129 -0
- package/config/theme/style/core/motion/zoom.less +179 -0
- package/config/theme/style/core/motion.less +22 -0
- package/config/theme/style/css.js +3 -0
- package/config/theme/style/dark.less +4 -0
- package/config/theme/style/default.css +1784 -0
- package/config/theme/style/default.less +4 -0
- package/config/theme/style/index-pure.less +2 -0
- package/config/theme/style/index.css +1784 -0
- package/config/theme/style/index.d.ts +1 -0
- package/config/theme/style/index.js +3 -0
- package/config/theme/style/index.less +3 -0
- package/config/theme/style/mixins/box.less +7 -0
- package/config/theme/style/mixins/clearfix.less +16 -0
- package/config/theme/style/mixins/compatibility.less +13 -0
- package/config/theme/style/mixins/customize.less +181 -0
- package/config/theme/style/mixins/iconfont.less +28 -0
- package/config/theme/style/mixins/index.less +14 -0
- package/config/theme/style/mixins/modal-mask.less +30 -0
- package/config/theme/style/mixins/motion.less +33 -0
- package/config/theme/style/mixins/operation-unit.less +16 -0
- package/config/theme/style/mixins/reset.less +11 -0
- package/config/theme/style/mixins/rounded-arrow.less +44 -0
- package/config/theme/style/mixins/size.less +10 -0
- package/config/theme/style/mixins/typography.less +58 -0
- package/config/theme/style/themes/compact.less +295 -0
- package/config/theme/style/themes/dark.less +457 -0
- package/config/theme/style/themes/default.less +1080 -0
- package/config/theme/style/themes/index.less +7 -0
- package/config/theme/style/themes/variable.less +1135 -0
- package/config/theme/style/variable.less +4 -0
- package/lib/PropertyControlViewer/assets/doCommon.less +79 -0
- package/lib/PropertyControlViewer/assets/doSelect.less +81 -0
- package/lib/PropertyControlViewer/assets/index.less +189 -0
- package/lib/PropertyControlViewer/components/DoAppIcon/CustomIcon/iconfont.js +1 -0
- package/lib/PropertyControlViewer/components/DoAppIcon/iconData/IconJson.js +0 -0
- package/lib/PropertyControlViewer/components/TagShowMoreList/index.js +127 -0
- package/lib/PropertyControlViewer/components/TagShowMoreList/index.less +104 -0
- package/lib/PropertyControlViewer/config/constants.js +84 -0
- package/lib/PropertyControlViewer/config/utils.js +338 -0
- package/lib/PropertyControlViewer/index.less +161 -0
- package/lib/demo.js +0 -0
- package/lib/index.js +1 -0
- package/package.json +106 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
@import '~antd/lib/style/themes/default.less';
|
|
2
|
+
// @import '/Users/howard/products/aops_web_commons/node_modules/antd/lib/style/themes/default.less';
|
|
3
|
+
@import './common.less';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
// 通用
|
|
7
|
+
@text-color: rgba(0, 0, 0, 0.85); // 主文本色
|
|
8
|
+
@text-color-show: rgba(0, 0, 0, 0.65); // 主文本色 鉴于主和次文本之间
|
|
9
|
+
@disabled-bg: rgba(0, 0, 0, 0.04); // 禁用背景颜色符合UI规范
|
|
10
|
+
@border-color-base: rgba(0, 0, 0, 0.15); // 基础边框与禁用边框色统一符合UI规范
|
|
11
|
+
@sider-background: rgba(0, 0, 0, 0.02); // 左侧导航背景色符合UI规范
|
|
12
|
+
@border-color-split : rgba(0, 0, 0, 0.06); // 边框分割线
|
|
13
|
+
@box-shadow-base: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
|
|
14
|
+
// 基础布局
|
|
15
|
+
@layout-body-background: #F4F5FA; // 大背景色 ui 规范
|
|
16
|
+
@layout-header-color: white; // 头部字体色
|
|
17
|
+
@layout-header-background: #1E324E; // 头部背景色
|
|
18
|
+
@layout-header-division-color:rgba(255, 255, 255, 0.3); // 头部分割线颜色,161新增
|
|
19
|
+
@sider-collopse-btn-bg: #000; // 左右布局收起按钮背景色
|
|
20
|
+
@sider-collopse-btn-opacity: 0.06; // 左右布局收起按钮背景色
|
|
21
|
+
@top-nav-menu-bg: #FAFBFE;
|
|
22
|
+
// 按钮
|
|
23
|
+
@btn-warn-new: @red-6;
|
|
24
|
+
@btn-warn-hover-new: @red-5;
|
|
25
|
+
@btn-warn-focus-new: @red-7;
|
|
26
|
+
@btn-disabled-primary-color: @primary-1; // #97CDFF; // 主要按钮禁用背景色
|
|
27
|
+
@btn-disabled-group-primary-color: rgba(255, 255, 255, 0.45); // 主要按钮中组合按钮禁用状态下分割线色
|
|
28
|
+
|
|
29
|
+
// Tag
|
|
30
|
+
@tag-default-bg: rgba(0, 0, 0, 0.02);
|
|
31
|
+
@tag-border-color: rgba(0, 0, 0, 0.09);
|
|
32
|
+
@tag-custom-bg: @rate-star-bg;
|
|
33
|
+
|
|
34
|
+
// 菜单
|
|
35
|
+
@menu-dark-bg: #fff; // 菜单背景色
|
|
36
|
+
@menu-dark-submenu-bg: @menu-dark-bg; // 调整与整体菜单背景色一致
|
|
37
|
+
@menu-dark-color: @text-color; // 菜单文字颜色
|
|
38
|
+
@menu-dark-highlight-color: @primary-color; // 菜单高亮字体颜色
|
|
39
|
+
@menu-dark-item-active-bg: #F6F7F8; // 菜单的高亮背景色
|
|
40
|
+
@menu-dark-arrow-color: #000; // 菜单项下拉箭头颜色
|
|
41
|
+
@menu-dark-item-hover-bg: #F6F7F8; // 菜单项悬停背景色
|
|
42
|
+
@menu-dark-item-hover-color: @text-color; // 菜单hover色
|
|
43
|
+
@menu-dark-selected-item-icon-color: @primary-color; // 菜单项选中icon颜色
|
|
44
|
+
@menu-collapsed-btn-bg: @menu-dark-item-active-bg; // 菜单底部控制区收缩按钮背景色
|
|
45
|
+
@menu-collapsed-btn-color: @text-color-secondary; // 菜单底部控制区收缩按钮icon颜色
|
|
46
|
+
@menu-collapsed-btn-hover-color: @primary-5; // 菜单底部控制区收缩按钮悬停颜色
|
|
47
|
+
@menu-setting-btn-color: @text-color-secondary; // 菜单底部控制区设置icon颜色
|
|
48
|
+
@menu-setting-btn-hover-color: @primary-5; // 菜单底部控制区设置icon悬停色
|
|
49
|
+
@menu-version-color: @text-color-show; // 菜单底部控制区版本信息颜色
|
|
50
|
+
@menu-version-hover-color: @primary-5; // 菜单底部控制区版本信息悬停颜色
|
|
51
|
+
@menu-item-group-border-bottom-color: #F6F7F8; // 菜单收缩状态一级标题下边框颜色(非只有根元素)
|
|
52
|
+
@menu-wrapper-border-right-color: @tag-border-color; // 菜单外壳右边框颜色
|
|
53
|
+
// 提示框
|
|
54
|
+
@tooltip-color: @text-color;
|
|
55
|
+
@tooltip-bg: #fff;
|
|
56
|
+
|
|
57
|
+
// Modal
|
|
58
|
+
@modal-footer-border-color-split: @border-color-split; // 边框色
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
// input
|
|
62
|
+
@input-placeholder-color: @text-color-secondary;
|
|
63
|
+
@input-addon-bg: @component-background;
|
|
64
|
+
// @input-addon-bg:@component-background;
|
|
65
|
+
@caret-color: @text-color-show; // 光标颜色
|
|
66
|
+
// Form
|
|
67
|
+
@label-color: @text-color-show; // form label字体颜色
|
|
68
|
+
|
|
69
|
+
// Switch
|
|
70
|
+
@switch-disabled-opacity: 0.35; // 开关禁用透明度
|
|
71
|
+
@switch-disabled-bg: rgba(0, 0, 0, 0.15);
|
|
72
|
+
@switch-unchekcked-hover-bg: rgba(0, 0, 0, 0.2);
|
|
73
|
+
// 徽标数
|
|
74
|
+
@badge-highlight-color: #FF4D4F;
|
|
75
|
+
|
|
76
|
+
// 表格
|
|
77
|
+
@table-header-color: rgba(0, 0, 0, .65);
|
|
78
|
+
@table-row-hover-bg: rgba(0, 0, 0, 0.02); // 列表行hover色
|
|
79
|
+
@table-selected-row-bg: @component-background; // 选中背景色:复选框背景样式调整
|
|
80
|
+
@table-header-sort-bg :@table-header-bg; // 表头排序背景色
|
|
81
|
+
// Popover
|
|
82
|
+
@popover-min-width: 180px;
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
// Radio
|
|
86
|
+
@radio-button-color: @text-color-show; // 默认的Radio.Button颜色
|
|
87
|
+
@radio-background-color: @component-background; // 容器背景色
|
|
88
|
+
@radio-border-default: @border-color-base; // 边框默认颜色即未选中的颜色
|
|
89
|
+
@radio-border-disabled-unselected: @tag-border-color; // 容器禁用且未选中边框颜色
|
|
90
|
+
@radio-title-color: @text-color-show; // 内容标题颜色
|
|
91
|
+
@radio-describe-color: @text-color-secondary; // 内容描述区颜色
|
|
92
|
+
@radio-dot-disabled-bg: fade(@black, 20%); // Radio禁用圆点背景色
|
|
93
|
+
@radio-disabled-checked-bg: #e6e6e6; // Radio.Button禁用且选中背景色
|
|
94
|
+
// Checkbox
|
|
95
|
+
@checkbox-check-color: @component-background;
|
|
96
|
+
@checkbox-color-bg: @checkbox-color;
|
|
97
|
+
@checkbox-color-border: @checkbox-color;
|
|
98
|
+
@checkbox-check_-color:@checkbox-check-color; // 选中且非禁用状态下的边框色
|
|
99
|
+
// Slider
|
|
100
|
+
@slider-wrapper-rail-bgcolor: rgba(24, 144, 255, 0.15); // 默认的容器整条轨道颜色
|
|
101
|
+
@silder-wrapper-circle-border: @border-width-base @border-style-base @component-background; // 滑块边框颜色
|
|
102
|
+
@slider-wrapper-disabled-rail-color: rgba(0, 0, 0, 0.06); // 禁用状态下轨道颜色修正
|
|
103
|
+
@slider-wrapper-disabled-handle-color: @normal-color; // 禁用状态下触发颜色修正
|
|
104
|
+
|
|
105
|
+
// breadcrumb
|
|
106
|
+
// @breadcrumb-separator-margin: 0 10px;
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
// collapse
|
|
110
|
+
// @collapse-header-bg:rgba(0,0,0,0.02); // 默认背景
|
|
111
|
+
@collapse-header-hover-bg: @primary-1; // 头部hover背景色
|
|
112
|
+
|
|
113
|
+
// Steps
|
|
114
|
+
@process-tail-color: rgba(0, 0, 0, 0.15); // ui规范
|
|
115
|
+
@finish-tail-color: rgba(0, 0, 0, 0.15); // 新规范
|
|
116
|
+
|
|
117
|
+
// CWSelect
|
|
118
|
+
@select-selected-enable-bg: @primary-1;
|
|
119
|
+
@select-selected-enable-color: @primary-color;
|
|
120
|
+
@select-item-selected-font-weight: 500;
|
|
121
|
+
// 滚动条
|
|
122
|
+
@scroll-bar-background-color: auto;
|
|
123
|
+
@scroll-bar-thumb-background-color: auto;
|
|
124
|
+
|
|
125
|
+
// Skeleton
|
|
126
|
+
@skeleton-color: rgba(190, 190, 190, 0.2);
|
|
127
|
+
|
|
128
|
+
//
|
|
129
|
+
@sider-bottom-bg: @menu-dark-bg; // 侧边栏底部版本区域背景色,161新增
|
|
130
|
+
@advanced-filter-color: @primary-color; // 高级筛选字体色,161新增
|
|
131
|
+
@advanced-filter-expand-bg: @sider-background; // 高级搜索展开区域背景色
|
|
132
|
+
@advanced-filter-expand-icon-bg: #F2F3F5; // 高级搜索展开区域展开icon背景色
|
|
133
|
+
|
|
134
|
+
// tab
|
|
135
|
+
@tabs-border-color: @tag-border-color; // tab卡片默认边框色
|
|
136
|
+
@tabs-disabled-border-color: @border-color-base; // tab卡片禁用边框色
|
|
137
|
+
@tabs-card-head-background: @tag-default-bg; // tab卡片默认头部背景色
|
|
138
|
+
|
|
139
|
+
// 配合portal定制主题 -- develop分支需要
|
|
140
|
+
@portal-header-search-border-color: #d8d8d8;
|
|
141
|
+
@portal-header-search-bg: #173066;
|
|
142
|
+
@portal-header-logo:#fff;
|
|
143
|
+
|
|
144
|
+
@form-back-font: #FFFFFF;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/* stylelint-disable */
|
|
2
|
+
.bezierEasingMixin() {
|
|
3
|
+
@functions: ~`(function() {
|
|
4
|
+
var NEWTON_ITERATIONS = 4;
|
|
5
|
+
var NEWTON_MIN_SLOPE = 0.001;
|
|
6
|
+
var SUBDIVISION_PRECISION = 0.0000001;
|
|
7
|
+
var SUBDIVISION_MAX_ITERATIONS = 10;
|
|
8
|
+
|
|
9
|
+
var kSplineTableSize = 11;
|
|
10
|
+
var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
|
|
11
|
+
|
|
12
|
+
var float32ArraySupported = typeof Float32Array === 'function';
|
|
13
|
+
|
|
14
|
+
function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
|
|
15
|
+
function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
|
|
16
|
+
function C (aA1) { return 3.0 * aA1; }
|
|
17
|
+
|
|
18
|
+
// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
|
|
19
|
+
function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }
|
|
20
|
+
|
|
21
|
+
// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
|
|
22
|
+
function getSlope (aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); }
|
|
23
|
+
|
|
24
|
+
function binarySubdivide (aX, aA, aB, mX1, mX2) {
|
|
25
|
+
var currentX, currentT, i = 0;
|
|
26
|
+
do {
|
|
27
|
+
currentT = aA + (aB - aA) / 2.0;
|
|
28
|
+
currentX = calcBezier(currentT, mX1, mX2) - aX;
|
|
29
|
+
if (currentX > 0.0) {
|
|
30
|
+
aB = currentT;
|
|
31
|
+
} else {
|
|
32
|
+
aA = currentT;
|
|
33
|
+
}
|
|
34
|
+
} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
|
|
35
|
+
return currentT;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {
|
|
39
|
+
for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
|
|
40
|
+
var currentSlope = getSlope(aGuessT, mX1, mX2);
|
|
41
|
+
if (currentSlope === 0.0) {
|
|
42
|
+
return aGuessT;
|
|
43
|
+
}
|
|
44
|
+
var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
|
|
45
|
+
aGuessT -= currentX / currentSlope;
|
|
46
|
+
}
|
|
47
|
+
return aGuessT;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
var BezierEasing = function (mX1, mY1, mX2, mY2) {
|
|
51
|
+
if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {
|
|
52
|
+
throw new Error('bezier x values must be in [0, 1] range');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Precompute samples table
|
|
56
|
+
var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
|
|
57
|
+
if (mX1 !== mY1 || mX2 !== mY2) {
|
|
58
|
+
for (var i = 0; i < kSplineTableSize; ++i) {
|
|
59
|
+
sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function getTForX (aX) {
|
|
64
|
+
var intervalStart = 0.0;
|
|
65
|
+
var currentSample = 1;
|
|
66
|
+
var lastSample = kSplineTableSize - 1;
|
|
67
|
+
|
|
68
|
+
for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
|
|
69
|
+
intervalStart += kSampleStepSize;
|
|
70
|
+
}
|
|
71
|
+
--currentSample;
|
|
72
|
+
|
|
73
|
+
// Interpolate to provide an initial guess for t
|
|
74
|
+
var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);
|
|
75
|
+
var guessForT = intervalStart + dist * kSampleStepSize;
|
|
76
|
+
|
|
77
|
+
var initialSlope = getSlope(guessForT, mX1, mX2);
|
|
78
|
+
if (initialSlope >= NEWTON_MIN_SLOPE) {
|
|
79
|
+
return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
|
|
80
|
+
} else if (initialSlope === 0.0) {
|
|
81
|
+
return guessForT;
|
|
82
|
+
} else {
|
|
83
|
+
return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return function BezierEasing (x) {
|
|
88
|
+
if (mX1 === mY1 && mX2 === mY2) {
|
|
89
|
+
return x; // linear
|
|
90
|
+
}
|
|
91
|
+
// Because JavaScript number are imprecise, we should guarantee the extremes are right.
|
|
92
|
+
if (x === 0) {
|
|
93
|
+
return 0;
|
|
94
|
+
}
|
|
95
|
+
if (x === 1) {
|
|
96
|
+
return 1;
|
|
97
|
+
}
|
|
98
|
+
return calcBezier(getTForX(x), mY1, mY2);
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
this.colorEasing = BezierEasing(0.26, 0.09, 0.37, 0.18);
|
|
103
|
+
// less 3 requires a return
|
|
104
|
+
return '';
|
|
105
|
+
})()`;
|
|
106
|
+
}
|
|
107
|
+
// It is hacky way to make this function will be compiled preferentially by less
|
|
108
|
+
// resolve error: `ReferenceError: colorPalette is not defined`
|
|
109
|
+
// https://github.com/ant-design/ant-motion/issues/44
|
|
110
|
+
.bezierEasingMixin();
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/* stylelint-disable no-duplicate-selectors */
|
|
2
|
+
@import "bezierEasing";
|
|
3
|
+
@import "tinyColor";
|
|
4
|
+
|
|
5
|
+
// We create a very complex algorithm which take the place of original tint/shade color system
|
|
6
|
+
// to make sure no one can understand it 👻
|
|
7
|
+
// and create an entire color palette magicly by inputing just a single primary color.
|
|
8
|
+
// We are using bezier-curve easing function and some color manipulations like tint/shade/darken/spin
|
|
9
|
+
.colorPaletteMixin() {
|
|
10
|
+
@functions: ~`(function() {
|
|
11
|
+
var hueStep = 2;
|
|
12
|
+
var saturationStep = 0.16;
|
|
13
|
+
var saturationStep2 = 0.05;
|
|
14
|
+
var brightnessStep1 = 0.05;
|
|
15
|
+
var brightnessStep2 = 0.15;
|
|
16
|
+
var lightColorCount = 5;
|
|
17
|
+
var darkColorCount = 4;
|
|
18
|
+
|
|
19
|
+
var getHue = function(hsv, i, isLight) {
|
|
20
|
+
var hue;
|
|
21
|
+
if (hsv.h >= 60 && hsv.h <= 240) {
|
|
22
|
+
hue = isLight ? hsv.h - hueStep * i : hsv.h + hueStep * i;
|
|
23
|
+
} else {
|
|
24
|
+
hue = isLight ? hsv.h + hueStep * i : hsv.h - hueStep * i;
|
|
25
|
+
}
|
|
26
|
+
if (hue < 0) {
|
|
27
|
+
hue += 360;
|
|
28
|
+
} else if (hue >= 360) {
|
|
29
|
+
hue -= 360;
|
|
30
|
+
}
|
|
31
|
+
return Math.round(hue);
|
|
32
|
+
};
|
|
33
|
+
var getSaturation = function(hsv, i, isLight) {
|
|
34
|
+
// grey color don't change saturation
|
|
35
|
+
if (hsv.h === 0 && hsv.s === 0) {
|
|
36
|
+
return hsv.s;
|
|
37
|
+
}
|
|
38
|
+
var saturation;
|
|
39
|
+
if (isLight) {
|
|
40
|
+
saturation = hsv.s - saturationStep * i;
|
|
41
|
+
} else if (i === darkColorCount) {
|
|
42
|
+
saturation = hsv.s + saturationStep;
|
|
43
|
+
} else {
|
|
44
|
+
saturation = hsv.s + saturationStep2 * i;
|
|
45
|
+
}
|
|
46
|
+
if (saturation > 1) {
|
|
47
|
+
saturation = 1;
|
|
48
|
+
}
|
|
49
|
+
if (isLight && i === lightColorCount && saturation > 0.1) {
|
|
50
|
+
saturation = 0.1;
|
|
51
|
+
}
|
|
52
|
+
if (saturation < 0.06) {
|
|
53
|
+
saturation = 0.06;
|
|
54
|
+
}
|
|
55
|
+
return Number(saturation.toFixed(2));
|
|
56
|
+
};
|
|
57
|
+
var getValue = function(hsv, i, isLight) {
|
|
58
|
+
var value;
|
|
59
|
+
if (isLight) {
|
|
60
|
+
value = hsv.v + brightnessStep1 * i;
|
|
61
|
+
}else{
|
|
62
|
+
value = hsv.v - brightnessStep2 * i
|
|
63
|
+
}
|
|
64
|
+
if (value > 1) {
|
|
65
|
+
value = 1;
|
|
66
|
+
}
|
|
67
|
+
return Number(value.toFixed(2))
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
this.colorPalette = function(color, index) {
|
|
71
|
+
var isLight = index <= 6;
|
|
72
|
+
var hsv = tinycolor(color).toHsv();
|
|
73
|
+
var i = isLight ? lightColorCount + 1 - index : index - lightColorCount - 1;
|
|
74
|
+
return tinycolor({
|
|
75
|
+
h: getHue(hsv, i, isLight),
|
|
76
|
+
s: getSaturation(hsv, i, isLight),
|
|
77
|
+
v: getValue(hsv, i, isLight),
|
|
78
|
+
}).toHexString();
|
|
79
|
+
};
|
|
80
|
+
})()`;
|
|
81
|
+
}
|
|
82
|
+
// It is hacky way to make this function will be compiled preferentially by less
|
|
83
|
+
// resolve error: `ReferenceError: colorPalette is not defined`
|
|
84
|
+
// https://github.com/ant-design/ant-motion/issues/44
|
|
85
|
+
.colorPaletteMixin();
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
@import 'colorPalette';
|
|
2
|
+
|
|
3
|
+
// color palettes
|
|
4
|
+
@blue-base: #1890ff;
|
|
5
|
+
@blue-1: color(~`colorPalette('@{blue-6}', 1) `);
|
|
6
|
+
@blue-2: color(~`colorPalette('@{blue-6}', 2) `);
|
|
7
|
+
@blue-3: color(~`colorPalette('@{blue-6}', 3) `);
|
|
8
|
+
@blue-4: color(~`colorPalette('@{blue-6}', 4) `);
|
|
9
|
+
@blue-5: color(~`colorPalette('@{blue-6}', 5) `);
|
|
10
|
+
@blue-6: @blue-base;
|
|
11
|
+
@blue-7: color(~`colorPalette('@{blue-6}', 7) `);
|
|
12
|
+
@blue-8: color(~`colorPalette('@{blue-6}', 8) `);
|
|
13
|
+
@blue-9: color(~`colorPalette('@{blue-6}', 9) `);
|
|
14
|
+
@blue-10: color(~`colorPalette('@{blue-6}', 10) `);
|
|
15
|
+
|
|
16
|
+
@purple-base: #722ed1;
|
|
17
|
+
@purple-1: color(~`colorPalette('@{purple-6}', 1) `);
|
|
18
|
+
@purple-2: color(~`colorPalette('@{purple-6}', 2) `);
|
|
19
|
+
@purple-3: color(~`colorPalette('@{purple-6}', 3) `);
|
|
20
|
+
@purple-4: color(~`colorPalette('@{purple-6}', 4) `);
|
|
21
|
+
@purple-5: color(~`colorPalette('@{purple-6}', 5) `);
|
|
22
|
+
@purple-6: @purple-base;
|
|
23
|
+
@purple-7: color(~`colorPalette('@{purple-6}', 7) `);
|
|
24
|
+
@purple-8: color(~`colorPalette('@{purple-6}', 8) `);
|
|
25
|
+
@purple-9: color(~`colorPalette('@{purple-6}', 9) `);
|
|
26
|
+
@purple-10: color(~`colorPalette('@{purple-6}', 10) `);
|
|
27
|
+
|
|
28
|
+
@cyan-base: #13c2c2;
|
|
29
|
+
@cyan-1: color(~`colorPalette('@{cyan-6}', 1) `);
|
|
30
|
+
@cyan-2: color(~`colorPalette('@{cyan-6}', 2) `);
|
|
31
|
+
@cyan-3: color(~`colorPalette('@{cyan-6}', 3) `);
|
|
32
|
+
@cyan-4: color(~`colorPalette('@{cyan-6}', 4) `);
|
|
33
|
+
@cyan-5: color(~`colorPalette('@{cyan-6}', 5) `);
|
|
34
|
+
@cyan-6: @cyan-base;
|
|
35
|
+
@cyan-7: color(~`colorPalette('@{cyan-6}', 7) `);
|
|
36
|
+
@cyan-8: color(~`colorPalette('@{cyan-6}', 8) `);
|
|
37
|
+
@cyan-9: color(~`colorPalette('@{cyan-6}', 9) `);
|
|
38
|
+
@cyan-10: color(~`colorPalette('@{cyan-6}', 10) `);
|
|
39
|
+
|
|
40
|
+
@green-base: #52c41a;
|
|
41
|
+
@green-1: color(~`colorPalette('@{green-6}', 1) `);
|
|
42
|
+
@green-2: color(~`colorPalette('@{green-6}', 2) `);
|
|
43
|
+
@green-3: color(~`colorPalette('@{green-6}', 3) `);
|
|
44
|
+
@green-4: color(~`colorPalette('@{green-6}', 4) `);
|
|
45
|
+
@green-5: color(~`colorPalette('@{green-6}', 5) `);
|
|
46
|
+
@green-6: @green-base;
|
|
47
|
+
@green-7: color(~`colorPalette('@{green-6}', 7) `);
|
|
48
|
+
@green-8: color(~`colorPalette('@{green-6}', 8) `);
|
|
49
|
+
@green-9: color(~`colorPalette('@{green-6}', 9) `);
|
|
50
|
+
@green-10: color(~`colorPalette('@{green-6}', 10) `);
|
|
51
|
+
|
|
52
|
+
@magenta-base: #eb2f96;
|
|
53
|
+
@magenta-1: color(~`colorPalette('@{magenta-6}', 1) `);
|
|
54
|
+
@magenta-2: color(~`colorPalette('@{magenta-6}', 2) `);
|
|
55
|
+
@magenta-3: color(~`colorPalette('@{magenta-6}', 3) `);
|
|
56
|
+
@magenta-4: color(~`colorPalette('@{magenta-6}', 4) `);
|
|
57
|
+
@magenta-5: color(~`colorPalette('@{magenta-6}', 5) `);
|
|
58
|
+
@magenta-6: @magenta-base;
|
|
59
|
+
@magenta-7: color(~`colorPalette('@{magenta-6}', 7) `);
|
|
60
|
+
@magenta-8: color(~`colorPalette('@{magenta-6}', 8) `);
|
|
61
|
+
@magenta-9: color(~`colorPalette('@{magenta-6}', 9) `);
|
|
62
|
+
@magenta-10: color(~`colorPalette('@{magenta-6}', 10) `);
|
|
63
|
+
|
|
64
|
+
// alias of magenta
|
|
65
|
+
@pink-base: #eb2f96;
|
|
66
|
+
@pink-1: color(~`colorPalette('@{pink-6}', 1) `);
|
|
67
|
+
@pink-2: color(~`colorPalette('@{pink-6}', 2) `);
|
|
68
|
+
@pink-3: color(~`colorPalette('@{pink-6}', 3) `);
|
|
69
|
+
@pink-4: color(~`colorPalette('@{pink-6}', 4) `);
|
|
70
|
+
@pink-5: color(~`colorPalette('@{pink-6}', 5) `);
|
|
71
|
+
@pink-6: @pink-base;
|
|
72
|
+
@pink-7: color(~`colorPalette('@{pink-6}', 7) `);
|
|
73
|
+
@pink-8: color(~`colorPalette('@{pink-6}', 8) `);
|
|
74
|
+
@pink-9: color(~`colorPalette('@{pink-6}', 9) `);
|
|
75
|
+
@pink-10: color(~`colorPalette('@{pink-6}', 10) `);
|
|
76
|
+
|
|
77
|
+
@red-base: #f5222d;
|
|
78
|
+
@red-1: color(~`colorPalette('@{red-6}', 1) `);
|
|
79
|
+
@red-2: color(~`colorPalette('@{red-6}', 2) `);
|
|
80
|
+
@red-3: color(~`colorPalette('@{red-6}', 3) `);
|
|
81
|
+
@red-4: color(~`colorPalette('@{red-6}', 4) `);
|
|
82
|
+
@red-5: color(~`colorPalette('@{red-6}', 5) `);
|
|
83
|
+
@red-6: @red-base;
|
|
84
|
+
@red-7: color(~`colorPalette('@{red-6}', 7) `);
|
|
85
|
+
@red-8: color(~`colorPalette('@{red-6}', 8) `);
|
|
86
|
+
@red-9: color(~`colorPalette('@{red-6}', 9) `);
|
|
87
|
+
@red-10: color(~`colorPalette('@{red-6}', 10) `);
|
|
88
|
+
|
|
89
|
+
@orange-base: #fa8c16;
|
|
90
|
+
@orange-1: color(~`colorPalette('@{orange-6}', 1) `);
|
|
91
|
+
@orange-2: color(~`colorPalette('@{orange-6}', 2) `);
|
|
92
|
+
@orange-3: color(~`colorPalette('@{orange-6}', 3) `);
|
|
93
|
+
@orange-4: color(~`colorPalette('@{orange-6}', 4) `);
|
|
94
|
+
@orange-5: color(~`colorPalette('@{orange-6}', 5) `);
|
|
95
|
+
@orange-6: @orange-base;
|
|
96
|
+
@orange-7: color(~`colorPalette('@{orange-6}', 7) `);
|
|
97
|
+
@orange-8: color(~`colorPalette('@{orange-6}', 8) `);
|
|
98
|
+
@orange-9: color(~`colorPalette('@{orange-6}', 9) `);
|
|
99
|
+
@orange-10: color(~`colorPalette('@{orange-6}', 10) `);
|
|
100
|
+
|
|
101
|
+
@yellow-base: #fadb14;
|
|
102
|
+
@yellow-1: color(~`colorPalette('@{yellow-6}', 1) `);
|
|
103
|
+
@yellow-2: color(~`colorPalette('@{yellow-6}', 2) `);
|
|
104
|
+
@yellow-3: color(~`colorPalette('@{yellow-6}', 3) `);
|
|
105
|
+
@yellow-4: color(~`colorPalette('@{yellow-6}', 4) `);
|
|
106
|
+
@yellow-5: color(~`colorPalette('@{yellow-6}', 5) `);
|
|
107
|
+
@yellow-6: @yellow-base;
|
|
108
|
+
@yellow-7: color(~`colorPalette('@{yellow-6}', 7) `);
|
|
109
|
+
@yellow-8: color(~`colorPalette('@{yellow-6}', 8) `);
|
|
110
|
+
@yellow-9: color(~`colorPalette('@{yellow-6}', 9) `);
|
|
111
|
+
@yellow-10: color(~`colorPalette('@{yellow-6}', 10) `);
|
|
112
|
+
|
|
113
|
+
@volcano-base: #fa541c;
|
|
114
|
+
@volcano-1: color(~`colorPalette('@{volcano-6}', 1) `);
|
|
115
|
+
@volcano-2: color(~`colorPalette('@{volcano-6}', 2) `);
|
|
116
|
+
@volcano-3: color(~`colorPalette('@{volcano-6}', 3) `);
|
|
117
|
+
@volcano-4: color(~`colorPalette('@{volcano-6}', 4) `);
|
|
118
|
+
@volcano-5: color(~`colorPalette('@{volcano-6}', 5) `);
|
|
119
|
+
@volcano-6: @volcano-base;
|
|
120
|
+
@volcano-7: color(~`colorPalette('@{volcano-6}', 7) `);
|
|
121
|
+
@volcano-8: color(~`colorPalette('@{volcano-6}', 8) `);
|
|
122
|
+
@volcano-9: color(~`colorPalette('@{volcano-6}', 9) `);
|
|
123
|
+
@volcano-10: color(~`colorPalette('@{volcano-6}', 10) `);
|
|
124
|
+
|
|
125
|
+
@geekblue-base: #2f54eb;
|
|
126
|
+
@geekblue-1: color(~`colorPalette('@{geekblue-6}', 1) `);
|
|
127
|
+
@geekblue-2: color(~`colorPalette('@{geekblue-6}', 2) `);
|
|
128
|
+
@geekblue-3: color(~`colorPalette('@{geekblue-6}', 3) `);
|
|
129
|
+
@geekblue-4: color(~`colorPalette('@{geekblue-6}', 4) `);
|
|
130
|
+
@geekblue-5: color(~`colorPalette('@{geekblue-6}', 5) `);
|
|
131
|
+
@geekblue-6: @geekblue-base;
|
|
132
|
+
@geekblue-7: color(~`colorPalette('@{geekblue-6}', 7) `);
|
|
133
|
+
@geekblue-8: color(~`colorPalette('@{geekblue-6}', 8) `);
|
|
134
|
+
@geekblue-9: color(~`colorPalette('@{geekblue-6}', 9) `);
|
|
135
|
+
@geekblue-10: color(~`colorPalette('@{geekblue-6}', 10) `);
|
|
136
|
+
|
|
137
|
+
@lime-base: #a0d911;
|
|
138
|
+
@lime-1: color(~`colorPalette('@{lime-6}', 1) `);
|
|
139
|
+
@lime-2: color(~`colorPalette('@{lime-6}', 2) `);
|
|
140
|
+
@lime-3: color(~`colorPalette('@{lime-6}', 3) `);
|
|
141
|
+
@lime-4: color(~`colorPalette('@{lime-6}', 4) `);
|
|
142
|
+
@lime-5: color(~`colorPalette('@{lime-6}', 5) `);
|
|
143
|
+
@lime-6: @lime-base;
|
|
144
|
+
@lime-7: color(~`colorPalette('@{lime-6}', 7) `);
|
|
145
|
+
@lime-8: color(~`colorPalette('@{lime-6}', 8) `);
|
|
146
|
+
@lime-9: color(~`colorPalette('@{lime-6}', 9) `);
|
|
147
|
+
@lime-10: color(~`colorPalette('@{lime-6}', 10) `);
|
|
148
|
+
|
|
149
|
+
@gold-base: #faad14;
|
|
150
|
+
@gold-1: color(~`colorPalette('@{gold-6}', 1) `);
|
|
151
|
+
@gold-2: color(~`colorPalette('@{gold-6}', 2) `);
|
|
152
|
+
@gold-3: color(~`colorPalette('@{gold-6}', 3) `);
|
|
153
|
+
@gold-4: color(~`colorPalette('@{gold-6}', 4) `);
|
|
154
|
+
@gold-5: color(~`colorPalette('@{gold-6}', 5) `);
|
|
155
|
+
@gold-6: @gold-base;
|
|
156
|
+
@gold-7: color(~`colorPalette('@{gold-6}', 7) `);
|
|
157
|
+
@gold-8: color(~`colorPalette('@{gold-6}', 8) `);
|
|
158
|
+
@gold-9: color(~`colorPalette('@{gold-6}', 9) `);
|
|
159
|
+
@gold-10: color(~`colorPalette('@{gold-6}', 10) `);
|
|
160
|
+
|
|
161
|
+
@preset-colors: pink, magenta, red, volcano, orange, yellow, gold, cyan, lime, green, blue, geekblue,
|
|
162
|
+
purple;
|