Fix: Stage lights using stage colors

This commit is contained in:
Dejvino 2026-01-04 07:29:43 +00:00
parent 8bf82f5f8a
commit 8b2d1aed53

View File

@ -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);
}
});
}
}