Applying gradient coloring with one parameter

2019-09-07 14:18发布

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条回答
何必那么认真
2楼-- · 2019-09-07 14:21
javafx.animation.Interpolator.LINEAR.interpolate(
    color1, color2, fraction
)
查看更多
登录 后发表回答