From d1244e4b1e994cc21dde06bca4a9a0dbe308a15e Mon Sep 17 00:00:00 2001 From: orionna319 <85230052+orionna319@users.noreply.github.com> Date: Sun, 27 Oct 2024 14:37:51 +0800 Subject: [PATCH] fix: tracks color (#730) * fix: tracks color * chore: black format --- run_page/gpxtrackposter/tracks_drawer.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/run_page/gpxtrackposter/tracks_drawer.py b/run_page/gpxtrackposter/tracks_drawer.py index 912de8ce952..216b4e8da5b 100644 --- a/run_page/gpxtrackposter/tracks_drawer.py +++ b/run_page/gpxtrackposter/tracks_drawer.py @@ -47,5 +47,10 @@ def color( diff = length_range.diameter() if diff == 0: return color1 + if ( + self.poster.length_range.upper() / 1000 + < self.poster.special_distance["special_distance2"] + ): + return color1 return interpolate_color(color1, color2, (length - length_range.lower()) / diff)