Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 帧运动:更改颜色动画方向_Css_Framer Motion_Framerjs - Fatal编程技术网

Css 帧运动:更改颜色动画方向

Css 帧运动:更改颜色动画方向,css,framer-motion,framerjs,Css,Framer Motion,Framerjs,在Framer Motion中,我尝试使用两种颜色来平滑地设置动画。颜色为红色“hsl(0,100,50)”和蓝色“hsl(240,100,50)”。不幸的是,动画正在通过色轮,在橙色、黄色、绿色、青色等处停止。如何让动画切换“方向”,并从红色、紫色、蓝色平稳过渡?虽然这一操作非常简单,但一开始做起来并不明显 这是错误的:animate={{backgroundColor:['hsl(01000,50)','hsl(240100,50)]}, 虽然这是正确的:animate={{backgrou

在Framer Motion中,我尝试使用两种颜色来平滑地设置动画。颜色为红色“hsl(0,100,50)”和蓝色“hsl(240,100,50)”。不幸的是,动画正在通过色轮,在橙色、黄色、绿色、青色等处停止。如何让动画切换“方向”,并从红色、紫色、蓝色平稳过渡?

虽然这一操作非常简单,但一开始做起来并不明显

这是错误的:
animate={{backgroundColor:['hsl(01000,50)','hsl(240100,50)]}
,

虽然这是正确的:
animate={{backgroundColor:['hsl(01000,50)','hsl(-120100,50)]}

(为了防止任何人对这段代码的去向感到困惑,“animate”是motion.div元素中的一个道具。有关更多示例,请查看文档中的这些示例:)