Light Controls
rooomAssistant API lighting controls. Manage hemispherical light colors, intensity, and scene illumination for 3D environments.
The Default Light is a hemispherical light that is positioned at the center of the scene. You can change the colors of the light and the intensity.
light.diffuse
Set the diffuse color of the light. You have multiple options to define the color. You can pass a hex value, a color name or an array with the RGB values. If you pass random as color, a random color will be set. If you don't pass any argument, the current color will be returned.
light.diffuse(color?: string | [r: number, g: number, b: number]): Promise<[r: number, g: number, b: number]>api.light.diffuse([1, 0, 1]) // [r, g, b]
api.light.diffuse('#ff00ff') // hex
api.light.diffuse('lime') // color name
api.light.diffuse('random') // random coloractions: [{ name: 'light.diffuse', arg: '#f0f' }]light.groundColor
For hemispheric lights, set or get the ground color of the light.
GET | SETlight.groundColor(color?: string | [r: number, g: number, b: number]): Promise<[r: number, g: number, b: number]>api.light.groundColor('#ff00ff') // as hex valueactions: [{ name: 'light.groundColor', arg: 'red' }] // with color namelight.intensity
Set the intensity of the light. If no argument is provided, the current intensity will be returned.
GET | SETlight.intensity(intensity?: number): Promise<number>api.light.intensity(0.5) // dim light to 50%actions: [{ name: 'light.intensity', arg: 0.5 }] // dim light to 50%light.enabled
Enable or disable the light. If no argument is provided, the current state will be returned. The result will be a boolean.
GET | SETlight.enabled(state?: boolean): Promise<boolean>api.light.enabled(false) // disable lightactions: [{ name: 'light.enabled', arg: false }] // disable light