问题
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