开发者

Java equivalent to .NET's ColorBlend

开发者_运维问答

What is the closest equivalent of .NET's ColorBlend /InterpolationColors in Java?

Update: See my own solution below. Also, I needed this for my Android App.


Nearest seems to be java.awt.GradientPaint


I think I got the answer. I was actually looking this for Android for drawing a linear gradient line with multiple colors at various stops. Turns out Android's LinearGradient's constructor takes parameters for both colors and positions. To imitate .net's ColorBlend I'll just create a ColorBlend class with setter/getters for positions and colors.


For Java SE:

http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/ext/awt/LinearGradientPaint.html

(Sun has sponsored this Apache project. It is also part of their JavaFX product line.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜