From cca3709f6b48df564852142fe55f6dd2d10397c0 Mon Sep 17 00:00:00 2001 From: xudan Date: Mon, 15 Dec 2025 16:40:29 +0800 Subject: [PATCH] =?UTF-8?q?feat(editor):=20=E6=A0=B9=E6=8D=AE=E7=94=B5?= =?UTF-8?q?=E6=A2=AF=E9=97=A8=E7=8A=B6=E6=80=81=E5=8A=A8=E6=80=81=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E5=9B=BE=E6=A0=87=E5=86=85=E9=83=A8=E5=92=8C=E9=97=A8?= =?UTF-8?q?=E7=9A=84=E9=A2=9C=E8=89=B2=EF=BC=8C=E9=97=A8=E5=AE=8C=E5=85=A8?= =?UTF-8?q?=E6=89=93=E5=BC=80=E6=97=B6=E6=98=BE=E7=A4=BA=E6=98=8E=E4=BA=AE?= =?UTF-8?q?=E8=89=B2=E8=B0=83=E4=BB=A5=E5=A2=9E=E5=BC=BA=E8=A7=86=E8=A7=89?= =?UTF-8?q?=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/editor/editor-drawers.ts | 43 +++++++++++++++++++++------ 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/src/services/editor/editor-drawers.ts b/src/services/editor/editor-drawers.ts index 18320f0..b4fb09d 100644 --- a/src/services/editor/editor-drawers.ts +++ b/src/services/editor/editor-drawers.ts @@ -85,11 +85,26 @@ function drawElevatorIcon( ctx.fillStyle = gradient; ctx.fillRect(x, y, width, height); - // 电梯内框 - 深金属色 + // 电梯内框 - 根据门状态调整内部颜色 const innerGradient = ctx.createLinearGradient(x + 2, y + 2, x + width - 2, y + height - 2); - innerGradient.addColorStop(0, '#374151'); - innerGradient.addColorStop(0.5, '#1f2937'); - innerGradient.addColorStop(1, '#111827'); + + // 根据门状态调整内部背景 + let innerColor1, innerColor2, innerColor3; + if (doorStatus === 3) { + // 门完全打开,内部显示明亮的白色调,表示门已开 + innerColor1 = '#fefefe'; // 几乎白色 + innerColor2 = '#f8fafc'; // 极浅灰白 + innerColor3 = '#f1f5f9'; // 浅灰白色 + } else { + // 门关闭或开关中,保持深金属色 + innerColor1 = '#374151'; // 深金属色 + innerColor2 = '#1f2937'; // 更深金属色 + innerColor3 = '#111827'; // 最深金属色 + } + + innerGradient.addColorStop(0, innerColor1); + innerGradient.addColorStop(0.5, innerColor2); + innerGradient.addColorStop(1, innerColor3); ctx.fillStyle = innerGradient; ctx.fillRect(x + 2, y + 2, width - 4, height - 4); @@ -114,11 +129,21 @@ function drawElevatorIcon( const doorY = y + 4; const doorGap = doorWidth * doorProgress; // 两扇门之间的间隙 - // 保持金属质感,不根据运动状态改变门的颜色 - const doorColor1 = '#94a3b8'; // 浅金属蓝灰 - const doorColor2 = '#64748b'; // 中金属蓝灰 - const doorColor3 = '#475569'; // 深金属蓝灰 - const doorColor4 = '#334155'; // 最深金属蓝灰 + // 根据门开合状态调整门的颜色 + let doorColor1, doorColor2, doorColor3, doorColor4; + if (doorProgress > 0.5) { + // 门打开状态超过50%,使用偏白色系表示门已开 + doorColor1 = '#f8fafc'; // 非常浅的灰白色 + doorColor2 = '#f1f5f9'; // 浅灰白色 + doorColor3 = '#e2e8f0'; // 中浅灰白色 + doorColor4 = '#cbd5e1'; // 灰白色 + } else { + // 门关闭或半开状态,保持金属质感 + doorColor1 = '#94a3b8'; // 浅金属蓝灰 + doorColor2 = '#64748b'; // 中金属蓝灰 + doorColor3 = '#475569'; // 深金属蓝灰 + doorColor4 = '#334155'; // 最深金属蓝灰 + } // 绘制左门 - 金属门质感(无门把手) if (doorWidth - doorGap / 2 > 0) {