如何使用 JavaFX 制作离散颜色翻转动画?
今天刚开始使用 JavaFX,不知道如何对对象进行离散颜色翻转。我可以设置一个具有两个关键帧的时间轴,并让它设置一个对象绑定到它的填充变量的颜色值...但是当我想要的是离散触发器时,我会得到插值颜色。
Just started with JavaFX today and can't figure out how to do a discrete color flip on an object. I can set up a Timeline with two keyframes and have it set a color value that an object binds to it's fill variable... but I get interpolated colors when what I want is a discrete flip flop.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
或者您可以在 KeyFrame 的 fillColor 键值上使用离散插值器。
Or you could use a DISCRETE interpolator on KeyFrame's key value for fillColor.
这可能更符合您的需求,但它不会无限期地重复 - 可能是一个错误?
另外,我怀疑有更简洁的方法可以做到这一点。
This may be more what you're looking for, but it doesn't repeat indefinitely - might be a bug?
Also, I suspect that there are neater ways of doing this.