From 8b2d1aed537f5ca2ddd897ee706e4311ab851e1a Mon Sep 17 00:00:00 2001 From: Dejvino Date: Sun, 4 Jan 2026 07:29:43 +0000 Subject: [PATCH] Fix: Stage lights using stage colors --- party-stage/src/scene/stage-lights.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/party-stage/src/scene/stage-lights.js b/party-stage/src/scene/stage-lights.js index 78ca2b9..9e3330c 100644 --- a/party-stage/src/scene/stage-lights.js +++ b/party-stage/src/scene/stage-lights.js @@ -138,21 +138,29 @@ export class StageLights extends SceneFeature { // Update each light const intensity = state.music ? 20 + state.music.beatIntensity * 150 : 50; - const hue = (time * 0.2) % 1; - const color = new THREE.Color().setHSL(hue, 0.8, 0.5); - const spread = 0.2 + (state.music ? state.music.beatIntensity * 0.4 : 0); const bounce = state.music ? state.music.beatIntensity * 0.5 : 0; + const palette = state.config.lightBarColors; - this.lights.forEach((item) => { + this.lights.forEach((item, index) => { // Converge lights on focus point, but keep slight X offset for spread const targetX = this.focusPoint.x + (item.baseX * spread); item.target.position.set(targetX, this.focusPoint.y + bounce, this.focusPoint.z); item.fixture.lookAt(targetX, this.focusPoint.y, this.focusPoint.z); item.light.intensity = intensity; - item.light.color.copy(color); - item.lens.material.color.copy(color); + + if (palette && palette.length > 0) { + const colorIndex = Math.floor(time * 0.5) % palette.length; + const c = new THREE.Color(palette[colorIndex]); + item.light.color.copy(c); + item.lens.material.color.copy(c); + } else { + const hue = (time * 0.2) % 1; + const c = new THREE.Color().setHSL(hue, 0.8, 0.5); + item.light.color.copy(c); + item.lens.material.color.copy(c); + } }); } }