Skip to content

How to update filter functions values based on x value #2308

Answered by hadikman
hadikman asked this question in Support
Discussion options

You must be logged in to vote

Hi
I used the to function to merge contrastValue and brightnessValue:

  import { to } from '@react-spring/web'

  const contrastValue = x.to(...)
  const brightnessValue = x.to(...)

  <animated.div 
          style={{
            filter: to([ contrastValue , brightnessValue ], (c, b) => `contrast(${c}%) brightness(${b})`),
          }}
        />

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hadikman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant