Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Getting RGB colors along a three-color gradient...

807603Feb 20 2008 — edited Feb 21 2008
Hi,

I'm having trouble figuring out the appropriate algorithm for calculating a gradient between three colors. Most of the postings on the topic are in reference to the GradientPaint class, but I am looking to color code a series of shapes based on their associated values (e.g. RED = 5, YELLOW = 0, and GREEN = -5, so value of 2 is light red).

Is there an existing class in Java that can perform these calculations? If not, could someone offer some guidance on how best to implement such an algorithm?

Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 20 2008
Added on Feb 20 2008
2 comments
112 views