mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-08 20:12:23 +00:00
Fixed bug in ColorMapper that reversed the colors when outside of min/max boundaries
This commit is contained in:
1 parent
133b21f704
commit
b4e3ca5c92
1 file changed
+2
-2
@@ -50,9 +50,9 @@ public class ColorMapper implements ValueRangeFlexibleBoundariesChangedListener
|
||||
}
|
||||
} else {
|
||||
if (value < minValue) {
|
||||
result = "hsl(0, 100%, 50%)";
|
||||
} else if (value > maxValue) {
|
||||
result = "hsl(240, 100%, 50%)";
|
||||
} else if (value > maxValue) {
|
||||
result = "hsl(0, 100%, 50%)";
|
||||
} else {
|
||||
double h = (1 - (value - minValue) / (maxValue - minValue)) * 240;
|
||||
result = "hsl(" + Math.round(h) + ", 100%, 50%)";
|
||||
|
||||
Reference in new issue
Block a user