Skip to content

StandardMaterial.color

Summary

StandardMaterial.color reads the current color value from this StandardMaterial instance. Use it to inspect runtime state without mutating resources.

Syntax

StandardMaterial.color: Color
const value = material.color;

Parameters

This API does not take parameters.

Returns

Color - Current accessor value exposed by the runtime object.

Type Details

Color

type Color = [number, number, number];

Example

const canvas = document.querySelector("canvas");
const wgpu = await WasmGPU.create(canvas);

const material = wgpu.material.standard({ color: [0.8, 0.8, 0.9], roughness: 0.5, metallic: 0.2 });
const value = material.color;
console.log(value);

See Also