feat: 股票球跌幅改为绿色空心球体
涨: 保留分级实心(覆盖数越多越红) + 红色光晕; 跌: 绿色空心球(绿描边+内部淡绿留白) + 绿色光晕。 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+28
-17
@@ -406,23 +406,34 @@ function drawStockNodes(
|
|||||||
ctx.globalAlpha = 1;
|
ctx.globalAlpha = 1;
|
||||||
ctx.fill();
|
ctx.fill();
|
||||||
|
|
||||||
// 外圈淡填充
|
if (isPos) {
|
||||||
const fill = cover >= 7 ? "#dc2626" : cover >= 5 ? "#ef4444" : "#f97316";
|
// 涨:外圈淡填充 + 分级描边 + 内实心(覆盖数越多越红)
|
||||||
ctx.beginPath();
|
const fill = cover >= 7 ? "#dc2626" : cover >= 5 ? "#ef4444" : "#f97316";
|
||||||
ctx.arc(x, y, pr, 0, TAU);
|
ctx.beginPath();
|
||||||
ctx.fillStyle = fill;
|
ctx.arc(x, y, pr, 0, TAU);
|
||||||
ctx.globalAlpha = 0.35 * alpha;
|
ctx.fillStyle = fill;
|
||||||
ctx.fill();
|
ctx.globalAlpha = 0.35 * alpha;
|
||||||
// 描边
|
ctx.fill();
|
||||||
ctx.strokeStyle = cover >= 2 ? "#f59e0b" : "#94a3b8";
|
ctx.strokeStyle = cover >= 2 ? "#f59e0b" : "#94a3b8";
|
||||||
ctx.lineWidth = cover >= 2 ? (cover >= 4 ? 2 : 1.5) : 0.5;
|
ctx.lineWidth = cover >= 2 ? (cover >= 4 ? 2 : 1.5) : 0.5;
|
||||||
ctx.globalAlpha = alpha;
|
ctx.globalAlpha = alpha;
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
// 内实心
|
ctx.beginPath();
|
||||||
ctx.beginPath();
|
ctx.arc(x, y, pr, 0, TAU);
|
||||||
ctx.arc(x, y, pr, 0, TAU);
|
ctx.globalAlpha = (cover >= 2 ? 0.9 : 0.55) * alpha;
|
||||||
ctx.globalAlpha = (cover >= 2 ? 0.9 : 0.55) * alpha;
|
ctx.fill();
|
||||||
ctx.fill();
|
} else {
|
||||||
|
// 跌:绿色空心球(仅描边,内部淡绿留白)
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.arc(x, y, pr, 0, TAU);
|
||||||
|
ctx.strokeStyle = "#22c55e";
|
||||||
|
ctx.lineWidth = 2;
|
||||||
|
ctx.globalAlpha = dim ? 0.15 : 1;
|
||||||
|
ctx.stroke();
|
||||||
|
ctx.fillStyle = "#22c55e";
|
||||||
|
ctx.globalAlpha = dim ? 0.02 : 0.1;
|
||||||
|
ctx.fill();
|
||||||
|
}
|
||||||
// 选中外环
|
// 选中外环
|
||||||
if (isActive) {
|
if (isActive) {
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
|
|||||||
Reference in New Issue
Block a user