Skip to content

feat(GradientTexture): Support any color representation#1993

Merged
CodyJasonBennett merged 1 commit intopmndrs:masterfrom
lukehorvat:GradientTexture-ColorRepresentation
Jun 15, 2024
Merged

feat(GradientTexture): Support any color representation#1993
CodyJasonBennett merged 1 commit intopmndrs:masterfrom
lukehorvat:GradientTexture-ColorRepresentation

Conversation

@lukehorvat
Copy link
Contributor

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

  • Ready to be merged

@vercel
Copy link

vercel bot commented Jun 13, 2024

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
Copy link

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
Copy link

🎉 This PR is included in version 9.107.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lukehorvat lukehorvat deleted the GradientTexture-ColorRepresentation branch June 16, 2024 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants