Skip to content

Commit 8b3507a

Browse files
committed
Update ColorSchema.java
1 parent 6e5e0a4 commit 8b3507a

File tree

1 file changed

+1
-2
lines changed
  • name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/dashboard/heatmap

1 file changed

+1
-2
lines changed

name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/dashboard/heatmap/ColorSchema.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ DoubleFunction<Color> buildColorFunction(ResourceManager resourceManager)
109109
// Transition between yellow and black
110110
if (p > 0.6)
111111
{
112-
// 0.6 to 1.0 to 0 to 1.0
112+
// 0.6 to 1.0 to (0 to 1.0 buchen's normalization)
113113
float blackFactor = (float) ((p - 0.6) / 0.4);
114114
color = Colors.interpolate(Colors.YELLOW.getRGB(), Colors.BLACK.getRGB(), blackFactor);
115115
}
@@ -141,7 +141,6 @@ DoubleFunction<Color> buildColorFunction(ResourceManager resourceManager)
141141
*/
142142
private double normalizePerformance(double performance)
143143
{
144-
// -0.05 + 0.07 / (2 * 0.07) = 0.02 / 0.14 = -0.14285714285714285
145144
performance = Math.max(-MAX_PERFORMANCE, performance);
146145
performance = Math.min(MAX_PERFORMANCE, performance);
147146
return (performance + MAX_PERFORMANCE) / (2 * MAX_PERFORMANCE);

0 commit comments

Comments
 (0)