Skip to content

Correct way to approach interpolating emissive color with react-spring #763

Answered by drcmda
irobot asked this question in Q&A
Discussion options

You must be logged in to vote

this is because of spring overshooting. the warnings are harmless. if it bothers you, clamp it:

spring.to({ range: [0, 1], output: ['#000000', '#e45858'], extrapolate: 'clamp' })

if you give springs mass, they will naturally overshoot, so going below 0 and over 1. by default it tries to extend. by clamping it you force up these values.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@irobot
Comment options

@drcmda
Comment options

Answer selected by irobot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants