From 8b3507afb9777755a108ed15afd85df989053743 Mon Sep 17 00:00:00 2001 From: Alexander Ott Date: Sun, 10 Nov 2024 20:00:49 +0100 Subject: [PATCH] Update ColorSchema.java --- .../portfolio/ui/views/dashboard/heatmap/ColorSchema.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/dashboard/heatmap/ColorSchema.java b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/dashboard/heatmap/ColorSchema.java index b05a9480f9..48bd5e0a73 100644 --- a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/dashboard/heatmap/ColorSchema.java +++ b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/dashboard/heatmap/ColorSchema.java @@ -109,7 +109,7 @@ DoubleFunction buildColorFunction(ResourceManager resourceManager) // Transition between yellow and black if (p > 0.6) { - // 0.6 to 1.0 to 0 to 1.0 + // 0.6 to 1.0 to (0 to 1.0 buchen's normalization) float blackFactor = (float) ((p - 0.6) / 0.4); color = Colors.interpolate(Colors.YELLOW.getRGB(), Colors.BLACK.getRGB(), blackFactor); } @@ -141,7 +141,6 @@ DoubleFunction buildColorFunction(ResourceManager resourceManager) */ private double normalizePerformance(double performance) { - // -0.05 + 0.07 / (2 * 0.07) = 0.02 / 0.14 = -0.14285714285714285 performance = Math.max(-MAX_PERFORMANCE, performance); performance = Math.min(MAX_PERFORMANCE, performance); return (performance + MAX_PERFORMANCE) / (2 * MAX_PERFORMANCE);