metal
A polished metal that reflects a studio gradient with a horizon stripe, tinted by the color.
Add the script once, then use the tags anywhere.
<script type="module" src="https://mmaxence.github.io/solids/solids.js"></script>
Or copy the library into your project: download solids.js from the repo and serve it yourself. No build step, no other files.
Options
| Attribute | Type | Default | Range | Description |
|---|---|---|---|---|
metal-light | number | 120 | 0 to 360 | Light azimuth (degrees) |
metal-roughness | number | 0.25 | 0 to 1 | Roughness |
Notes
Polished metal. The surface reflects a studio environment, a vertical gradient with a bright horizon stripe, tinted by the color, with a tight highlight from the key light and brighter edges. The environment is dark in the dark theme and pale in the light one.
light(0 to 360, default 120): where the key light comes from, around the view.roughness(0 to 1, default 0.25): widens the highlight and fades the horizon stripe.
<sd-scene shading="metal" metal-roughness="0.1">
<sd-ring color="color(display-p3 0.55 0.85 1)"></sd-ring>
</sd-scene>Put shading="metal" on a scene to shade every object in it, or on one object. Compare all shades on the Shades page.
License
MIT. Use it anywhere, credit appreciated.