createLight#color¶
Summary¶
createLight#color gets or sets the RGB color for any light type (ambient, directional, point, or spot). Supply three finite, nonnegative components; values above 1 can represent high-intensity colors. The color is multiplied by intensity during lighting evaluation.
Syntax¶
Parameters¶
This property does not take call parameters; assign an RGB tuple to set it.
Returns¶
[number, number, number] - Current RGB light color.
Type Details¶
Example¶
const canvas = document.querySelector("canvas");
const wgpu = await WasmGPU.create(canvas);
const light = wgpu.createLight.directional();
light.color = [1.0, 0.95, 0.85];
console.log(light.color);