@363045841yyt/klinechart-core 0.7.6 → 0.7.8
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/dist/config/chartSettings.d.ts +27 -2
- package/dist/config/chartSettings.d.ts.map +1 -1
- package/dist/config/chartSettings.js +6 -0
- package/dist/config/chartSettings.js.map +1 -1
- package/dist/engine/chart.d.ts.map +1 -1
- package/dist/engine/chart.js +4 -0
- package/dist/engine/chart.js.map +1 -1
- package/dist/engine/draw/pixelAlign.d.ts.map +1 -1
- package/dist/engine/draw/pixelAlign.js.map +1 -1
- package/dist/engine/drawing/plugin.js +1 -1
- package/dist/engine/drawing/plugin.js.map +1 -1
- package/dist/engine/renderers/Indicator/atr.d.ts.map +1 -1
- package/dist/engine/renderers/Indicator/atr.js +7 -4
- package/dist/engine/renderers/Indicator/atr.js.map +1 -1
- package/dist/engine/renderers/Indicator/boll.js +12 -12
- package/dist/engine/renderers/Indicator/boll.js.map +1 -1
- package/dist/engine/renderers/Indicator/cci.d.ts +1 -2
- package/dist/engine/renderers/Indicator/cci.d.ts.map +1 -1
- package/dist/engine/renderers/Indicator/cci.js +9 -9
- package/dist/engine/renderers/Indicator/cci.js.map +1 -1
- package/dist/engine/renderers/Indicator/ene.js +12 -12
- package/dist/engine/renderers/Indicator/ene.js.map +1 -1
- package/dist/engine/renderers/Indicator/expma.js +6 -6
- package/dist/engine/renderers/Indicator/expma.js.map +1 -1
- package/dist/engine/renderers/Indicator/fastk.d.ts +1 -2
- package/dist/engine/renderers/Indicator/fastk.d.ts.map +1 -1
- package/dist/engine/renderers/Indicator/fastk.js +7 -7
- package/dist/engine/renderers/Indicator/fastk.js.map +1 -1
- package/dist/engine/renderers/Indicator/kst.d.ts +1 -2
- package/dist/engine/renderers/Indicator/kst.d.ts.map +1 -1
- package/dist/engine/renderers/Indicator/kst.js +10 -10
- package/dist/engine/renderers/Indicator/kst.js.map +1 -1
- package/dist/engine/renderers/Indicator/ma.js +5 -5
- package/dist/engine/renderers/Indicator/ma.js.map +1 -1
- package/dist/engine/renderers/Indicator/macd.d.ts +1 -2
- package/dist/engine/renderers/Indicator/macd.d.ts.map +1 -1
- package/dist/engine/renderers/Indicator/macd.js +24 -24
- package/dist/engine/renderers/Indicator/macd.js.map +1 -1
- package/dist/engine/renderers/Indicator/macdLegend.js +6 -6
- package/dist/engine/renderers/Indicator/macdLegend.js.map +1 -1
- package/dist/engine/renderers/Indicator/mainIndicatorLegend.js +16 -16
- package/dist/engine/renderers/Indicator/mainIndicatorLegend.js.map +1 -1
- package/dist/engine/renderers/Indicator/mom.d.ts +1 -2
- package/dist/engine/renderers/Indicator/mom.d.ts.map +1 -1
- package/dist/engine/renderers/Indicator/mom.js +8 -8
- package/dist/engine/renderers/Indicator/mom.js.map +1 -1
- package/dist/engine/renderers/Indicator/rsi.d.ts +2 -3
- package/dist/engine/renderers/Indicator/rsi.d.ts.map +1 -1
- package/dist/engine/renderers/Indicator/rsi.js +19 -15
- package/dist/engine/renderers/Indicator/rsi.js.map +1 -1
- package/dist/engine/renderers/Indicator/scale/indicator_scale.d.ts +1 -2
- package/dist/engine/renderers/Indicator/scale/indicator_scale.d.ts.map +1 -1
- package/dist/engine/renderers/Indicator/scale/indicator_scale.js +5 -5
- package/dist/engine/renderers/Indicator/scale/indicator_scale.js.map +1 -1
- package/dist/engine/renderers/Indicator/stoch.d.ts +1 -2
- package/dist/engine/renderers/Indicator/stoch.d.ts.map +1 -1
- package/dist/engine/renderers/Indicator/stoch.js +10 -10
- package/dist/engine/renderers/Indicator/stoch.js.map +1 -1
- package/dist/engine/renderers/Indicator/structure.js +5 -5
- package/dist/engine/renderers/Indicator/structure.js.map +1 -1
- package/dist/engine/renderers/Indicator/wmsr.d.ts +1 -2
- package/dist/engine/renderers/Indicator/wmsr.d.ts.map +1 -1
- package/dist/engine/renderers/Indicator/wmsr.js +10 -10
- package/dist/engine/renderers/Indicator/wmsr.js.map +1 -1
- package/dist/engine/renderers/Indicator/zones.js +6 -6
- package/dist/engine/renderers/Indicator/zones.js.map +1 -1
- package/dist/engine/renderers/candle.d.ts +1 -1
- package/dist/engine/renderers/candle.d.ts.map +1 -1
- package/dist/engine/renderers/candle.js +21 -21
- package/dist/engine/renderers/candle.js.map +1 -1
- package/dist/engine/renderers/crosshair.js +3 -3
- package/dist/engine/renderers/crosshair.js.map +1 -1
- package/dist/engine/renderers/extremaMarkers.d.ts.map +1 -1
- package/dist/engine/renderers/extremaMarkers.js +12 -12
- package/dist/engine/renderers/extremaMarkers.js.map +1 -1
- package/dist/engine/renderers/gridLines.js +3 -3
- package/dist/engine/renderers/gridLines.js.map +1 -1
- package/dist/engine/renderers/lastPrice.js +7 -7
- package/dist/engine/renderers/lastPrice.js.map +1 -1
- package/dist/engine/renderers/paneTitle.js +6 -6
- package/dist/engine/renderers/paneTitle.js.map +1 -1
- package/dist/engine/renderers/subVolume.d.ts.map +1 -1
- package/dist/engine/renderers/subVolume.js +23 -20
- package/dist/engine/renderers/subVolume.js.map +1 -1
- package/dist/engine/renderers/timeAxis.js +9 -9
- package/dist/engine/renderers/timeAxis.js.map +1 -1
- package/dist/engine/renderers/webgl/candleSurface.d.ts.map +1 -1
- package/dist/engine/renderers/webgl/candleSurface.js +39 -7
- package/dist/engine/renderers/webgl/candleSurface.js.map +1 -1
- package/dist/engine/renderers/yAxis.d.ts.map +1 -1
- package/dist/engine/renderers/yAxis.js +5 -5
- package/dist/engine/renderers/yAxis.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/plugin/types.d.ts +5 -1
- package/dist/plugin/types.d.ts.map +1 -1
- package/dist/plugin/types.js.map +1 -1
- package/dist/tokens/colorPresetSettings.d.ts +15 -0
- package/dist/tokens/colorPresetSettings.d.ts.map +1 -0
- package/dist/tokens/colorPresetSettings.js +65 -0
- package/dist/tokens/colorPresetSettings.js.map +1 -0
- package/dist/tokens/index.d.ts +17 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/index.js +16 -0
- package/dist/tokens/index.js.map +1 -0
- package/dist/tokens/mergeTheme.d.ts +17 -0
- package/dist/tokens/mergeTheme.d.ts.map +1 -0
- package/dist/tokens/mergeTheme.js +43 -0
- package/dist/tokens/mergeTheme.js.map +1 -0
- package/dist/tokens/theme-china.d.ts +45 -0
- package/dist/tokens/theme-china.d.ts.map +1 -0
- package/dist/tokens/theme-china.js +116 -0
- package/dist/tokens/theme-china.js.map +1 -0
- package/dist/tokens/theme-dark.d.ts +21 -0
- package/dist/tokens/theme-dark.d.ts.map +1 -0
- package/dist/tokens/theme-dark.js +228 -0
- package/dist/tokens/theme-dark.js.map +1 -0
- package/dist/tokens/theme-light.d.ts +23 -0
- package/dist/tokens/theme-light.d.ts.map +1 -0
- package/dist/tokens/theme-light.js +234 -0
- package/dist/tokens/theme-light.js.map +1 -0
- package/dist/tokens/themeToCssVars.d.ts +74 -0
- package/dist/tokens/themeToCssVars.d.ts.map +1 -0
- package/dist/tokens/themeToCssVars.js +108 -0
- package/dist/tokens/themeToCssVars.js.map +1 -0
- package/dist/tokens/types.d.ts +335 -0
- package/dist/tokens/types.d.ts.map +1 -0
- package/dist/tokens/types.js +20 -0
- package/dist/tokens/types.js.map +1 -0
- package/dist/utils/kLineDraw/axis.d.ts +8 -7
- package/dist/utils/kLineDraw/axis.d.ts.map +1 -1
- package/dist/utils/kLineDraw/axis.js +24 -24
- package/dist/utils/kLineDraw/axis.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/config/chartSettings.ts +11 -2
- package/src/engine/chart.ts +4 -0
- package/src/engine/draw/pixelAlign.ts +0 -2
- package/src/engine/drawing/plugin.ts +1 -1
- package/src/engine/renderers/Indicator/atr.ts +7 -3
- package/src/engine/renderers/Indicator/boll.ts +12 -12
- package/src/engine/renderers/Indicator/cci.ts +11 -10
- package/src/engine/renderers/Indicator/ene.ts +12 -12
- package/src/engine/renderers/Indicator/expma.ts +6 -6
- package/src/engine/renderers/Indicator/fastk.ts +9 -8
- package/src/engine/renderers/Indicator/kst.ts +12 -11
- package/src/engine/renderers/Indicator/ma.ts +5 -5
- package/src/engine/renderers/Indicator/macd.ts +27 -25
- package/src/engine/renderers/Indicator/macdLegend.ts +6 -6
- package/src/engine/renderers/Indicator/mainIndicatorLegend.ts +16 -16
- package/src/engine/renderers/Indicator/mom.ts +11 -10
- package/src/engine/renderers/Indicator/rsi.ts +22 -15
- package/src/engine/renderers/Indicator/scale/indicator_scale.ts +6 -6
- package/src/engine/renderers/Indicator/stoch.ts +12 -11
- package/src/engine/renderers/Indicator/structure.ts +5 -5
- package/src/engine/renderers/Indicator/wmsr.ts +13 -12
- package/src/engine/renderers/Indicator/zones.ts +7 -7
- package/src/engine/renderers/candle.ts +21 -21
- package/src/engine/renderers/crosshair.ts +3 -3
- package/src/engine/renderers/extremaMarkers.ts +13 -12
- package/src/engine/renderers/gridLines.ts +3 -3
- package/src/engine/renderers/lastPrice.ts +7 -7
- package/src/engine/renderers/paneTitle.ts +6 -6
- package/src/engine/renderers/subVolume.ts +23 -20
- package/src/engine/renderers/timeAxis.ts +9 -9
- package/src/engine/renderers/webgl/candleSurface.ts +43 -7
- package/src/engine/renderers/yAxis.ts +6 -5
- package/src/index.ts +1 -0
- package/src/plugin/types.ts +5 -1
- package/src/tokens/__tests__/__snapshots__/baseline.test.ts.snap +393 -0
- package/src/tokens/__tests__/baseline.test.ts +183 -0
- package/src/tokens/__tests__/themeToCssVars.test.ts +175 -0
- package/src/tokens/__tests__/tokens.test.ts +215 -0
- package/src/tokens/colorPresetSettings.ts +128 -0
- package/src/tokens/index.ts +65 -0
- package/src/tokens/mergeTheme.ts +48 -0
- package/src/tokens/theme-china.ts +132 -0
- package/src/tokens/theme-dark.ts +244 -0
- package/src/tokens/theme-light.ts +250 -0
- package/src/tokens/themeToCssVars.ts +138 -0
- package/src/tokens/types.ts +394 -0
- package/src/utils/kLineDraw/axis.ts +31 -30
- package/src/version.ts +1 -1
- package/dist/engine/theme/colors.d.ts +0 -223
- package/dist/engine/theme/colors.d.ts.map +0 -1
- package/dist/engine/theme/colors.js +0 -375
- package/dist/engine/theme/colors.js.map +0 -1
- package/src/engine/theme/colors.ts +0 -642
|
@@ -1,642 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 主题感知颜色配置
|
|
3
|
-
* 所有颜色通过 getColors(theme) 获取,支持 light/dark 双主题
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/** 主题类型 */
|
|
7
|
-
export type ChartTheme = 'light' | 'dark'
|
|
8
|
-
|
|
9
|
-
/** 文本颜色 */
|
|
10
|
-
export interface TextColors {
|
|
11
|
-
PRIMARY: string
|
|
12
|
-
SECONDARY: string
|
|
13
|
-
TERTIARY: string
|
|
14
|
-
WEAK: string
|
|
15
|
-
WHITE: string
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/** 涨跌价格颜色 */
|
|
19
|
-
export interface PriceColors {
|
|
20
|
-
UP: string
|
|
21
|
-
UP_LIGHT: string
|
|
22
|
-
UP_TICK: string
|
|
23
|
-
DOWN: string
|
|
24
|
-
DOWN_LIGHT: string
|
|
25
|
-
DOWN_TICK: string
|
|
26
|
-
NEUTRAL: string
|
|
27
|
-
LAST_PRICE: string
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/** 标签背景颜色 */
|
|
31
|
-
export interface TagBgColors {
|
|
32
|
-
WHITE: string
|
|
33
|
-
LIGHT_GRAY: string
|
|
34
|
-
PURE_WHITE: string
|
|
35
|
-
TRANSPARENT: string
|
|
36
|
-
ACTIVE: string
|
|
37
|
-
ACTIVE_HOVER: string
|
|
38
|
-
HOVER: string
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/** 边框颜色 */
|
|
42
|
-
export interface BorderColors {
|
|
43
|
-
DARK: string
|
|
44
|
-
MEDIUM: string
|
|
45
|
-
LIGHT: string
|
|
46
|
-
SEPARATOR: string
|
|
47
|
-
BUTTON: string
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/** 网格线颜色 */
|
|
51
|
-
export interface GridColors {
|
|
52
|
-
HORIZONTAL: string
|
|
53
|
-
VERTICAL: string
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/** 十字线颜色 */
|
|
57
|
-
export interface CrosshairColors {
|
|
58
|
-
LINE: string
|
|
59
|
-
LABEL_BG: string
|
|
60
|
-
LABEL_TEXT: string
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/** 均线颜色 */
|
|
64
|
-
export interface MAColors {
|
|
65
|
-
MA5: string
|
|
66
|
-
MA10: string
|
|
67
|
-
MA20: string
|
|
68
|
-
MA30: string
|
|
69
|
-
MA60: string
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/** 布林带颜色 */
|
|
73
|
-
export interface BOLLColors {
|
|
74
|
-
UPPER: string
|
|
75
|
-
MIDDLE: string
|
|
76
|
-
LOWER: string
|
|
77
|
-
BAND_FILL: string
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/** MACD 颜色 */
|
|
81
|
-
export interface MACDColors {
|
|
82
|
-
DIF: string
|
|
83
|
-
DEA: string
|
|
84
|
-
BAR_UP: string
|
|
85
|
-
BAR_UP_LIGHT: string
|
|
86
|
-
BAR_DOWN: string
|
|
87
|
-
BAR_DOWN_LIGHT: string
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/** 成交量颜色 */
|
|
91
|
-
export interface VolumeColors {
|
|
92
|
-
UP: string
|
|
93
|
-
DOWN: string
|
|
94
|
-
NEUTRAL: string
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/** RSI 颜色 */
|
|
98
|
-
export interface RSIColors {
|
|
99
|
-
RSI1: string
|
|
100
|
-
RSI2: string
|
|
101
|
-
RSI3: string
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/** CCI 颜色 */
|
|
105
|
-
export interface CCIColors {
|
|
106
|
-
CCI: string
|
|
107
|
-
OVERBOUGHT: string
|
|
108
|
-
OVERSOLD: string
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/** KDJ/STOCH 颜色 */
|
|
112
|
-
export interface KDJColors {
|
|
113
|
-
K: string
|
|
114
|
-
D: string
|
|
115
|
-
J: string
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/** MOM 颜色 */
|
|
119
|
-
export interface MOMColors {
|
|
120
|
-
MOM: string
|
|
121
|
-
ZERO: string
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/** WMSR 颜色 */
|
|
125
|
-
export interface WMSRColors {
|
|
126
|
-
WMSR: string
|
|
127
|
-
OVERBOUGHT: string
|
|
128
|
-
OVERSOLD: string
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/** KST 颜色 */
|
|
132
|
-
export interface KSTColors {
|
|
133
|
-
KST: string
|
|
134
|
-
SIGNAL: string
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/** EXPMA 颜色 */
|
|
138
|
-
export interface EXPMAColors {
|
|
139
|
-
FAST: string
|
|
140
|
-
SLOW: string
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/** ENE 颜色 */
|
|
144
|
-
export interface ENEColors {
|
|
145
|
-
UPPER: string
|
|
146
|
-
MIDDLE: string
|
|
147
|
-
LOWER: string
|
|
148
|
-
BAND_FILL: string
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/** 标签专用颜色(收敛硬编码) */
|
|
152
|
-
export interface LabelColors {
|
|
153
|
-
BG: string
|
|
154
|
-
TEXT: string
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/** 最新价标签颜色 */
|
|
158
|
-
export interface LastPriceLabelColors {
|
|
159
|
-
BG: string
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/** 成交量价格标记颜色 */
|
|
163
|
-
export interface VolumePriceColors {
|
|
164
|
-
RISE_WITH: string
|
|
165
|
-
RISE_WITHOUT: string
|
|
166
|
-
FALL_WITH: string
|
|
167
|
-
FALL_WITHOUT: string
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
/** Structure 指标颜色 */
|
|
171
|
-
export interface StructureColors {
|
|
172
|
-
HH: string
|
|
173
|
-
HL: string
|
|
174
|
-
LH: string
|
|
175
|
-
LL: string
|
|
176
|
-
CHOCH: string
|
|
177
|
-
BOS: string
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/** Zones 指标颜色 */
|
|
181
|
-
export interface ZonesColors {
|
|
182
|
-
FVG_BULL_FILL: string
|
|
183
|
-
FVG_BEAR_FILL: string
|
|
184
|
-
FVG_BULL_BORDER: string
|
|
185
|
-
FVG_BEAR_BORDER: string
|
|
186
|
-
OB_BULL_FILL: string
|
|
187
|
-
OB_BEAR_FILL: string
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/** 主题色值集合 */
|
|
191
|
-
export interface ThemeColors {
|
|
192
|
-
TEXT: TextColors
|
|
193
|
-
PRICE: PriceColors
|
|
194
|
-
TAG_BG: TagBgColors
|
|
195
|
-
BORDER: BorderColors
|
|
196
|
-
GRID: GridColors
|
|
197
|
-
CROSSHAIR: CrosshairColors
|
|
198
|
-
MA: MAColors
|
|
199
|
-
BOLL: BOLLColors
|
|
200
|
-
MACD: MACDColors
|
|
201
|
-
VOLUME: VolumeColors
|
|
202
|
-
RSI: RSIColors
|
|
203
|
-
CCI: CCIColors
|
|
204
|
-
KDJ: KDJColors
|
|
205
|
-
MOM: MOMColors
|
|
206
|
-
WMSR: WMSRColors
|
|
207
|
-
KST: KSTColors
|
|
208
|
-
EXPMA: EXPMAColors
|
|
209
|
-
ENE: ENEColors
|
|
210
|
-
/** 收敛的硬编码色值 */
|
|
211
|
-
LABEL: LabelColors
|
|
212
|
-
LAST_PRICE_LABEL: LastPriceLabelColors
|
|
213
|
-
VOLUME_PRICE: VolumePriceColors
|
|
214
|
-
STRUCTURE: StructureColors
|
|
215
|
-
ZONES: ZonesColors
|
|
216
|
-
WMSR_GRID: string
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
// ==================== Light Theme ====================
|
|
220
|
-
|
|
221
|
-
const lightTextColors: TextColors = {
|
|
222
|
-
PRIMARY: 'hsl(210, 9%, 31%)',
|
|
223
|
-
SECONDARY: 'hsl(210, 9%, 35%)',
|
|
224
|
-
TERTIARY: 'hsl(210, 8%, 50%)',
|
|
225
|
-
WEAK: 'hsl(210, 7%, 65%)',
|
|
226
|
-
WHITE: 'rgba(255, 255, 255, 0.92)',
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
const lightPriceColors: PriceColors = {
|
|
230
|
-
UP: 'rgba(214, 10, 34, 1)',
|
|
231
|
-
UP_LIGHT: 'rgba(214, 10, 34, 0.92)',
|
|
232
|
-
UP_TICK: 'hsl(0, 60%, 50%)',
|
|
233
|
-
DOWN: 'rgba(3, 123, 102, 1)',
|
|
234
|
-
DOWN_LIGHT: 'rgba(3, 123, 102, 0.92)',
|
|
235
|
-
DOWN_TICK: 'hsl(150, 30%, 60%)',
|
|
236
|
-
NEUTRAL: 'rgba(0, 0, 0, 0.78)',
|
|
237
|
-
LAST_PRICE: 'rgba(196, 74, 86, 0.95)',
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
const lightTagBgColors: TagBgColors = {
|
|
241
|
-
WHITE: 'rgb(255, 255, 255)',
|
|
242
|
-
LIGHT_GRAY: 'rgba(255, 255, 255, 0.92)',
|
|
243
|
-
PURE_WHITE: '#ffffff',
|
|
244
|
-
TRANSPARENT: 'transparent',
|
|
245
|
-
ACTIVE: '#1890ff',
|
|
246
|
-
ACTIVE_HOVER: '#40a9ff',
|
|
247
|
-
HOVER: '#f0f0f0',
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
const lightBorderColors: BorderColors = {
|
|
251
|
-
DARK: 'rgba(0, 0, 0, 0.12)',
|
|
252
|
-
MEDIUM: 'rgba(0, 0, 0, 0.10)',
|
|
253
|
-
LIGHT: 'rgba(0, 0, 0, 0.08)',
|
|
254
|
-
SEPARATOR: 'rgba(0, 0, 0, 0.10)',
|
|
255
|
-
BUTTON: '#d0d0d0',
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
const lightGridColors: GridColors = {
|
|
259
|
-
HORIZONTAL: 'rgba(0, 0, 0, 0.06)',
|
|
260
|
-
VERTICAL: 'rgba(0, 0, 0, 0.12)',
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
const lightCrosshairColors: CrosshairColors = {
|
|
264
|
-
LINE: 'rgba(0, 0, 0, 0.28)',
|
|
265
|
-
LABEL_BG: 'rgb(0, 0, 0)',
|
|
266
|
-
LABEL_TEXT: 'rgba(255, 255, 255, 0.92)',
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
const lightMAColors: MAColors = {
|
|
270
|
-
MA5: 'rgba(255, 193, 37, 1)',
|
|
271
|
-
MA10: 'rgba(190, 131, 12, 1)',
|
|
272
|
-
MA20: 'rgba(69, 112, 249, 1)',
|
|
273
|
-
MA30: 'rgba(76, 175, 80, 1)',
|
|
274
|
-
MA60: 'rgba(156, 39, 176, 1)',
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
const lightBOLLColors: BOLLColors = {
|
|
278
|
-
UPPER: 'rgba(178, 34, 34, 1)',
|
|
279
|
-
MIDDLE: 'rgba(69, 112, 249, 1)',
|
|
280
|
-
LOWER: 'rgba(34, 139, 34, 1)',
|
|
281
|
-
BAND_FILL: 'rgba(100, 149, 237, 0.1)',
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
const lightMACDColors: MACDColors = {
|
|
285
|
-
DIF: 'rgba(69, 112, 249, 1)',
|
|
286
|
-
DEA: 'rgba(255, 152, 0, 1)',
|
|
287
|
-
BAR_UP: '#ff5252',
|
|
288
|
-
BAR_UP_LIGHT: '#fccbcd',
|
|
289
|
-
BAR_DOWN: '#22ab94',
|
|
290
|
-
BAR_DOWN_LIGHT: '#ace5dc',
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
const lightVolumeColors: VolumeColors = {
|
|
294
|
-
UP: '#ff5252',
|
|
295
|
-
DOWN: '#22ab94',
|
|
296
|
-
NEUTRAL: 'rgba(0, 0, 0, 0.78)',
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
const lightRSIColors: RSIColors = {
|
|
300
|
-
RSI1: 'rgba(69, 112, 249, 1)',
|
|
301
|
-
RSI2: 'rgba(255, 152, 0, 1)',
|
|
302
|
-
RSI3: 'rgba(156, 39, 176, 1)',
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
const lightCCIColors: CCIColors = {
|
|
306
|
-
CCI: 'rgba(69, 112, 249, 1)',
|
|
307
|
-
OVERBOUGHT: 'rgba(214, 10, 34, 0.5)',
|
|
308
|
-
OVERSOLD: 'rgba(3, 123, 102, 0.5)',
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
const lightKDJColors: KDJColors = {
|
|
312
|
-
K: 'rgba(69, 112, 249, 1)',
|
|
313
|
-
D: 'rgba(255, 152, 0, 1)',
|
|
314
|
-
J: 'rgba(156, 39, 176, 1)',
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
const lightMOMColors: MOMColors = {
|
|
318
|
-
MOM: 'rgba(69, 112, 249, 1)',
|
|
319
|
-
ZERO: 'rgba(0, 0, 0, 0.2)',
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
const lightWMSRColors: WMSRColors = {
|
|
323
|
-
WMSR: 'rgba(69, 112, 249, 1)',
|
|
324
|
-
OVERBOUGHT: 'rgba(214, 10, 34, 0.5)',
|
|
325
|
-
OVERSOLD: 'rgba(3, 123, 102, 0.5)',
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
const lightKSTColors: KSTColors = {
|
|
329
|
-
KST: 'rgba(69, 112, 249, 1)',
|
|
330
|
-
SIGNAL: 'rgba(255, 152, 0, 1)',
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
const lightEXPMAColors: EXPMAColors = {
|
|
334
|
-
FAST: 'rgba(255, 152, 0, 1)',
|
|
335
|
-
SLOW: 'rgba(69, 112, 249, 1)',
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
const lightENEColors: ENEColors = {
|
|
339
|
-
UPPER: 'rgba(214, 10, 34, 1)',
|
|
340
|
-
MIDDLE: 'rgba(69, 112, 249, 1)',
|
|
341
|
-
LOWER: 'rgba(3, 123, 102, 1)',
|
|
342
|
-
BAND_FILL: 'rgba(69, 112, 249, 0.08)',
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
const lightLabelColors: LabelColors = {
|
|
346
|
-
BG: 'rgba(0, 0, 0, 0.8)',
|
|
347
|
-
TEXT: '#ffffff',
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
const lightLastPriceLabelColors: LastPriceLabelColors = {
|
|
351
|
-
BG: 'rgba(255, 247, 248, 0.98)',
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
const lightVolumePriceColors: VolumePriceColors = {
|
|
355
|
-
RISE_WITH: '#FF4444',
|
|
356
|
-
RISE_WITHOUT: '#00C853',
|
|
357
|
-
FALL_WITH: '#FF4444',
|
|
358
|
-
FALL_WITHOUT: '#00C853',
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
const lightStructureColors: StructureColors = {
|
|
362
|
-
HH: '#16a34a',
|
|
363
|
-
HL: '#22c55e',
|
|
364
|
-
LH: '#dc2626',
|
|
365
|
-
LL: '#ef4444',
|
|
366
|
-
CHOCH: '#8b5cf6',
|
|
367
|
-
BOS: '#f59e0b',
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
const lightZonesColors: ZonesColors = {
|
|
371
|
-
FVG_BULL_FILL: 'rgba(34, 197, 94, 0.15)',
|
|
372
|
-
FVG_BEAR_FILL: 'rgba(239, 68, 68, 0.15)',
|
|
373
|
-
FVG_BULL_BORDER: 'rgba(34, 197, 94, 0.6)',
|
|
374
|
-
FVG_BEAR_BORDER: 'rgba(239, 68, 68, 0.6)',
|
|
375
|
-
OB_BULL_FILL: 'rgba(34, 197, 94, 0.25)',
|
|
376
|
-
OB_BEAR_FILL: 'rgba(239, 68, 68, 0.25)',
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
// ==================== Dark Theme ====================
|
|
380
|
-
|
|
381
|
-
const darkTextColors: TextColors = {
|
|
382
|
-
PRIMARY: 'hsl(210, 10%, 85%)',
|
|
383
|
-
SECONDARY: 'hsl(210, 8%, 75%)',
|
|
384
|
-
TERTIARY: 'hsl(210, 6%, 60%)',
|
|
385
|
-
WEAK: 'hsl(210, 5%, 45%)',
|
|
386
|
-
WHITE: 'rgba(255, 255, 255, 0.95)',
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
const darkPriceColors: PriceColors = {
|
|
390
|
-
UP: 'rgba(255, 80, 100, 1)',
|
|
391
|
-
UP_LIGHT: 'rgba(255, 80, 100, 0.85)',
|
|
392
|
-
UP_TICK: 'hsl(0, 70%, 60%)',
|
|
393
|
-
DOWN: 'rgba(60, 200, 160, 1)',
|
|
394
|
-
DOWN_LIGHT: 'rgba(60, 200, 160, 0.85)',
|
|
395
|
-
DOWN_TICK: 'hsl(150, 50%, 65%)',
|
|
396
|
-
NEUTRAL: 'rgba(255, 255, 255, 0.7)',
|
|
397
|
-
LAST_PRICE: 'rgba(230, 100, 115, 0.95)',
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
const darkTagBgColors: TagBgColors = {
|
|
401
|
-
WHITE: 'rgb(40, 40, 55)',
|
|
402
|
-
LIGHT_GRAY: 'rgba(50, 50, 65, 0.92)',
|
|
403
|
-
PURE_WHITE: '#282837',
|
|
404
|
-
TRANSPARENT: 'transparent',
|
|
405
|
-
ACTIVE: '#1890ff',
|
|
406
|
-
ACTIVE_HOVER: '#40a9ff',
|
|
407
|
-
HOVER: '#3a3a4a',
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
const darkBorderColors: BorderColors = {
|
|
411
|
-
DARK: 'rgba(255, 255, 255, 0.15)',
|
|
412
|
-
MEDIUM: 'rgba(255, 255, 255, 0.12)',
|
|
413
|
-
LIGHT: 'rgba(255, 255, 255, 0.08)',
|
|
414
|
-
SEPARATOR: 'rgba(255, 255, 255, 0.10)',
|
|
415
|
-
BUTTON: '#505060',
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
const darkGridColors: GridColors = {
|
|
419
|
-
HORIZONTAL: 'rgba(255, 255, 255, 0.06)',
|
|
420
|
-
VERTICAL: 'rgba(255, 255, 255, 0.10)',
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
const darkCrosshairColors: CrosshairColors = {
|
|
424
|
-
LINE: 'rgba(255, 255, 255, 0.4)',
|
|
425
|
-
LABEL_BG: 'rgb(40, 40, 55)',
|
|
426
|
-
LABEL_TEXT: 'rgba(255, 255, 255, 0.92)',
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
const darkMAColors: MAColors = {
|
|
430
|
-
MA5: 'rgba(255, 200, 50, 1)',
|
|
431
|
-
MA10: 'rgba(200, 150, 30, 1)',
|
|
432
|
-
MA20: 'rgba(90, 140, 255, 1)',
|
|
433
|
-
MA30: 'rgba(90, 190, 95, 1)',
|
|
434
|
-
MA60: 'rgba(170, 60, 195, 1)',
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
const darkBOLLColors: BOLLColors = {
|
|
438
|
-
UPPER: 'rgba(200, 60, 60, 1)',
|
|
439
|
-
MIDDLE: 'rgba(90, 140, 255, 1)',
|
|
440
|
-
LOWER: 'rgba(50, 170, 60, 1)',
|
|
441
|
-
BAND_FILL: 'rgba(120, 170, 255, 0.15)',
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
const darkMACDColors: MACDColors = {
|
|
445
|
-
DIF: 'rgba(90, 140, 255, 1)',
|
|
446
|
-
DEA: 'rgba(255, 170, 50, 1)',
|
|
447
|
-
BAR_UP: '#ff6b6b',
|
|
448
|
-
BAR_UP_LIGHT: '#ffb3b3',
|
|
449
|
-
BAR_DOWN: '#4ecdc4',
|
|
450
|
-
BAR_DOWN_LIGHT: '#a8e6e1',
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
const darkVolumeColors: VolumeColors = {
|
|
454
|
-
UP: '#ff6b6b',
|
|
455
|
-
DOWN: '#4ecdc4',
|
|
456
|
-
NEUTRAL: 'rgba(255, 255, 255, 0.6)',
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
const darkRSIColors: RSIColors = {
|
|
460
|
-
RSI1: 'rgba(90, 140, 255, 1)',
|
|
461
|
-
RSI2: 'rgba(255, 170, 50, 1)',
|
|
462
|
-
RSI3: 'rgba(180, 70, 205, 1)',
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
const darkCCIColors: CCIColors = {
|
|
466
|
-
CCI: 'rgba(90, 140, 255, 1)',
|
|
467
|
-
OVERBOUGHT: 'rgba(255, 80, 100, 0.6)',
|
|
468
|
-
OVERSOLD: 'rgba(60, 200, 160, 0.6)',
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
const darkKDJColors: KDJColors = {
|
|
472
|
-
K: 'rgba(90, 140, 255, 1)',
|
|
473
|
-
D: 'rgba(255, 170, 50, 1)',
|
|
474
|
-
J: 'rgba(180, 70, 205, 1)',
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
const darkMOMColors: MOMColors = {
|
|
478
|
-
MOM: 'rgba(90, 140, 255, 1)',
|
|
479
|
-
ZERO: 'rgba(255, 255, 255, 0.2)',
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
const darkWMSRColors: WMSRColors = {
|
|
483
|
-
WMSR: 'rgba(90, 140, 255, 1)',
|
|
484
|
-
OVERBOUGHT: 'rgba(255, 80, 100, 0.6)',
|
|
485
|
-
OVERSOLD: 'rgba(60, 200, 160, 0.6)',
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
const darkKSTColors: KSTColors = {
|
|
489
|
-
KST: 'rgba(90, 140, 255, 1)',
|
|
490
|
-
SIGNAL: 'rgba(255, 170, 50, 1)',
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
const darkEXPMAColors: EXPMAColors = {
|
|
494
|
-
FAST: 'rgba(255, 170, 50, 1)',
|
|
495
|
-
SLOW: 'rgba(90, 140, 255, 1)',
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
const darkENEColors: ENEColors = {
|
|
499
|
-
UPPER: 'rgba(255, 80, 100, 1)',
|
|
500
|
-
MIDDLE: 'rgba(90, 140, 255, 1)',
|
|
501
|
-
LOWER: 'rgba(60, 200, 160, 1)',
|
|
502
|
-
BAND_FILL: 'rgba(90, 140, 255, 0.12)',
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
const darkLabelColors: LabelColors = {
|
|
506
|
-
BG: 'rgba(30, 30, 40, 0.9)',
|
|
507
|
-
TEXT: '#ffffff',
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
const darkLastPriceLabelColors: LastPriceLabelColors = {
|
|
511
|
-
BG: 'rgba(60, 50, 55, 0.98)',
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
const darkVolumePriceColors: VolumePriceColors = {
|
|
515
|
-
RISE_WITH: '#FF6666',
|
|
516
|
-
RISE_WITHOUT: '#66FF99',
|
|
517
|
-
FALL_WITH: '#FF6666',
|
|
518
|
-
FALL_WITHOUT: '#66FF99',
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
const darkStructureColors: StructureColors = {
|
|
522
|
-
HH: '#4ade80',
|
|
523
|
-
HL: '#22c55e',
|
|
524
|
-
LH: '#f87171',
|
|
525
|
-
LL: '#ef4444',
|
|
526
|
-
CHOCH: '#a78bfa',
|
|
527
|
-
BOS: '#fbbf24',
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
const darkZonesColors: ZonesColors = {
|
|
531
|
-
FVG_BULL_FILL: 'rgba(74, 222, 128, 0.20)',
|
|
532
|
-
FVG_BEAR_FILL: 'rgba(248, 113, 113, 0.20)',
|
|
533
|
-
FVG_BULL_BORDER: 'rgba(74, 222, 128, 0.8)',
|
|
534
|
-
FVG_BEAR_BORDER: 'rgba(248, 113, 113, 0.8)',
|
|
535
|
-
OB_BULL_FILL: 'rgba(74, 222, 128, 0.35)',
|
|
536
|
-
OB_BEAR_FILL: 'rgba(248, 113, 113, 0.35)',
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
// ==================== Theme Collections ====================
|
|
540
|
-
|
|
541
|
-
const lightTheme: ThemeColors = {
|
|
542
|
-
TEXT: lightTextColors,
|
|
543
|
-
PRICE: lightPriceColors,
|
|
544
|
-
TAG_BG: lightTagBgColors,
|
|
545
|
-
BORDER: lightBorderColors,
|
|
546
|
-
GRID: lightGridColors,
|
|
547
|
-
CROSSHAIR: lightCrosshairColors,
|
|
548
|
-
MA: lightMAColors,
|
|
549
|
-
BOLL: lightBOLLColors,
|
|
550
|
-
MACD: lightMACDColors,
|
|
551
|
-
VOLUME: lightVolumeColors,
|
|
552
|
-
RSI: lightRSIColors,
|
|
553
|
-
CCI: lightCCIColors,
|
|
554
|
-
KDJ: lightKDJColors,
|
|
555
|
-
MOM: lightMOMColors,
|
|
556
|
-
WMSR: lightWMSRColors,
|
|
557
|
-
KST: lightKSTColors,
|
|
558
|
-
EXPMA: lightEXPMAColors,
|
|
559
|
-
ENE: lightENEColors,
|
|
560
|
-
LABEL: lightLabelColors,
|
|
561
|
-
LAST_PRICE_LABEL: lightLastPriceLabelColors,
|
|
562
|
-
VOLUME_PRICE: lightVolumePriceColors,
|
|
563
|
-
STRUCTURE: lightStructureColors,
|
|
564
|
-
ZONES: lightZonesColors,
|
|
565
|
-
WMSR_GRID: 'rgba(0, 0, 0, 0.1)',
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
const darkTheme: ThemeColors = {
|
|
569
|
-
TEXT: darkTextColors,
|
|
570
|
-
PRICE: darkPriceColors,
|
|
571
|
-
TAG_BG: darkTagBgColors,
|
|
572
|
-
BORDER: darkBorderColors,
|
|
573
|
-
GRID: darkGridColors,
|
|
574
|
-
CROSSHAIR: darkCrosshairColors,
|
|
575
|
-
MA: darkMAColors,
|
|
576
|
-
BOLL: darkBOLLColors,
|
|
577
|
-
MACD: darkMACDColors,
|
|
578
|
-
VOLUME: darkVolumeColors,
|
|
579
|
-
RSI: darkRSIColors,
|
|
580
|
-
CCI: darkCCIColors,
|
|
581
|
-
KDJ: darkKDJColors,
|
|
582
|
-
MOM: darkMOMColors,
|
|
583
|
-
WMSR: darkWMSRColors,
|
|
584
|
-
KST: darkKSTColors,
|
|
585
|
-
EXPMA: darkEXPMAColors,
|
|
586
|
-
ENE: darkENEColors,
|
|
587
|
-
LABEL: darkLabelColors,
|
|
588
|
-
LAST_PRICE_LABEL: darkLastPriceLabelColors,
|
|
589
|
-
VOLUME_PRICE: darkVolumePriceColors,
|
|
590
|
-
STRUCTURE: darkStructureColors,
|
|
591
|
-
ZONES: darkZonesColors,
|
|
592
|
-
WMSR_GRID: 'rgba(255, 255, 255, 0.1)',
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
/**
|
|
596
|
-
* 根据主题获取颜色配置
|
|
597
|
-
* @param theme - 主题类型 'light' | 'dark'
|
|
598
|
-
* @returns 主题色值集合
|
|
599
|
-
*/
|
|
600
|
-
export function getColors(theme: ChartTheme): ThemeColors {
|
|
601
|
-
return theme === 'dark' ? darkTheme : lightTheme
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
/**
|
|
605
|
-
* 日志颜色(与主题无关,保留常量导出)
|
|
606
|
-
*/
|
|
607
|
-
export const LOG_COLORS = {
|
|
608
|
-
INFO: 'background:#164586;color:#fff;',
|
|
609
|
-
SUCCESS: 'background:#389e0d;color:#fff;',
|
|
610
|
-
WARN: 'background:#d46b08;color:#fff;',
|
|
611
|
-
ERROR: 'background:#cf1322;color:#fff;',
|
|
612
|
-
CONSOLE: '#666',
|
|
613
|
-
} as const
|
|
614
|
-
|
|
615
|
-
/**
|
|
616
|
-
* 工具函数:根据涨跌返回颜色
|
|
617
|
-
* @param type - 涨跌类型
|
|
618
|
-
* @param theme - 主题类型
|
|
619
|
-
* @returns 对应颜色
|
|
620
|
-
*/
|
|
621
|
-
export function getPriceColor(type: 'up' | 'down' | 'neutral', theme: ChartTheme = 'light'): string {
|
|
622
|
-
const colors = getColors(theme)
|
|
623
|
-
switch (type) {
|
|
624
|
-
case 'up':
|
|
625
|
-
return colors.PRICE.UP
|
|
626
|
-
case 'down':
|
|
627
|
-
return colors.PRICE.DOWN
|
|
628
|
-
case 'neutral':
|
|
629
|
-
return colors.PRICE.NEUTRAL
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
/**
|
|
634
|
-
* 工具函数:根据涨跌百分比返回颜色
|
|
635
|
-
* @param changePercent - 涨跌百分比
|
|
636
|
-
* @param theme - 主题类型
|
|
637
|
-
* @returns 对应颜色
|
|
638
|
-
*/
|
|
639
|
-
export function getTickColor(changePercent: number, theme: ChartTheme = 'light'): string {
|
|
640
|
-
const colors = getColors(theme)
|
|
641
|
-
return changePercent >= 0 ? colors.PRICE.UP_TICK : colors.PRICE.DOWN_TICK
|
|
642
|
-
}
|