Applying gradient coloring with one parameter

我是研究僧i 提交于 2020-01-07 02:01:48

问题


I have differnet boxes that have a certain double parameter. This parameter should determine what color the box has. The coloring should start with one color for the double value 0.0 (perhaps blue) and should end with another color for 1.0 (perhaps red). It is more or less what is done here or Conditional coloring based on a gradient.

There are different ways to define a color as stated in Oracle Docs, but it seems quiet difficult to calculate a gradient with these definitions.

Does anyone know a solution for this?


回答1:


javafx.animation.Interpolator.LINEAR.interpolate(
    color1, color2, fraction
)


来源:https://stackoverflow.com/questions/13455099/applying-gradient-coloring-with-one-parameter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!