refactor(indicator): 指标颜色统一走主题 token 体系 - #114
Merged
Merged
Conversation
Completely remove the BOLL band (upper-lower fill) rendering, including the GPU fill pipeline path and the Canvas2D fill fallback. Only the upper/middle/lower line tracks remain. - drop showBand config from BOLLSchedulerConfig and BOLLRenderState - remove band point-pool building in the renderer - sync tests for the removed fill behavior
getTitleInfo 此前硬编码 MA 周期颜色,与 draw 使用的主题 token 不一致, 导致左上角图例文本颜色与线条颜色不符。现为 GetTitleInfoFn 增加 colors 参数并贯穿两个调用点,getMATitleInfo 改用 colors.ma.maX;同时将明暗 主题 ma token 统一为高对比度配色(MA10 青色、MA20 深蓝),双主题对比 度均满足 WCAG 3:1。
- createSingleLineTitleInfo 改用传入 colors,删除内置 light 主题解析 - 图例比较行 fallback 改用 palette.i2 - VOL 标题红绿改用 volumeUp/volumeDown,顺带修复亚太红涨绿跌 - 对比线删除 DEFAULT_COMPARISON_COLOR - yAxis 默认标签色改用 label token
去掉 getTitleInfo 内联 resolveThemeColors('light'),改读
colors.rsi/kst/kdj/macd/structure;rsi/kst 零线改用 wmsrGrid,
rsi 离屏虚线缓存 key 纳入 color 参数
…e 颜色主题化 - 标题硬编码 hex 改 colors.boll/ene/expma/candleUpBody/candleDownBody - zones FVG/OB 填充改 BullFill/BearFill - volumeProfile 填充/POC/VA 改 volumeProfileFill/Poc/ValueArea
- 31 个指标 draw 线色与标题色同源 palette.iN token - 零线/超买超卖带等辅助线改 wmsrGrid/cci.overbought/oversold - 红色系及无 palette 对应的 const 颜色有意保留 - 残留 const:gmma/pivot/fib/ichimoku 红棕、atr 深棕、dashedLines
config 文件本就归属 tsconfig.node.json,被 packages/**/*.ts 拉入后 defineConfig(...) 触发 TS 6.0.3 getSignatureApplicabilityError 内部 崩溃;排除后 vue-tsc --build 可正常运行到报错阶段
- 41 个指标渲染器 priority 由 RENDERER_PRIORITY.MAIN(50) 改为 INDICATOR(30) - K 线(MAIN=50)后画,主图叠加指标线落在 K 线之下,修复指标线覆盖 K 线 - 与文档契约「指标渲染器必须使用 INDICATOR 或 ≤30」一致;副图相对刻度层顺序不变
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
将核心渲染器中未接入主题 token 系统的硬编码颜色全部 token 化,修复「图例/标题颜色与 draw 线条颜色不一致」的同类 bug,并让所有单线/多线指标颜色随主题(light/dark)与配色预设变化。
改动范围(9 个提交)
GetTitleInfoFn增加colors第 6 参并贯通图例/标题两个调用点;createSingleLineTitleInfo删除内置 light 主题解析;VOL 标题红绿 →volumeUp/volumeDown(修复亚太红涨绿跌);对比线删DEFAULT_COMPARISON_COLOR;yAxis 默认标签色 → label token。wmsrGrid。palette.iN;零线/超买超卖带 →wmsrGrid/cci.overbought/oversold。wmsrGrid。*.config.*,规避 TS 6.0.3 检查 defineConfig 时的内部崩溃(历史既有问题)。设计约定
resolveThemeColors(context.theme, context.isAsiaMarket, context.colorPresetSettings)返回ColorTokens。验证
tsc -p packages/core/tsconfig.build.json --noEmit通过