pmndrs / drei

🥉 useful helpers for react-three-fiber
https://drei.pmnd.rs/
MIT License
7.83k stars 642 forks source link

feat(GradientTexture): Support any color representation #1993

Closed lukehorvat closed 2 weeks ago

lukehorvat commented 2 weeks ago

Why

A small tweak. GradientTexture currently only supports string colors, meaning you cannot use other Three.js color representations like number or THREE.Color.

<GradientTexture colors={['#7cbfff', '#fff']} stops={[0, 1]} />

What

Add support for any valid color representation.

<GradientTexture colors={[0x7cbfff, '#fff']} stops={[0, 1]} />
<GradientTexture colors={[new THREE.Color().setHSL(0.6, 1, 0.6), '#fff']} stops={[0, 1]} />

Checklist

vercel[bot] commented 2 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
drei ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 13, 2024 5:21pm
codesandbox-ci[bot] commented 2 weeks ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

github-actions[bot] commented 2 weeks ago

:tada: This PR is included in version 9.107.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: