kp123 Posted July 30, 2018 Share Posted July 30, 2018 Code: https://codepen.io/kristianpedersen/pen/JBMNyZ My Canvas drawing uses two CSS filters inside the JS code: a hue rotate and a drop shadow. It works fine when it's not animated, but as soon as I uncomment requestAnimationFrame (line 16), the hue rotate (line 34) stops working, while the shadow filter still works. I only need it to work on my machine, so browser compatibility isn't an issue. Of course, I can color the circle using a separate fillStyle call, but I thought this was a cool way of doing things. Any other comments about the code would also be appreciated. Thanks! Quote Link to comment Share on other sites More sharing options...
kp123 Posted August 2, 2018 Author Share Posted August 2, 2018 I figured it out. I had to put it between calls to c.save() and c.restore(). They're included now in drawCircle(). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.