From 9069fe211304f93b28757707b28373168b2d761b Mon Sep 17 00:00:00 2001 From: Andreas Buchen Date: Fri, 29 Nov 2024 09:09:18 +0100 Subject: [PATCH] Use available constants when calculating cutover from yellow to black Issue: #4306 --- .../portfolio/ui/views/dashboard/heatmap/ColorSchema.java | 4 ++-- 1 file changed, 2 insertions(+), 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 0ef640e9fa..c8b6ad7ba1 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 @@ -19,7 +19,7 @@ enum ColorSchema BLUE_GRAY_ORANGE(Messages.LabelBlueGrayOrange), // YELLOW_WHITE_BLACK(Messages.LabelYellowWhiteBlack); - private static final double MAX_PERFORMANCE = 0.07f; + private static final float MAX_PERFORMANCE = 0.07f; private String label; @@ -66,7 +66,7 @@ DoubleFunction buildColorFunction(ResourceManager resourceManager) var p = normalizePerformance(performance); // cutover from yellow to black at +0.05 performance - var cutover = (0.07f + 0.05f) / 0.14f; + var cutover = (MAX_PERFORMANCE + 0.05f) / 2f * MAX_PERFORMANCE; return new ColorGradient(// new ColorPoint(Colors.theme().defaultBackground(), 0), //