Skip to content

Documentation / @ripl/3d / resolveMaterial

Function: resolveMaterial() ​

resolveMaterial(material, fill): ResolvedMaterial

Defined in: 3d/src/core/material.ts:115

Resolves a material and an element's fill into the numeric form the render path consumes.

The colour falls back through material.color, then fill, then a neutral grey, so an element that only ever set fill keeps working unchanged. A colour string this library cannot parse is left for the backend to interpret rather than replaced, which is how an unparseable fill has always behaved.

Parameters ​

ParameterTypeDescription
materialMaterial | undefinedThe material, or undefined for an unmaterialed element.
fillstring | undefinedThe element's fill.

Returns ​

ResolvedMaterial

The resolved material.