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 ​
| Parameter | Type | Description |
|---|---|---|
material | Material | undefined | The material, or undefined for an unmaterialed element. |
fill | string | undefined | The element's fill. |
Returns ​
The resolved material.