Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] HSLA colors sometimes transition incorrectly #1324

Closed
rbourdon opened this issue Nov 2, 2021 · 1 comment · Fixed by #1332
Closed

[BUG] HSLA colors sometimes transition incorrectly #1324

rbourdon opened this issue Nov 2, 2021 · 1 comment · Fixed by #1332
Labels
bug Something isn't working

Comments

@rbourdon
Copy link
Contributor

rbourdon commented Nov 2, 2021

1. Description of the bug

Animating between some HSLA colors produces strange results.

2. CodeSandbox reproduction of the bug
https://codesandbox.io/s/framer-motion-gesture-animations-forked-2ipb3?file=/src/index.js

4. Steps to reproduce

  1. Go to the sandbox
  2. Hover over the box or button
  3. Observe incorrect color transition
  4. Click button to switch to RGBA colors
  5. Observe correct color transition

5. Expected behavior
Expect HSLA color transitions to behave the same as RGBA.

@rbourdon rbourdon added the bug Something isn't working label Nov 2, 2021
@mattgperry
Copy link
Collaborator

Yeah I think this is because we do a very literal mix between hsla values. So mixing two different hues will animate the hue value like it was spinning a wheel. I'll take a look at the web spec and see how they do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants