diff --git a/ValueBarLib/src/com/philjay/valuebar/colors/GreenToRedFormatter.java b/ValueBarLib/src/com/philjay/valuebar/colors/GreenToRedFormatter.java index bea3599..89b7e87 100644 --- a/ValueBarLib/src/com/philjay/valuebar/colors/GreenToRedFormatter.java +++ b/ValueBarLib/src/com/philjay/valuebar/colors/GreenToRedFormatter.java @@ -8,7 +8,7 @@ public class GreenToRedFormatter implements BarColorFormatter { @Override public int getColor(float value, float maxVal, float minVal) { - float hsv[] = new float[] { ((120f * ((maxVal-minVal) - value)) / (maxVal-minVal)), 1f, 1f }; + float hsv[] = new float[] { ((120f * ((maxVal-minVal) - (value-minVal))) / (maxVal-minVal)), 1f, 1f }; return Color.HSVToColor(hsv);