Getting RGB colors along a three-color gradient...
807603Feb 20 2008 — edited Feb 21 2008Hi,
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!