使用一个参数应用渐变着色 [英] Applying gradient coloring with one parameter

查看:106
本文介绍了使用一个参数应用渐变着色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有不同的框有一定的双参数。这个参数应该决定盒子有什么颜色。着色应该从一个颜色开始为双值0.0(可能是蓝色),并应该以另一个颜色为1.0(可能是红色)结束。 或多或少是这里做的基于渐变的条件着色

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.

有不同的方法来定义颜色,如 Oracle Docs ,但使用这些定义计算渐变似乎很难。

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.

有没有人知道这个解决方案? p>

Does anyone know a solution for this?

推荐答案

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

这篇关于使用一个参数应用渐变着色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆